def token_to_blob(token):
  if isinstance(token, ClientLoginToken):
    return _join_token_parts('1c', token.token_string)
  # Check for secure auth sub type first since it is a subclass of
  # AuthSubToken.
  elif isinstance(token, SecureAuthSubToken):
    return _join_token_parts('1s', token.token_string, token.rsa_private_key,
                             *token.scopes)
  elif isinstance(token, AuthSubToken):
    return _join_token_parts('1a', token.token_string, *token.scopes)
  elif isinstance(token, TwoLeggedOAuthRsaToken):
    return _join_token_parts(
        '1rtl', token.consumer_key, token.rsa_private_key, token.requestor_id)
  elif isinstance(token, TwoLeggedOAuthHmacToken):
    return _join_token_parts(
        '1htl', token.consumer_key, token.consumer_secret, token.requestor_id)
  # Check RSA OAuth token first since the OAuthRsaToken is a subclass of
  # OAuthHmacToken.
  elif isinstance(token, OAuthRsaToken):
    return _join_token_parts(
        '1r', token.consumer_key, token.rsa_private_key, token.token,
        token.token_secret, str(token.auth_state), token.next,
        token.verifier)
  elif isinstance(token, OAuthHmacToken):
    return _join_token_parts(
        '1h', token.consumer_key, token.consumer_secret, token.token,
        token.token_secret, str(token.auth_state), token.next,
        token.verifier)
  elif isinstance(token, OAuth2Token):
    return _join_token_parts(
        '2o', token.client_id, token.client_secret, token.scope,
        token.user_agent, token.auth_uri, token.token_uri,
        token.access_token, token.refresh_token)
  else:
    raise UnsupportedTokenType(
        'Unable to serialize token of type %s' % type(token))
Run the query against the database and returns the result(s). The
dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/attic/PicasaSnap/gdata/gauth.py/token_to_blob--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/db/models/sql/compiler.py/SQLCompiler.execute_sql