<commit_before>from zope.component.testlayer import ZCMLFileLayer
from zope.component.testlayer import ZCMLLayerBase
import sparc.apps.cache
from sparc.configuration.zcml.configure import configure_vocabulary_registry


import os
import sparc.apps.cache.tests
from zope import component
from sparc.apps.cache.cache import cache as CacheApp
from sparc.apps.cache.cache import getScriptArgumentParser

class SparcCacheLayer(ZCMLFileLayer):
    def setUp(self):
        super(SparcCacheLayer, self).setUp()
        configure_vocabulary_registry()
    def tearDown(self):
        super(SparcCacheLayer, self).tearDown()

SPARC_CACHE_INTEGRATION_LAYER = SparcCacheLayer(sparc.apps.cache,
                                                zcml_file="configure.zcml")

class SparcCacheRuntimeLayer(ZCMLLayerBase):
    def setUp(self):
        super(SparcCacheRuntimeLayer, self).setUp()
        configure_vocabulary_registry()
        parser = getScriptArgumentParser()
        args = parser.parse_args([
                                  os.path.join(os.path.dirname(
                                            sparc.apps.cache.tests.__file__), 
                                                           'config_test.xml')])
        self.cacher = CacheApp(args)
        self.sm = component.getSiteManager()
        
    def tearDown(self):
        super(SparcCacheRuntimeLayer, self).tearDown()<commit_msg>formatting update<commit_after>from zope.component.testlayer import ZCMLFileLayer
from zope.component.testlayer import ZCMLLayerBase
import sparc.apps.cache
from sparc.configuration.zcml.configure import configure_vocabulary_registry


import os
import sparc.apps.cache.tests
from zope import component
from sparc.apps.cache.cache import cache as CacheApp
from sparc.apps.cache.cache import getScriptArgumentParser

class SparcCacheLayer(ZCMLFileLayer):
    def setUp(self):
        super(SparcCacheLayer, self).setUp()
        configure_vocabulary_registry()
    def tearDown(self):
        super(SparcCacheLayer, self).tearDown()

SPARC_CACHE_INTEGRATION_LAYER = SparcCacheLayer(sparc.apps.cache,
                                                zcml_file="configure.zcml")

class SparcCacheRuntimeLayer(ZCMLLayerBase):
    def setUp(self):
        super(SparcCacheRuntimeLayer, self).setUp()
        configure_vocabulary_registry()
        parser = getScriptArgumentParser()
        args = parser.parse_args([
                                  os.path.join(os.path.dirname(
                                            sparc.apps.cache.tests.__file__), 
                                                           'config_test.xml')])
        self.cacher = CacheApp(args)
        self.sm = component.getSiteManager()
        
    def tearDown(self):
        super(SparcCacheRuntimeLayer, self).tearDown()
        
{'fraction_non_alphanumeric': 0.07891930323498045, 'fraction_numerical': 0.0, 'mean_word_length': 2.419198055893074, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1047743', 'n_tokens_mistral': 781, 'n_tokens_neox': 764, 'n_words': 136}