<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def refs_equal(olditem, newitem):
 """ tests for exactly identical references """

        oldrefs = olditem.references
        newrefs = newitem.references

        ref_equal = lambda oldref, newref: True if (len(oldref) == len(newref)) and all(
            x in oldref for x in newref) else False
        if len(oldrefs) == len(newrefs) and all(
                any(ref_equal(oldref, newref) for oldref in oldrefs) for newref in newrefs):
            return True
        else:
            return False