def is_same_function(f1, f2):
if f1 is f2:<EOL><INDENT>return True<EOL><DEDENT>if f1.__class__ is not f2.__class__:<EOL><INDENT>return False<EOL><DEDENT>if isinstance(f1, calldef_members.member_calldef_t) andf1.has_const != f2.has_const:<EOL><INDENT>return False<EOL><DEDENT>if f1.name != f2.name:<EOL><INDENT>return False<EOL><DEDENT>if not is_same_return_type(f1, f2):<EOL><INDENT>return False<EOL><DEDENT>if len(f1.arguments) != len(f2.arguments):<EOL><INDENT>return False<EOL><DEDENT>for f1_arg, f2_arg in zip(f1.arguments, f2.arguments):<EOL><INDENT>if not type_traits.is_same(f1_arg.decl_type, f2_arg.decl_type):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL>
returns true if f1 and f2 is same function

    Use case: sometimes when user defines some virtual function in base class,
    it overrides it in a derived one. Sometimes we need to know whether two
    member functions is actually same function.