code: def getrawcode(obj: object, trycall: bool = True) -> types.CodeType:
      """Return code object for given function."""
      try:
          return obj.__code__  # type: ignore[attr-defined,no-any-return]
      except AttributeError:
          pass
      if trycall:
          call = getattr(obj, "__call__", None)
          if call and not isinstance(obj, type):
              return getrawcode(call, trycall=False)
      raise TypeError(f"could not get code object for {obj!r}")
  
imports: import ast
  import inspect
  import textwrap
  import tokenize
  import types
  import warnings
  from bisect import bisect_right
  from typing import Iterable
  from typing import Iterator
  from typing import List
  from typing import Optional
  from typing import overload
  from typing import Tuple
  from typing import Union
label_desc: Use image node_id 2 for calling a global function with example usage: getrawcode(obj, trycall) and returns: obj, getrawcode