<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def equals(self, that, include_ref=False, fref=None):
 """ Tests for equality of two statements. If comparing references, the order of the arguments matters!!! self is the current statement, the next argument is the new statement. Allows passing in a function to use to compare the references 'fref'. Default is equality. fref accepts two arguments 'oldrefs' and 'newrefs', each of which are a list of references, where each reference is a list of statements """

        if not include_ref:
            # return the result of WDBaseDataType.__eq__, which is testing for equality of value and qualifiers
            return self == that
        if include_ref and self != that:
            return False
        if include_ref and fref is None:
            fref = WDBaseDataType.refs_equal
        return fref(self, that)