def populate_ast_nsarg_orthologs(ast, species):
ortholog_namespace = "<STR_LIT>"<EOL>if isinstance(ast, NSArg):<EOL><INDENT>if re.match(ortholog_namespace, ast.canonical):<EOL><INDENT>orthologs = bel.terms.orthologs.get_orthologs(<EOL>ast.canonical, list(species.keys())<EOL>)<EOL>for species_id in species:<EOL><INDENT>if species_id in orthologs:<EOL><INDENT>orthologs[species_id]["<STR_LIT>"] = species[species_id]<EOL><DEDENT><DEDENT>ast.orthologs = copy.deepcopy(orthologs)<EOL><DEDENT><DEDENT>if hasattr(ast, "<STR_LIT:args>"):<EOL><INDENT>for arg in ast.args:<EOL><INDENT>populate_ast_nsarg_orthologs(arg, species)<EOL><DEDENT><DEDENT>return ast<EOL>
Recursively collect NSArg orthologs for BEL AST

    This requires bo.collect_nsarg_norms() to be run first so NSArg.canonical is available

    Args:
        ast: AST at recursive point in belobj
        species: dictionary of species ids vs labels for or