code: def getstatementrange_old(lineno, source, assertion=False):
      """return (start, end) tuple which spans the minimal
      statement region which containing the given lineno.
      raise an IndexError if no such statementrange can be found.
      """
      # XXX this logic is only used on python2.4 and below
      # 1. find the start of the statement
      from codeop import compile_command
  
      for start in range(lineno, -1, -1):
          if assertion:
              line = source.lines[start]
              # the following lines are not fully tested, change with care
              if (
                  "super" in line
                  and "self" in line
                  and "__init__" in line
              ):
                  raise IndexError("likely a subclass")
              if "assert" not in line and "raise" not in line:
                  continue
          trylines = source.lines[start : lineno + 1]
          # quick hack to prepare parsing an indented line with
          # compile_command() (which errors on "return" outside defs)
          trylines.insert(0, "def xxx():")
          trysource = "\n ".join(trylines)
          #              ^ space here
          try:
              compile_command(trysource)
          except (SyntaxError, OverflowError, ValueError):
              continue
  
          # 2. find the end of the statement
          for end in range(lineno + 1, len(source) + 1):
              trysource = source[start:end]
              if trysource.isparseable():
                  return start, end
      raise SyntaxError(
          "no valid source range around line %d " % (lineno,)
      )
  
imports: from __future__ import generators
  from bisect import bisect_right
  import sys
  import inspect, tokenize
  import py
  from types import ModuleType
label_desc: Use image node_id 8 for calling a global function with example usage: getstatementrange_old(lineno, source, assertion) and returns: start,  end