<jupyter_start><jupyter_text>question 2<jupyter_code>try:
    file = open("sample.txt","r")
    file.write("this is a sample file")
    file.close()

except Exception as e:
    print(e)
    print("please open the file in write mode")<jupyter_output>not writable
please open the file in write mode
{'fraction_non_alphanumeric': 0.11148648648648649, 'fraction_numerical': 0.0033783783783783786, 'mean_word_length': 4.4, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '575247', 'license': 'Apache-2.0', 'n_tokens_mistral': 105, 'n_tokens_neox': 101, 'n_words': 30, 'path': 'day 8 assignment.ipynb', 'repo_name': 'vileshranjith/letsupgrade-python', 'size': '296'}