def _paths(self, spiders):
        """
        Build a collection of paths needed to build the archive.
        """
        if spiders is None:
            all_files = self.list_files()
            return all_files, all_files, self._template_paths(None, all_files)
        if isinstance(spiders, six.string_types):
            spiders = [spiders]
        spider_paths = set('spiders/{}.json'.format(spider)
                           for spider in spiders)
        all_files = self.list_files()
        template_paths = self._template_paths(spiders, all_files)
        templates = set(itertools.chain(*template_paths.values()))
        spider_paths = spider_paths | templates
        files = list(set(spider_paths) | self.required_files)
        return files, all_files, template_paths

        Build a collection of paths needed to build the archive.
        
portia_server/portia_api/utils/download.py