code: def _get_next_script_element(py):
      lines = py.split("\n")
      assert lines
      elines = []
      i = 0
      tag = None
      if lines[0].startswith('"""'):
          assert len(lines) >= 2
          etype = "markdown"
          if len(lines[0]) > 3:
              tag = lines[0][3:]
              if tag not in ["shell", "invisible"]:
                  raise ValueError("Found unknown cell tag:", tag)
          lines = lines[1:]
      else:
          etype = "code"
  
      for i, line in enumerate(lines):
          if line.startswith('"""'):
              break
          else:
              elines.append(line)
  
      if etype == "markdown":
          py = "\n".join(lines[i + 1 :])
      else:
          py = "\n".join(lines[i:])
      e = "\n".join(elines)
  
      return e, etype, py, tag
  
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 8 for calling a global function with example usage: _get_next_script_element(py) and returns: e,  etype,  py,  tag