code: def dir_instance(inst):
      
      # Skip instance attributes; __slots__ is automatically defined, and
      # descriptors are used to define attributes. Instead, go straight to class
      # attributes (including methods).
      for name, value in vars_class(type(inst)).items():
          if isinstance(value, ObjectMethod):
              if value.has_instancemethod:
                  yield name
          elif isinstance(value, Disabled):
              pass  # Hide this; disabled.
          elif isinstance(value, (classmethod, staticmethod)):
              pass  # Hide this; not interesting here.
          else:
              yield name
docs: Return a list of names available on `inst`.
  
      Eliminates names that bind to an `ObjectMethod` without a corresponding
      instance method; see `ObjectMethod`.