<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_obsoleted_by_pid(pid):
 """Return True if ``pid`` is referenced in the obsoletedBy field of any object. This will return True even if the PID is in the obsoletes field of an object that does not exist on the local MN, such as replica that is in an incomplete chain. """

    return d1_gmn.app.models.ScienceObject.objects.filter(
        obsoleted_by__did=pid
    ).exists()