@staticmethod
    def _get_credentials(request):
        authorization = AUTHORIZATION(request.environ)
        try:
            authmeth, auth = authorization.split(' ', 1)
        except __HOLE__: # not enough values to unpack
            return None
        if authmeth.lower() == 'basic':
            try:
                auth = auth.strip().decode('base64')
            except binascii.Error: # can't decode
                return None
            try:
                login, password = auth.split(':', 1)
            except ValueError: # not enough values to unpack
                return None
            return {'login':login, 'password':password}

        return None
dataset/ETHPy150Open SMFOSS/CheesePrism/cheeseprism/auth.py/BasicAuthenticationPolicy._get_credentials