code: def indent_docstring(
      lines: List[str], indent_level: int, width: int = 100, lstrip=True
  ) -> str:
      """Indent a docstring for use in generated code"""
      final_lines = []
  
      for i, line in enumerate(lines):
          stripped = line.lstrip()
          if stripped:
              leading_space = len(line) - len(stripped)
              indent = indent_level + leading_space
              wrapper = textwrap.TextWrapper(
                  width=width - indent,
                  initial_indent=indent * " ",
                  subsequent_indent=indent * " ",
                  break_long_words=False,
                  break_on_hyphens=False,
                  drop_whitespace=True,
              )
              list_wrapper = textwrap.TextWrapper(
                  width=width - indent,
                  initial_indent=indent * " " + "* ",
                  subsequent_indent=indent * " " + "  ",
                  break_long_words=False,
                  break_on_hyphens=False,
                  drop_whitespace=True,
              )
              for line in stripped.split("\n"):
                  line_stripped = line.lstrip()
                  line_stripped = fix_docstring_issues(line_stripped)
                  if line_stripped == "":
                      final_lines.append("")
                  elif line_stripped.startswith("* "):
                      final_lines.extend(
                          list_wrapper.wrap(line_stripped[2:])
                      )
                  # Matches lines where an attribute is mentioned followed by the accepted
                  # types (lines starting with a character sequence that
                  # does not contain white spaces or '*' followed by ' : ').
                  # It therefore matches 'condition : anyOf(...' but not '**Notes** : ...'
                  # These lines should not be wrapped at all but appear on one line
                  elif re.match(r"[^\s*]+ : ", line_stripped):
                      final_lines.append(indent * " " + line_stripped)
                  else:
                      final_lines.extend(wrapper.wrap(line_stripped))
  
          # If this is the last line, put in an indent
          elif i + 1 == len(lines):
              final_lines.append(indent_level * " ")
          # If it's not the last line, this is a blank line that should not indent.
          else:
              final_lines.append("")
      # Remove any trailing whitespaces on the right side
      stripped_lines = []
      for i, line in enumerate(final_lines):
          if i + 1 == len(final_lines):
              stripped_lines.append(line)
          else:
              stripped_lines.append(line.rstrip())
      # Join it all together
      wrapped = "\n".join(stripped_lines)
      if lstrip:
          wrapped = wrapped.lstrip()
      return wrapped
  
imports: import keyword
  import re
  import subprocess
  import textwrap
  import urllib
  from typing import Any, Dict, Final, Iterable, List, Optional, Union
  from .schemapi import _resolve_references
label_desc: Use image node_id 3 for calling a global function with example usage: indent_docstring(lines, indent_level, width, lstrip) and returns: wrapped