<jupyter_start><jupyter_text>**App Usage Statistics**<jupyter_code>import pandas as pd
import plotly.graph_objects as go
from ipywidgets import Button, Output
data = pd.read_csv('log.dat', header=None, delimiter=r"\s+")
output = Output()

def show_tail():
    with output:
        output.clear_output()
        data = pd.read_csv('log.dat', header=None, delimiter=r"\s+")
        display(data.tail())
        
show_tail()
display(output)
bt = data[3].value_counts()
colors = ['gold', 'mediumturquoise', 'darkorange']

fig = go.FigureWidget(data=[go.Pie(labels=['Histogram', 'Smearing', 'Tetrahedra'],
                             values=[bt['Histogram'], bt['Smearing'], bt['Tetrahedra']])])
fig.update_traces(hoverinfo='label+percent', textinfo='value', textfont_size=20,
                  marker=dict(colors=colors, line=dict(color='#000000', width=2)))

fig.update_layout(
    title_text='Statistics of the button clicking')

fig1 = go.FigureWidget(data=[go.Histogram(x=data[4].tolist(),
                            xbins=dict(start=3.5, end=25, size=1))])

fig1.update_layout(
    title_text='Histogram of the nkpt slider')

display(fig)
display(fig1)
def on_update(c):
    data = pd.read_csv('log.dat', header=None, delimiter=r"\s+")
    bt = data[3].value_counts()
    fig.data[0].values = [bt['Histogram'], bt['Smearing'], bt['Tetrahedra']]
    fig1.data[0].x = data[4].tolist()
    show_tail()

update = Button(description="Update")
update.on_click(on_update)
display(update)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17118307997356247, 'fraction_numerical': 0.015862524785194978, 'mean_word_length': 4.446043165467626, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '335711', 'license': 'MIT', 'n_tokens_mistral': 543, 'n_tokens_neox': 523, 'n_words': 90, 'path': 'notebook/log.ipynb', 'repo_name': 'osscar-org/Quantum-Mechanics', 'size': '1513'}