def configure_mappers():

    if not Mapper._new_mappers:
        return

    _CONFIGURE_MUTEX.acquire()
    try:
        global _already_compiling
        if _already_compiling:
            return
        _already_compiling = True
        try:

            # double-check inside mutex
            if not Mapper._new_mappers:
                return

            Mapper.dispatch(Mapper).before_configured()
            # initialize properties on all mappers
            # note that _mapper_registry is unordered, which
            # may randomly conceal/reveal issues related to
            # the order of mapper compilation

            for mapper in list(_mapper_registry):
                if getattr(mapper, '_configure_failed', False):
                    e = sa_exc.InvalidRequestError(
                        "One or more mappers failed to initialize - "
                        "can't proceed with initialization of other "
                        "mappers.  Original exception was: %s"
                        % mapper._configure_failed)
                    e._configure_failed = mapper._configure_failed
                    raise e
                if not mapper.configured:
                    try:
                        mapper._post_configure_properties()
                        mapper._expire_memoizations()
                        mapper.dispatch.mapper_configured(
                            mapper, mapper.class_)
                    except:
                        exc = sys.exc_info()[1]
                        if not hasattr(exc, '_configure_failed'):
                            mapper._configure_failed = exc
                        raise

            Mapper._new_mappers = False
        finally:
            _already_compiling = False
    finally:
        _CONFIGURE_MUTEX.release()
    Mapper.dispatch(Mapper).after_configured()
Authenticate the request and return a two-tuple of (user, token).
dataset/ETHPy150Open goFrendiAsgard/kokoropy/kokoropy/packages/sqlalchemy/orm/mapper.py/configure_mappers--crossover with--dataset/ETHPy150Open tomchristie/django-rest-framework/rest_framework/authentication.py/BaseAuthentication.authenticate