def validate_token_and_source(token_in_headers, token_in_query_params):
 if ((not token_in_headers) and (not token_in_query_params)):
  LOG.audit('Token is not found in header or query parameters.')
  raise exceptions.TokenNotProvidedError('Token is not provided.')
 if token_in_headers:
  LOG.audit('Token provided in headers')
 if token_in_query_params:
  LOG.audit('Token provided in query parameters')
 return validate_token((token_in_headers or token_in_query_params))

def validate_token_and_source ( token_in_headers , token_in_query_params ) : if ( ( not token_in_headers ) and ( not token_in_query_params ) ) : LOG . audit ( 'Token is not found in header or query parameters.' ) raise exceptions . TokenNotProvidedError ( 'Token is not provided.' ) if token_in_headers : LOG . audit ( 'Token provided in headers' ) if token_in_query_params : LOG . audit ( 'Token provided in query parameters' ) return validate_token ( ( token_in_headers or token_in_query_params ) )
validate the provided authentication token .