<jupyter_start><jupyter_text>Welcome on the Jupyter notebook for the prescience python client !Before you can start using this `Jupyterlab`, don't forget to :* Run this notebook first* Then fill your prescience token on the text area* Click on the button How to run this notebook ?On the jupyter menu : `Run` > `Run all Cells` How to Get a prescience token ?If you don't have a prescience token yet, you can request one [here](https://survey.ovh.com/index.php/379341?lang=en)<jupyter_code>from IPython.display import display
import ipywidgets as widgets
from ipywidgets import HBox, Layout

from prescience_client import prescience
from termcolor import colored
from prescience_client.exception.prescience_client_exception import PrescienceClientException, PrescienceException

text = widgets.Textarea(
    value='',
    description='Your token :',
    disabled=False,
    layout=Layout(width='100%')
)
HBox([text], layout=Layout(width='100%'))

def on_button_clicked(b):
    with output:
        output.clear_output()
        set_token()

def set_token():
    token = text.value
    try:
        if token == '' or token is None:
            raise PrescienceClientException(Exception('Your TOKEN is not set, please fill it.'))
        prescience.config().set_project('default', token)
        prescience.sources()
        print(f'--------------[{colored("DONE", "green")}]--------------')
        print('Everything is fine ! You can start using this notebook on your project')
        print('-----------------------------------')
    except PrescienceException as e:
        e.print()
    except Exception as e:
        print(e)

button = widgets.Button(
    description="Click here to use this token on this notebook",
    icon='check',
    layout=Layout(width='100%')
)
button.on_click(on_button_clicked)
output = widgets.Output()

display(text, button, output)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12995245641838352, 'fraction_numerical': 0.00792393026941363, 'mean_word_length': 3.520286396181384, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '522668', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 565, 'n_tokens_neox': 542, 'n_words': 176, 'path': 'index.ipynb', 'repo_name': 'ovh/prescience-client', 'size': '1893'}