code: def mod_replace(match, sphinx_modules):
      
      sphinx_modules.append(match.group("module"))
      return "`{}`_".format(match.group("value"))
docs: Convert Sphinx ``:mod:`` to plain reST link.
  
      Args:
          match (_sre.SRE_Match): A match (from ``re``) to be used
              in substitution.
          sphinx_modules (list): List to be track the modules that have been
              encountered.
  
      Returns:
          str: The ``match`` converted to a link.