def token_from_blob(blob):
  parts = _split_token_parts(blob)
  if parts[0] == '1c':
    return ClientLoginToken(parts[1])
  elif parts[0] == '1a':
    return AuthSubToken(parts[1], parts[2:])
  elif parts[0] == '1s':
    return SecureAuthSubToken(parts[1], parts[2], parts[3:])
  elif parts[0] == '1rtl':
    return TwoLeggedOAuthRsaToken(parts[1], parts[2], parts[3])
  elif parts[0] == '1htl':
    return TwoLeggedOAuthHmacToken(parts[1], parts[2], parts[3])
  elif parts[0] == '1r':
    auth_state = int(parts[5])
    return OAuthRsaToken(parts[1], parts[2], parts[3], parts[4], auth_state,
                         parts[6], parts[7])
  elif parts[0] == '1h':
    auth_state = int(parts[5])
    return OAuthHmacToken(parts[1], parts[2], parts[3], parts[4], auth_state,
                          parts[6], parts[7])
  elif parts[0] == '2o':
    return OAuth2Token(parts[1], parts[2], parts[3], parts[4], parts[5],
                       parts[6], parts[7], parts[8])
  else:
    raise UnsupportedTokenType(
        'Unable to deserialize token with type marker of %s' % parts[0])
Use the model object for the Traits UI context, if appropriate.
dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/attic/PicasaSnap/gdata/gauth.py/token_from_blob--crossover with--dataset/ETHPy150Open enthought/pyface/pyface/tasks/traits_task_pane.py/TraitsTaskPane.trait_context