

def oauth_token_info_from_body(http_body):
    "Exracts an OAuth request token from the server's response.\n\n  Returns:\n    A tuple of strings containing the OAuth token and token secret. If\n    neither of these are present in the body, returns (None, None)\n  "
    token = None
    token_secret = None
    for pair in http_body.split('&'):
        if pair.startswith('oauth_token='):
            token = urllib.unquote(pair[len('oauth_token='):])
        if pair.startswith('oauth_token_secret='):
            token_secret = urllib.unquote(pair[len('oauth_token_secret='):])
    return (token, token_secret)

dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/attic/PicasaSnap/gdata/gauth.py oauth_token_info_from_body/original