#NEWLINE# def class_mapper( class_ , configure = True ) : #NEWLINE# #INDENT# 'Given a class, return the primary :class:`.Mapper` associated\n    with the key.\n\n    Raises :exc:`.UnmappedClassError` if no mapping is configured\n    on the given class, or :exc:`.ArgumentError` if a non-class\n    object is passed.\n\n    Equivalent functionality is available via the :func:`.inspect`\n    function as::\n\n        inspect(some_mapped_class)\n\n    Using the inspection system will raise\n    :class:`sqlalchemy.exc.NoInspectionAvailable` if the class is not mapped.\n\n    ' #NEWLINE# mapper = _inspect_mapped_class ( class_ , configure = configure ) #NEWLINE# if ( mapper is None ) : #NEWLINE# #INDENT# if ( not isinstance ( class_ , type ) ) : #NEWLINE# #INDENT# raise sa_exc . ArgumentError ( ( "Class object expected, got '%r'." % ( class_ , ) ) ) #NEWLINE# #UNINDENT# raise exc . UnmappedClassError ( class_ ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return mapper