<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def retrieve_commands(obj):
 """Retrieve all commands and help texts from an API object."""

    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