<commit_before>"""
    ${NAME}
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import zipfile

log = logging.getLogger(__name__)

class ResourceNotFound(KeyError):
    pass

class ResourceLoader(object):
    def __init__(self):
        super(ResourceLoader, self).__init__()
        self.zipFiles = []

    def addZipFile(self, zipPath):
        try:
            zf = zipfile.ZipFile(zipPath)
        except zipfile.BadZipfile as e:
            raise IOError("Could not read %s as a zip file." % zipPath)
        self.zipFiles.append(zf)

    def openStream(self, path):
        for zipFile in self.zipFiles:
            try:
                stream = zipFile.open(path)
                break
            except KeyError:  # Not found in zip file
                continue
        else:
            raise ResourceNotFound("Resource %s not found in search path" % path)

        return stream<commit_msg>Add function to ResourceLoader for listing all block models<commit_after>"""
    ${NAME}
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import zipfile

log = logging.getLogger(__name__)

class ResourceNotFound(KeyError):
    pass

class ResourceLoader(object):
    def __init__(self):
        super(ResourceLoader, self).__init__()
        self.zipFiles = []

    def addZipFile(self, zipPath):
        try:
            zf = zipfile.ZipFile(zipPath)
        except zipfile.BadZipfile as e:
            raise IOError("Could not read %s as a zip file." % zipPath)
        self.zipFiles.append(zf)

    def openStream(self, path):
        for zipFile in self.zipFiles:
            try:
                stream = zipFile.open(path)
                break
            except KeyError:  # Not found in zip file
                continue
        else:
            raise ResourceNotFound("Resource %s not found in search path" % path)

        return stream

    def blockModelPaths(self):
        for zf in self.zipFiles:
            for name in zf.namelist():
                if name.startswith("assets/minecraft/models/block"):
                    yield name
{'fraction_non_alphanumeric': 0.0824074074074074, 'fraction_numerical': 0.0, 'mean_word_length': 2.187315634218289, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1980920', 'n_tokens_mistral': 602, 'n_tokens_neox': 579, 'n_words': 175}