def METHOD_NAME(newdep, olddep):
    if newdep.name == olddep:
        return True
    for parentdep_name in newdep.dependent_names:
        if parentdep_name == olddep:
            return True
        else:
            parentdep = _pipeline.Pipeline.get_default_pipeline(
            ).ops[parentdep_name]
            if parentdep:
                if METHOD_NAME(parentdep, olddep):
                    return True
    return False