code: def process_docstring(app, what_, name, obj, options, lines):
      """
      Custom process to transform docstring lines Remove "Ignore" blocks
  
      Args:
          app (sphinx.application.Sphinx): the Sphinx application object
  
          what (str):
              the type of the object which the docstring belongs to (one of
              "module", "class", "exception", "function", "method", "attribute")
  
          name (str): the fully qualified name of the object
  
          obj: the object itself
  
          options: the options given to the directive: an object with
              attributes inherited_members, undoc_members, show_inheritance
              and noindex that are true if the flag option of same name was
              given to the auto directive
  
          lines (List[str]): the lines of the docstring, see above
  
      References:
          https://www.sphinx-doc.org/en/1.5.1/_modules/sphinx/ext/autodoc.html
          https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
      """
      import re
  
      remove_directives = [
          # Remove all xdoctest directives
          re.compile(r"\s*>>>\s*#\s*x?doctest:\s*.*"),
          re.compile(r"\s*>>>\s*#\s*x?doc:\s*.*"),
      ]
      filtered_lines = [
          line
          for line in lines
          if not any(pat.match(line) for pat in remove_directives)
      ]
      # Modify the lines inplace
      lines[:] = filtered_lines
  
      # make sure there is a blank line at the end
      if lines and lines[-1].strip():
          lines.append("")
  
file_path: pytorch/docs/source/conf.py
imports: import os
  import pkgutil
  import re
  from os import path
  import torch
  import pytorch_sphinx_theme
  from sphinx.ext.coverage import CoverageBuilder
  from sphinx.writers import html, html5
  import sphinx.ext.doctest
  from docutils import nodes
  from sphinx import addnodes
  from sphinx.util.docfields import TypedField
label_desc: Use image node_id 2 for calling a global function with example usage: process_docstring(app, what_, name, obj, options, lines) without return types