<jupyter_start><jupyter_text>Client> This module provides a client for a [clio-store](https://github.com/clio-janelia/clio-store) data service.<jupyter_code>#hide
from nbdev.showdoc import *
from fastcore.test import *<jupyter_output><empty_output><jupyter_text>This would be a *comment* describing **the below**.<jupyter_code>from requests import Session, RequestException, HTTPError
from requests.adapters import HTTPAdapter
from requests_oauthlib import OAuth2Session
from pydantic import BaseModel
client_id = '464281314980-m5mvi0q2aa3kl9racf3njjb42mvbfnvd.apps.googleusercontent.com'
client_secret = '<KEY>'
redirect_uri = 'urn:ietf:wg:oauth:2.0:oob'
authorization_base_url = "https://accounts.google.com/o/oauth2/v2/auth"
token_url = "https://www.googleapis.com/oauth2/v4/token"
scope = ["https://www.googleapis.com/auth/userinfo.email", "openid", "https://www.googleapis.com/auth/userinfo.profile"]
google = OAuth2Session(client_id, scope=scope, redirect_uri=redirect_uri)
authorization_url, state = google.authorization_url(authorization_base_url,
# offline for refresh token
# force to always make user click authorize
    access_type="offline", prompt="select_account")
print(f'se go this web page and authorize this client: {authorization_url}')
# Get the authorization verifier code and exchange for token
authorization_code = input('Paste copy the authorization code here:')
token = google.fetch_token(token_url, code=authorization_code, client_secret=client_secret)
id_token = token.get('id_token')
print(f'You can save this token in the environment variable CLIO_STORE_TOKEN and it will be reused:\n\n{id_token}\n')
token<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10744297719087635, 'fraction_numerical': 0.01680672268907563, 'mean_word_length': 7.505102040816326, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 11, 'https://': 5, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '278813', 'license': 'Apache-2.0', 'n_tokens_mistral': 560, 'n_tokens_neox': 543, 'n_words': 124, 'path': '00_core.ipynb', 'repo_name': 'DocSavage/clio-store-py', 'size': '1685'}