check if the user exists with the specified username

def user_exists(username,
                token_manager=None,
                app_url=defaults.APP_URL):
    """
    check if the user exists with the specified username

    """
    headers = token_manager.get_access_token_headers()
    auth_url = environment.get_auth_url(app_url=app_url)
    url = "%s/api/v1/accounts?username=%s" % (auth_url, username)
    response = requests.get(url, headers=headers)

    if response.status_code == 404:
        return False
    elif response.status_code == 200:
        return True
    else:
        raise JutException('Error %s: %s' % (response.status_code, response.text))