

def token_from_blob(blob):
    "Deserializes a token string from the datastore back into a token object.\n\n  Supported token classes: ClientLoginToken, AuthSubToken, SecureAuthSubToken,\n  OAuthRsaToken, and OAuthHmacToken, TwoLeggedOAuthRsaToken,\n  TwoLeggedOAuthHmacToken and OAuth2Token.\n\n  Args:\n    blob: string created by token_to_blob.\n\n  Raises:\n    UnsupportedTokenType if the token is not one of the supported token\n    classes listed above.\n\n  Returns:\n    A new token object with members set to the values serialized in the\n    blob string. Note that any members which were set to '' in the original\n    token will now be None.\n  "
    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], auth_state[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]))

dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/attic/PicasaSnap/gdata/gauth.py token_from_blob/VarMisuse@260/571 `parts`->`auth_state`