<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate(token):
 """Validate token and return auth context."""

    token_url = TOKEN_URL_FMT.format(token=token)
    headers = {
        'x-auth-token': token,
        'accept': 'application/json',
    }
    resp = requests.get(token_url, headers=headers)

    if not resp.status_code == 200:
        raise HTTPError(status=401)
    return resp.json()