def process_rule(edges: Edges, ast: Function, rule: Mapping[str, Any], spec: BELSpec):
ast_type = ast.__class__.__name__<EOL>trigger_functions = rule.get("<STR_LIT>", [])<EOL>trigger_types = rule.get("<STR_LIT>", [])<EOL>rule_subject = rule.get("<STR_LIT>")<EOL>rule_relation = rule.get("<STR_LIT>")<EOL>rule_object = rule.get("<STR_LIT:object>")<EOL>log.debug(f"<STR_LIT>")<EOL>if isinstance(ast, Function):<EOL><INDENT>function_name = ast.name<EOL>args = ast.args<EOL>parent_function = ast.parent_function<EOL>if function_name in trigger_functions:<EOL><INDENT>if rule_subject == "<STR_LIT>":<EOL><INDENT>subject = ast<EOL><DEDENT>if rule_object == "<STR_LIT:args>":<EOL><INDENT>for arg in args:<EOL><INDENT>log.debug(f"<STR_LIT>")<EOL>edge_ast = BELAst(subject, rule_relation, arg, spec)<EOL>edges.append(edge_ast)<EOL><DEDENT><DEDENT>elif rule_object == "<STR_LIT>" and parent_function:<EOL><INDENT>log.debug(f"<STR_LIT>")<EOL>edge_ast = BELAst(subject, rule_relation, parent_function, spec)<EOL>edges.append(edge_ast)<EOL><DEDENT><DEDENT>elif ast_type in trigger_types:<EOL><INDENT>if rule_subject == "<STR_LIT>":<EOL><INDENT>subject = ast<EOL><DEDENT>if rule_object == "<STR_LIT:args>":<EOL><INDENT>for arg in args:<EOL><INDENT>log.debug(f"<STR_LIT>")<EOL>edge_ast = BELAst(subject, rule_relation, arg, spec)<EOL>edges.append(edge_ast)<EOL><DEDENT><DEDENT>elif rule_object == "<STR_LIT>" and parent_function:<EOL><INDENT>log.debug(f"<STR_LIT>")<EOL>edge_ast = BELAst(subject, rule_relation, parent_function, spec)<EOL>edges.append(edge_ast)<EOL><DEDENT><DEDENT><DEDENT>if isinstance(ast, NSArg):<EOL><INDENT>term = "<STR_LIT>".format(ast.namespace, ast.value)<EOL>parent_function = ast.parent_function<EOL>if ast_type in trigger_types:<EOL><INDENT>if rule_subject == "<STR_LIT>":<EOL><INDENT>subject = term<EOL><DEDENT>if rule_object == "<STR_LIT:args>":<EOL><INDENT>for arg in args:<EOL><INDENT>log.debug(f"<STR_LIT>")<EOL>edge_ast = BELAst(subject, rule_relation, arg, spec)<EOL>edges.append(edge_ast)<EOL><DEDENT><DEDENT>elif rule_object == "<STR_LIT>" and parent_function:<EOL><INDENT>log.debug(f"<STR_LIT>")<EOL>edge_ast = BELAst(subject, rule_relation, parent_function, spec)<EOL>edges.append(edge_ast)<EOL><DEDENT><DEDENT><DEDENT>if hasattr(ast, "<STR_LIT:args>"):<EOL><INDENT>for arg in ast.args:<EOL><INDENT>process_rule(edges, arg, rule, spec)<EOL><DEDENT><DEDENT>
Process computed edge rule

    Recursively processes BELAst versus a single computed edge rule

    Args:
        edges (List[Tuple[Union[Function, str], str, Function]]): BEL Edge ASTs
        ast (Function): BEL Function AST
        rule (Mapping[str, Any]: computed edge rule