code: def process_list_block(
      docstring, starting_point, leading_spaces, marker
  ):
      ending_point = docstring.find("\n\n", starting_point)
      block = docstring[
          starting_point : (
              None if ending_point == -1 else ending_point - 1
          )
      ]
      # Place marker for later reinjection.
      docstring = docstring.replace(block, marker)
      lines = block.split("\n")
      # Remove the computed number of leading white spaces from each line.
      lines = [
          re.sub("^" + " " * leading_spaces, "", line) for line in lines
      ]
      # Usually lines have at least 4 additional leading spaces.
      # These have to be removed, but first the list roots have to be detected.
      top_level_regex = r"^    ([^\s\\\(]+):(.*)"
      top_level_replacement = r"- __\1__:\2"
      lines = [
          re.sub(top_level_regex, top_level_replacement, line)
          for line in lines
      ]
      # All the other lines get simply the 4 leading space (if present) removed
      lines = [re.sub(r"^    ", "", line) for line in lines]
      # Fix text lines after lists
      indent = 0
      text_block = False
      for i in range(len(lines)):
          line = lines[i]
          spaces = re.search(r"\S", line)
          if spaces:
              # If it is a list element
              if line[spaces.start()] == "-":
                  indent = spaces.start() + 1
                  if text_block:
                      text_block = False
                      lines[i] = "\n" + line
              elif spaces.start() < indent:
                  text_block = True
                  indent = spaces.start()
                  lines[i] = "\n" + line
          else:
              text_block = False
              indent = 0
      block = "\n".join(lines)
      return docstring, block
  
file_path: hyperopt/docs/autogen.py
imports: import re
  import inspect
  import os
  import shutil
label_desc: Use image node_id 8 for calling a global function with example usage: process_list_block(docstring, starting_point, leading_spaces, marker) and returns: docstring,  block