code: def parse_code_and_output(code):
      """Parse code to remove indentation, doctest prompts and split between source and theoretical output."""
      lines = code.split("\n")
      indent = _re_indent.search(lines[0]).groups()[0]
      has_doctest = False
      input_lines = []
      output_lines = []
      for line in lines:
          if len(line) > 0:
              line = line[len(indent) :]
          if _re_doctest.search(line):
              has_doctest = True
              line = line[4:]
              input_lines.append(line)
          elif has_doctest:
              if len(line) > 0:
                  output_lines.append(line)
          else:
              input_lines.append(line)
      return "\n".join(input_lines), "\n".join(output_lines)
  
imports: import nbformat
  import os
  import re
  import shutil
label_desc: Use image node_id 12 for calling a global function with example usage: parse_code_and_output(code) and returns: str,  str