<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compute_edges( self, rules: List[str] = None, ast_result=False, fmt="medium" ) -> List[Mapping[str, Any]]: """Computed edges from primary BEL statement Takes an AST and generates all computed edges based on BEL Specification YAML computed signatures. Will run only the list of computed edge rules if given. Args: rules (list):
 a list of rules to filter; only the rules in this list will be applied to computed fmt (str):
 short, medium or long version of BEL Edge (function and relation names) Returns: List[Mapping[str, Any]]: BEL Edges in medium format """


        if not self.ast:
            return self

        edges_asts = bel.edge.computed.compute_edges(self.ast, self.spec)

        if ast_result:
            return edges_asts

        edges = []
        for ast in edges_asts:
            edges.append(
                {
                    "subject": ast.bel_subject.to_string(),
                    "relation": ast.bel_relation,
                    "object": ast.bel_object.to_string(),
                }
            )

        return edges