def load_external_templates(self, spec_base, spider_name):
        """A generator yielding the content of all passed `template_names` for
        `spider_name`.
        """
        spider_dir = self.storage.rel_path('spiders', spider_name)
        if not self.storage.isdir(spider_dir):
            if sys.version_info < (3, 6):
                raise StopIteration
            else:
                return
        for name in self.storage.listdir(spider_dir):
            if not name.endswith('.json'):
                continue
            path = self.storage.rel_path(spider_dir, name)
            sample = self.storage.open(path)
            if not sample:
                continue
            sample_dir = path[:-len('.json')]
            if self.storage.isdir(sample_dir):
                for fname in self.storage.listdir(sample_dir):
                    if fname.endswith('.html'):
                        attr = fname[:-len('.html')]
                        html = self.storage.open(sample_dir, fname, raw=1)
                        sample[attr] = html
            if 'original_body' not in sample:
                sample['original_body'] = u'<html></html>'
            version = sample.get('version', '')
            yield _build_sample(sample, legacy=version < '0.13.0')
A generator yielding the content of all passed `template_names` for
        `spider_name`.
        
slybot/slybot/utils.py