<jupyter_start><jupyter_text>Scraps<jupyter_code>def f(answer):
    life_answer = answer
    return answer

print("What is your life most like?")
life_answer_machine = interact(f, answer=labels_df.label.unique())
# https://www.datacamp.com/community/tutorials/scope-of-variables-python?utm_source=adwords_ppc&utm_campaignid=1565261270&utm_adgroupid=67750485268&utm_device=c&utm_keyword=&utm_matchtype=b&utm_network=g&utm_adpostion=&utm_creative=295208661496&utm_targetid=aud-522010995285:dsa-429603003980&utm_loc_interest_ms=&utm_loc_physical_ms=9061273&gclid=Cj0KCQjwwuD7BRDBARIsAK_5YhXWWjq5JDOkv3f0BHaFa_q9QhZsjLq8UcH3pdAwI4QemufBPjqWP9gaAhD6EALw_wcB
# https://github.com/jupyter-widgets/ipywidgets/issues/1947


life_answer.widget
import ipywidgets as widgets
from IPython.display import display
x = 5
slider = widgets.IntSlider()
slider.value = x
def on_change(v):
    x = v['new'] 
slider.observe(on_change, names='value')
display(slider)
x
life_answer = "unknown"

life_answer_machine = interact(answer=labels_df.label.unique())
life_answer_machine.value = life_answer

def f(answer):
    return answer

print("What is your life most like?")
life_answer_machine.widget(f) 
#interact(f, answer=labels_df.label.unique())

print(life_answer)
life_answer_machine.widget()
widgets.Output()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11060606060606061, 'fraction_numerical': 0.06136363636363636, 'mean_word_length': 8.93233082706767, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, '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': '463337', 'license': 'MIT', 'n_tokens_mistral': 587, 'n_tokens_neox': 528, 'n_words': 62, 'path': 'personalized_image_creation.ipynb', 'repo_name': 'keck343/image_iterator', 'size': '1320'}