<jupyter_start><jupyter_text>Welcome!This notebook demos an interactive cell within a slideshow using RISE<jupyter_code># Let's define a function (this cell can be hidden from the slideshow if you like)

import numpy as np
import matplotlib.pyplot as plt
from ipywidgets import interact

def plot_graph(a=-0.1,b=0.8,c=-0.3):
    # some arbitrary function of a,b,c
    x = np.linspace(0,10,100)
    y = a*a*np.square(x) + (b+a)*np.sin(x) + (c-a)*np.cos(x) + c*x
    plt.plot(x,y)
    plt.ylim(-30,30)
    plt.show()<jupyter_output><empty_output><jupyter_text>Executing a static function callChange the numbers in the function call, hit ctrl-enter and it will re-execute. Everything shifts down when you change a number and re-execute, then shifts back to the 'correct' position if you execute another time without changing anything.<jupyter_code># Here's a static evaluation with default args
plot_graph(1.2,0.121,2.5)<jupyter_output><empty_output><jupyter_text>Interactive widgetsNow you can wiggle the sliders and see the effect on the graph. Yay! But if you re-execute the cell with ctrl-enter, the position will be broken. If you go back a slide and re-launch this slide, the position is correct again.<jupyter_code>interact(plot_graph, a=(-2,2,0.2), b=(-2,3,0.1), c=(-2,2,0.1));<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10975609756097561, 'fraction_numerical': 0.027439024390243903, 'mean_word_length': 5.078703703703703, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '522746', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 465, 'n_tokens_neox': 451, 'n_words': 149, 'path': 'examples/issue-370.ipynb', 'repo_name': 'moble/RISE', 'size': '1312'}