<jupyter_start><jupyter_text>basic ipython usage<jupyter_code>import nowidget.states, pytest, _pytest
    bool(nowidget.states.IPYTHON), bool(nowidget.states.MAIN), bool(nowidget.states.PYTEST)<jupyter_output><empty_output><jupyter_text>a file to try under different contexts<jupyter_code>%%file pytest_state.py
    import nowidget.states
    def test_():
        print(bool(nowidget.states.IPYTHON), bool(nowidget.states.MAIN), bool(nowidget.states.PYTEST))
    test_()<jupyter_output>Writing pytest_state.py<jupyter_text>imported as a module<jupyter_code>#NBVAL_IGNORE_OUTPUT
    import pytest_state<jupyter_output>True False False<jupyter_text>running as a script<jupyter_code>!python pytest_state.py
    pt = !pytest --collect-only -cpytest_state.py -spno:warnings pytest_state.py
    print('\n'.join(pt[4:9]))<jupyter_output>False False True
collected 1 item

<Module pytest_state.py>
  <Function test_><jupyter_text>running pytest inside ipython.<jupyter_code>it = !ipython -m pytest -- --collect-only -pno:warnings -cpytest_state.py -spno:warnings pytest_state.py

    print('\n'.join(it[4:9]))
    !rm pytest_state.py<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11861471861471862, 'fraction_numerical': 0.004329004329004329, 'mean_word_length': 6.270440251572327, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '175178', 'license': 'MIT', 'n_tokens_mistral': 441, 'n_tokens_neox': 450, 'n_words': 66, 'path': 'nowidget/tests/test_states.ipynb', 'repo_name': 'deathbeds/nowidget', 'size': '1155'}