def login_user(login_form):
    url = BH_URL + "/api/v1/login"
    try:
        response = requests.post(url,
                                 data=login_form.to_JSON(),
                                 headers=json_headers)

        response.raise_for_status()
        login_response_json = json.dumps(response.json())
        return LoginResponse.from_JSON(login_response_json).access_token

    except ConnectionError as error:
        print("Looks like there's a connection error. Please try again later")
        return None
    except __HOLE__ as error:
        if response.status_code == 409 or 401:
            print(response.text)
        else:
            print(error)
            print("Please try again...")
        return None
dataset/ETHPy150Open rcaloras/bashhub-client/bashhub/rest_client.py/login_user