code: def prepare_docstring(s: str, tabsize: int = 8) -> list[str]:
      """Convert a docstring into lines of parseable reST.  Remove common leading
      indentation, where the indentation of the first line is ignored.
  
      Return the docstring as a list of lines usable for inserting into a docutils
      ViewList (used as argument of nested_parse().)  An empty line is added to
      act as a separator between this docstring and following content.
      """
      lines = s.expandtabs(tabsize).splitlines()
      # Find minimum indentation of any non-blank lines after ignored lines.
      margin = sys.maxsize
      for line in lines[1:]:
          content = len(line.lstrip())
          if content:
              indent = len(line) - content
              margin = min(margin, indent)
      # Remove indentation from the first line.
      if len(lines):
          lines[0] = lines[0].lstrip()
      if margin < sys.maxsize:
          for i in range(1, len(lines)):
              lines[i] = lines[i][margin:]
      # Remove any leading blank lines.
      while lines and not lines[0]:
          lines.pop(0)
      # make sure there is an empty line at the end
      if lines and lines[-1]:
          lines.append("")
      return lines
  
imports: from __future__ import annotations
  import re
  import sys
  from docutils.parsers.rst.states import Body
label_desc: Use image node_id 2 for calling a global function with example usage: prepare_docstring(s, tabsize) and returns: lines