def get_api_request_user(request):
    """
    Determines if this is an API request and returns the corresponding user
    if so.
    """
    if request.is_ajax():
        return False

    auth_header = request.META.get('HTTP_AUTHORIZATION')
    if not auth_header:
        return False
    try:
        #late import
        from landing.models import SEEDUser as User
        username, api_key = auth_header.split(':')
        return User.objects.get(api_key=api_key, username=username)
    except (__HOLE__, User.DoesNotExist):
        return False
dataset/ETHPy150Open buildingenergy/buildingenergy-platform/seed/utils/api.py/get_api_request_user