def _is_mapped_class(entity):
 insp = inspection.inspect(entity, False)
 return ((insp is not None) and hasattr(insp, 'mapper') and (insp.is_mapper or insp.is_aliased_class))

def _is_mapped_class ( entity ) : insp = inspection . inspect ( entity , False ) return ( ( insp is not None ) and hasattr ( insp , 'mapper' ) and ( insp . is_mapper or insp . is_aliased_class ) )
return true if the given object is a mapped class .