docs: def _get_name_filter(package, context="decorate", reparse=False):
      """Makes sure that the name filters for the specified package have been
      loaded.
  
      Args:
          package (str): name of the package that this method belongs to.
          context (str): one of ['decorate', 'time', 'analyze']; specifies which
            section of the configuration settings to check.
      """
      global name_filters
      pkey = (package, context)
      if pkey in name_filters and not reparse:
          return name_filters[pkey]
      
      from acorn.config import settings
      spack = settings(package)
  
      # The acorn.* sections allow for global settings that affect every package
      # that ever gets wrapped.
      sections = {
          "decorate": ["tracking", "acorn.tracking"],
          "time": ["timing", "acorn.timing"],
          "analyze": ["analysis", "acorn.analysis"]
          }
  
      filters, rfilters = None, None
      import re
      if context in sections:
          # We are interested in the 'filter' and 'rfilter' options if they exist.
          filters, rfilters = [], []
          ignores, rignores = [], []
          for section in sections[context]:
              if spack.has_section(section):
                  options = spack.options(section)
                  if "filter" in options:
                      filters.extend(re.split(r"\s*\$\s*", spack.get(section, "filter")))
                  if "rfilter" in options: # pragma: no cover
                      #Until now, the fnmatch filters have been the most
                      #useful. So I don't have any unit tests for regex filters.
                      pfilters = re.split(r"\s*\$\s*", spack.get(section, "rfilter"))
                      rfilters.extend([re.compile(p, re.I) for p in pfilters])
                  if "ignore" in options:
                      ignores.extend(re.split(r"\s*\$\s*", spack.get(section, "ignore")))
                  if "rignore" in options: # pragma: no cover
                      pignores = re.split(r"\s*\$\s*", spack.get(section, "rignore"))
                      rignores.extend([re.compile(p, re.I) for p in pfilters])
  
          name_filters[pkey] = {
              "filters": filters,
              "rfilters": rfilters,
              "ignores": ignores,
              "rignores": rignores
              }
      else:
          name_filters[pkey] = None
      return name_filters[pkey]