code: def next_instruction_is_function_or_class(lines):
      """Is the first non-empty, non-commented line of the cell either a function or a class?"""
      parser = StringParser("python")
      for i, line in enumerate(lines):
          if parser.is_quoted():
              parser.read_line(line)
              continue
          parser.read_line(line)
          if not line.strip():  # empty line
              if i > 0 and not lines[i - 1].strip():
                  return False
              continue
          if line.startswith("def ") or line.startswith("class "):
              return True
          if line.startswith(("#", "@", " ", ")")):
              continue
          return False
  
      return False
  
imports: from .stringparser import StringParser
label_desc: Use image node_id 1 for calling a global function with example usage: next_instruction_is_function_or_class(lines) and returns: False, False, True, False