def _owner_isinstance(inp, test_class):
 return (bool(inp.owner) and isinstance(inp.owner.op, test_class))

def _owner_isinstance ( inp , test_class ) : return ( bool ( inp . owner ) and isinstance ( inp . owner . op , test_class ) )
tests whether input has an owner and if its owner is of type test_class .