code: def cell_magic(lines):
      if not lines or not lines[0].startswith("%%"):
          return lines
      if re.match(r"%%\w+\?", lines[0]):
          # This case will be handled by help_end
          return lines
      magic_name, _, first_line = lines[0][2:].rstrip().partition(" ")
      body = "".join(lines[1:])
      return [
          "get_ipython().run_cell_magic(%r, %r, %r)\n"
          % (magic_name, first_line, body)
      ]
  
imports: import ast
  from codeop import CommandCompiler, Compile
  import re
  import sys
  import tokenize
  from typing import List, Tuple, Optional, Any
  import warnings
  from IPython.utils import tokenutil
label_desc: Use image node_id 3 for calling a global function with example usage: cell_magic(lines) and returns: list, lines, lines