code: def setup(__pkg: str) -> jinja2.Environment:
      
      dirs = [path.join(d, 'templates')
              for d in xdg_basedir.get_data_dirs(__pkg)]
  
      env = jinja2.Environment(
          autoescape=jinja2.select_autoescape(['html', 'xml']),
          loader=jinja2.ChoiceLoader([jinja2.FileSystemLoader(s) for s in dirs]))
      env.loader.loaders.append(jinja2.PackageLoader(__pkg, 'templates'))
      env.filters.update(FILTERS)
  
      return env
docs: Configure a new Jinja environment with our filters.
  
      Args:
          __pkg: Package name to use as base for templates searches
      Returns:
          Configured Jinja environment