code: def get_code_object(x):
      
      if hasattr(x, '__func__'): # Method
          x = x.__func__
      if hasattr(x, '__code__'): # Function
          x = x.__code__
      if hasattr(x, 'gi_code'):  # Generator
          x = x.gi_code
      if isinstance(x, str):     # Source code
          x = _try_compile(x, "<disassembly>")
      if hasattr(x, 'co_code'):  # Code object
          return x
      raise TypeError("don't know how to disassemble %s objects" %
                      type(x).__name__)
docs: Helper to handle methods, functions, generators, strings and raw code objects