code: def nb_to_py(nb_path, py_path):
      f = open(nb_path)
      content = f.read()
      f.close()
      nb = json.loads(content)
      py = '"""\n'
      py += "Title: FILLME\n"
      py += "Author: FILLME\n"
      py += "Date created: FILLME\n"
      py += "Last modified: FILLME\n"
      py += "Description: FILLME\n"
      py += '"""\n'
      for cell in nb["cells"]:
          if cell["cell_type"] == "code":
              # Is it a shell cell?
              if (
                  cell["source"]
                  and cell["source"][0]
                  and cell["source"][0][0] == "!"
              ):
                  # It's a shell cell
                  py += '"""shell\n'
                  py += "".join(cell["source"]) + "\n"
                  py += '"""\n\n'
              else:
                  # It's a Python cell
                  py += "".join(cell["source"]) + "\n\n"
          elif cell["cell_type"] == "markdown":
              py += '"""\n'
              py += "".join(cell["source"]) + "\n"
              py += '"""\n\n'
      # Save file
      f = open(py_path, "w")
      f.write(py)
      f.close()
      # Format file with Black
      os.system("black " + py_path)
      # Shorten lines
      py = open(py_path).read()
      try:
          py = _shorten_lines(py)
      finally:
          f = open(py_path, "w")
          f.write(py)
          f.close()
  
file_path: icevision/docs/tutobooks.py
imports: import json
  import os
  import random
  import shutil
  import sys
  from pathlib import Path
label_desc: Use image node_id 1 for calling a global function with example usage: nb_to_py(nb_path, py_path) without return types