parameters: (
          self,
          extensions: t.Optional[t.Collection[str]] = None,
          filter_func: t.Optional[t.Callable[[str], bool]] = None,
      )
return_statement: return names
docstring: Returns a list of templates for this environment.  This requires
          that the loader supports the loader's
          :meth:`~BaseLoader.list_templates` method.
  
          If there are other files in the template folder besides the
          actual templates, the returned list can be filtered.  There are two
          ways: either `extensions` is set to a list of file extensions for
          templates, or a `filter_func` can be provided which is a callable that
          is passed a template name and should return `True` if it should end up
          in the result list.
  
          If the loader does not support that, a :exc:`TypeError` is raised.
  
          .. versionadded:: 2.4
docstring_summary: Returns a list of templates for this environment.  This requires
          that the loader supports the loader's
          :meth:`~BaseLoader.list_templates` method.
docstring_tokens: Returns a list of templates for this environment . This requires that the loader supports the loader s : meth : ~BaseLoader . list_templates method .
function: def list_templates(
          self,
          extensions: t.Optional[t.Collection[str]] = None,
          filter_func: t.Optional[t.Callable[[str], bool]] = None,
      ) -> t.List[str]:
          """Returns a list of templates for this environment.  This requires
          that the loader supports the loader's
          :meth:`~BaseLoader.list_templates` method.
  
          If there are other files in the template folder besides the
          actual templates, the returned list can be filtered.  There are two
          ways: either `extensions` is set to a list of file extensions for
          templates, or a `filter_func` can be provided which is a callable that
          is passed a template name and should return `True` if it should end up
          in the result list.
  
          If the loader does not support that, a :exc:`TypeError` is raised.
  
          .. versionadded:: 2.4
          """
          assert self.loader is not None, "No loader configured."
          names = self.loader.list_templates()
  
          if extensions is not None:
              if filter_func is not None:
                  raise TypeError(
                      "either extensions or filter_func can be passed, but not both"
                  )
  
              def filter_func(x: str) -> bool:
                  return "." in x and x.rsplit(".", 1)[1] in extensions  # type: ignore
  
          if filter_func is not None:
              names = [name for name in names if filter_func(name)]
  
          return names
function_tokens: def list_templates ( self , extensions : t . Optional [ t . Collection [ str ] ] = None , filter_func : t . Optional [ t . Callable [ [ str ] , bool ] ] = None , ) -> t . List [ str ] : assert self . loader is not None , "No loader configured." names = self . loader . list_templates ( ) if extensions is not None : if filter_func is not None : raise TypeError ( "either extensions or filter_func can be passed, but not both" ) def filter_func ( x : str ) -> bool : return "." in x and x . rsplit ( "." , 1 ) [ 1 ] in extensions # type: ignore if filter_func is not None : names = [ name for name in names if filter_func ( name ) ] return names