code: def _append_doc(
      obj, message: str, directive: Optional[str] = None
  ) -> str:
      """
      Args:
          message: An additional message to append to the end of docstring for a class
                   or method that uses one of the API annotations
          directive: A shorter message that provides contexts for the message and indents it.
                  For example, this could be something like 'warning' or 'info'.
      """
      if not obj.__doc__:
          obj.__doc__ = ""
  
      obj.__doc__ = obj.__doc__.rstrip()
  
      indent = _get_indent(obj.__doc__)
      obj.__doc__ += "\n\n"
      if directive is not None:
          obj.__doc__ += f"{' ' * indent}.. {directive}::\n"
          obj.__doc__ += f"{' ' * (indent + 4)}{message}"
      else:
          obj.__doc__ += f"{' ' * indent}{message}"
      obj.__doc__ += f"\n{' ' * indent}"
  
file_path: ludwig/ludwig/api_annotations.py
imports: from typing import Optional
label_desc: Use image node_id 4 for calling a global function with example usage: _append_doc(obj, message, directive) without return types