<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_template_filename(self, template_name):
 """ Searches for a file matching the given template name. If found, this method returns the pathlib.Path object of the found template file. Args: template_name (str):
 Name of the template, with or without a file extension. Returns: pathlib.Path: Path to the matching filename. """


        def next_file():
            filename = self.path / template_name
            yield filename
            try:
                exts = self.default_file_extensions
            except AttributeError:
                return

            strfilename = str(filename)
            for ext in exts:
                yield Path(strfilename + ext)

        for filename in next_file():
            if filename.is_file():
                return filename