<jupyter_start><jupyter_text>NBPro Core Functionality> . To see all the paths jupyter is using, type `jupyter --paths` on command line or run using !<jupyter_code>!jupyter --paths<jupyter_output>config:
    C:\Users\Rob\.jupyter
    C:\Users\Rob\Anaconda3\etc\jupyter
    C:\ProgramData\jupyter
data:
    C:\Users\Rob\AppData\Roaming\jupyter
    C:\Users\Rob\Anaconda3\share\jupyter
    C:\ProgramData\jupyter
runtime:
    C:\Users\Rob\AppData\Roaming\jupyter\runtime<jupyter_text>To Change font Add CSS to .jupyter/custom/custom.css (custom and custom.css may not exist yet):```.text_cell {    font-family: "Verdana";    font-size: 12pt;}```<jupyter_code>#export
def fullscreen(width=100):
    setting = f"<style>.container {{ width:{width}% !important; }}</style>"
    display(HTML(setting))
fullscreen(width=20)
#export
#‘all’, ‘last’, ‘last_expr’ or ‘none’, ‘last_expr_or_assign’
#credit <NAME>
def display_all(mode):
    InteractiveShell.ast_node_interactivity = "all" if mode else "last_expr"
display_all(True)
x, y = 12, 20
x
y
#https://stackoverflow.com/questions/23271575/printing-bold-colored-etc-text-in-ipython-qtconsole/46934204#46934204
def printmd(string, color=None):
    colorstr = "<span style='color:{}'>{}</span>".format(color, string)
    display(Markdown(colorstr))
#Credit to Mark Rostock (https://forums.fast.ai/u/marcmuc/)
def setup_extensions(configurator=True):
    commands = ["pip install jupyter_contrib_nbextensions",
        "jupyter contrib nbextension install --user"]
    if configurator: commands.append("jupyter nbextensions_configurator enable --user")
    errors = []
    for command in commands:
        out = subprocess.run(command, check=True, text=True,
                        stdout=subprocess.PIPE, stderr=subprocess.PIPE,)
        print(out.stdout)
setup_extensions()
#Credit: https://stackoverflow.com/questions/36711358/jupyter-notebook-command-for-save-the-current-notebook
def save_autosave():
    display(Javascript("IPython.notebook.save_notebook()"),            
        include=['application/javascript'])
def save_checkpoint():
    display(Javascript("IPython.notebook.save_checkpoint()"),            
        include=['application/javascript'])
save_checkpoint()
from nbdev.export import *
notebook2script()
fullscreen(100)
# restart kernel programatically
# credit: https://stackoverflow.com/questions/37751120/restart-ipython-kernel-with-a-command-from-a-cell
from IPython.display import display_html
def restartkernel() :
    display_html("<script>Jupyter.notebook.kernel.restart()</script>",raw=True)
#Enable an extension
!jupyter nbextension enable Exercise2/main
restartkernel()
#disable an extension
!jupyter nbextension disable Exercise2/main
#restartkernel()<jupyter_output>Disabling notebook extension Exercise2/main...
      - Validating: ok<jupyter_text>Trying to get NBName<jupyter_code>from IPython.display import display, Javascript
display(Javascript("if (IPython.notebook.kernel) {IPython.notebook.kernel.execute('!./notebook2script.py ' + IPython.notebook.notebook_name)}"))
from IPython.display import display, Javascript

nb_name
def call_command():
    display(Javascript("IPython.notebook.kernel.execute('_tempo_name = ' + '\"' + IPython.notebook.notebook_name + '\"')"))
import time
def get_nb_name():
    call_command()
%%javascript
var output_area = this;
// find my cell element
var cell_element = output_area.element.parents('.cell');
// which cell is it?
var cell_idx = Jupyter.notebook.get_cell_elements().index(cell_element);
// get the cell object
var cell = Jupyter.notebook.get_cell(cell_idx);
Jupyter.notebook.execute_cells([2])`
_tempo_name
def do():
    display(Javascript("IPython.notebook.kernel.execute('nb_name = ' + '\"' + IPython.notebook.notebook_name + '\"')"))
get_nb_name()
next(get_nb_name())
_tmp_name
call_command()<jupyter_output><empty_output><jupyter_text>Notes %%javascript cells will run automatically on page load in trusted notebooks but not in untrusted notebooks Jupyter has 3 types of files in their data model, datafiles(extensions/kernels), runtimefiles(logs,pid files, connection files) and configfiles(config, custom.js). You can use the following commands to see all of them<jupyter_code>! jupyter --paths
!jupyter --data-dir
!jupyter --config-dir
!jupyter --runtime-dir<jupyter_output>C:\Users\Rob\AppData\Roaming\jupyter\runtime<jupyter_text>You can see all your nbextensions with<jupyter_code>#! jupyter nbextension list<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12986142154671435, 'fraction_numerical': 0.014081358962896737, 'mean_word_length': 5.302816901408451, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 26, 'https://': 4, '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': '474371', 'license': 'Apache-2.0', 'n_tokens_mistral': 1585, 'n_tokens_neox': 1516, 'n_words': 297, 'path': '00_core.ipynb', 'repo_name': 'rbracco/nbpro', 'size': '4479'}