docs: def get_doc(func):
      """Extract and dedent the __doc__ of a function.
  
      Unlike `textwrap.dedent()` it also works when the first line
      is not indented.
      """
      doc = func.__doc__
      if not doc:
          return ""
  
      # doc has only one line
      if "\n" not in doc:
          return doc
  
      # Only Python core devs write __doc__ like this
      if doc.startswith(("\n", "\\\n")):
          return textwrap.dedent(doc)
  
      # First line is not indented
      first, rest = doc.split("\n", 1)
      return first + "\n" + textwrap.dedent(rest)