'Returns the absolute paths to "template_name", when appended to each
directory in "template_dirs". Any paths that don\'t lie inside one of the
template dirs are excluded from the result set, for security reasons.'

def get_template_sources(self, template_name, template_dirs=None):

    if (not template_dirs):
        template_dirs = self.engine.dirs
    theme_dirs = self.get_theme_template_sources()
    if isinstance(theme_dirs, list):
        template_dirs = (theme_dirs + template_dirs)
    for template_dir in template_dirs:
        try:
            (yield safe_join(template_dir, template_name))
        except SuspiciousFileOperation:
            pass
