def has_parent(cls, obj, key, optimistic=False):
 manager = manager_of_class(cls)
 state = instance_state(obj)
 return manager.has_parent(state, key, optimistic)

def has_parent ( cls , obj , key , optimistic = False ) : manager = manager_of_class ( cls ) state = instance_state ( obj ) return manager . has_parent ( state , key , optimistic )
checks if basepath is somewhere in objs parent tree .