def METHOD_NAME(obj: CommandClient, cmd: str, args=True, short=True) -> str:
    """Get documentation for command/function and format it.
    Returns:
      * args=True, short=True - '*' if arguments are present and a summary line.
      * args=True, short=False - (function args) and a summary line.
      * args=False - a summary line.
    If 'doc' function is not present in object or there is no doc string for
    given cmd it returns empty string.  The arguments are extracted from doc[0]
    line, the summary is constructed from doc[1] line.
    """
    doc = obj.call("doc", cmd).splitlines()
    tdoc = doc[0]
    doc_args = tdoc[tdoc.find("(") : tdoc.find(")") + 1].strip()
    short_description = doc[1] if len(doc) > 1 else ""
    if not args:
        doc_args = ""
    elif short:
        doc_args = " " if doc_args == "()" else "*"
    return (doc_args + " " + short_description).rstrip()