code: def retrieve_commands(obj):
      
      commands = {}  # Name and help
      for func in obj.__dict__:
          if not inspect.isfunction(obj.__dict__[func]) and \
             not isinstance(obj.__dict__[func], property):
              continue
          if func.startswith('_'):
              continue
          commands[func] = _get_first_sentence_in_pydoc(
              obj.__dict__[func])
      return commands
docs: Retrieve all commands and help texts from an API object.