def _template_paths(self, spiders, files):
        """
        Map all template paths to the corresponding spider.
        """
        spider_templates = defaultdict(list)
        for file_path in files:
            split_file_path = file_path.split('/')
            if len(split_file_path) > 2 and (spiders is None or
                                             split_file_path[1] in spiders):
                spider_templates[split_file_path[1]].append(file_path)
        return spider_templates

        Map all template paths to the corresponding spider.
        
portia_server/portia_api/utils/download.py