[docs]defconvert_ipynb_to_py(input_file:Path,output_file:Path,)->None:""" Reads an input Jupyter notebook (.ipynb) and converts it to a Python file (.py) Tried using `jupyter nbconvert`, but that is SO SLOW, like 3 seconds per notebook! It's just json parsing, this should *not* take more than a few milliseconds - come on, Jupyter! Args: input_file: File path output_file: File path Returns: None """withopen(input_file,"r")asf:ipynb_contents=json.load(f)withopen(output_file,"w+")asf:forcellinipynb_contents["cells"]:ifcell["cell_type"]=="code":f.writelines(cell["source"])f.write("\n")