code: def process_docstring(app, what, name, obj, options, lines):
      """
      Function replaces labeled class names to real links in
      the documentation.
  
      Available types:
      - :network:`NetworkClassName`
      - :layer:`LayerClassName`
      - :plot:`function_name`
      - :architecture:`function_name`
      """
      labels = ["network", "layer", "plot", "architecture"]
      labels_regexp = "|".join(labels)
  
      regexp = re.compile(
          r"\:({})+?\:" r"\`(.+?)(|\s<.+?>)\`".format(labels_regexp)
      )
  
      if options is not None:
          # Do not show information about parent classes
          options["show-inheritance"] = False
  
      for i, line in enumerate(lines):
          # Replace values one by one to make sure that there is no overlaps.
          replacement = regexp.search(line)
          while replacement:
              moduletype, display_name, classname = replacement.groups()
  
              if not classname:
                  classname = display_name
              else:
                  # Remove first second and last symbols.
                  # They must be: \s, < and > respectively.
                  classname = classname[2:-1]
  
              module = get_module_for_class(classname, moduletype)
  
              if not classname:
                  newline_pattern = r":class:`\2 <{}\.\2>`".format(
                      module
                  )
              else:
                  newline_pattern = r":class:`\2 <{}\.{}>`".format(
                      module, classname
                  )
  
              line = regexp.sub(newline_pattern, line, count=1)
              line = line.replace("\.", ".")
              lines[i] = line
              replacement = regexp.search(line)
  
file_path: neupy/site/conf.py
imports: import os
  import re
  import sys
  import importlib
  import bs4
  import tinkerer
  import tinkerer.paths
label_desc: Use image node_id 3 for calling a global function with example usage: process_docstring(app, what, name, obj, options, lines) without return types