code: def get_object_attrs(obj):
      
      attrs = [k for k in dir(obj) if not k.startswith('__')]
      if not attrs:
          attrs = dir(obj)
      return attrs
docs: Get the attributes of an object using dir.
  
      This filters protected attributes