<commit_before>import os
from .exceptions import IncompleteEnv
from tempfile import TemporaryDirectory
import time


class Environment(object):
    def __init__(self, *args, **kwargs):
        self.environ = os.environ.copy()
        self.config = {}
        self.cbchome = None
        
        if 'CBC_HOME' in kwargs:
            self.cbchome = kwargs['CBC_HOME']
        if 'CBC_HOME' in self.environ:
            self.cbchome = self.environ['CBC_HOME']
        
        if self.cbchome is None:
            raise IncompleteEnv('Environment.cbchome is undefined')
        
        if not os.path.exists(self.cbchome):
            os.makedirs(self.cbchome)
        
        temp_prefix = os.path.basename(os.path.splitext(__name__)[0])
        tempdir = TemporaryDirectory(prefix=temp_prefix, dir=self.cbchome)
        self.working_dir = tempdir.name 
        time.sleep(10)
        self.config['meta'] = self.join('meta.yaml')
        self.config['build'] = self.join('build.sh')
        self.config['build_windows'] = self.join('bld.bat')
        print(self.working_dir)
        
    def join(self, path):
        return os.path.join(self.cbchome, path)
            
        <commit_msg>Remove debug sleep statement<commit_after>import os
from .exceptions import IncompleteEnv
from tempfile import TemporaryDirectory
import time


class Environment(object):
    def __init__(self, *args, **kwargs):
        self.environ = os.environ.copy()
        self.config = {}
        self.cbchome = None
        
        if 'CBC_HOME' in kwargs:
            self.cbchome = kwargs['CBC_HOME']
        if 'CBC_HOME' in self.environ:
            self.cbchome = self.environ['CBC_HOME']
        
        if self.cbchome is None:
            raise IncompleteEnv('Environment.cbchome is undefined')
        
        if not os.path.exists(self.cbchome):
            os.makedirs(self.cbchome)
        
        temp_prefix = os.path.basename(os.path.splitext(__name__)[0])
        tempdir = TemporaryDirectory(prefix=temp_prefix, dir=self.cbchome)
        self.working_dir = tempdir.name 
        self.config['meta'] = self.join('meta.yaml')
        self.config['build'] = self.join('build.sh')
        self.config['build_windows'] = self.join('bld.bat')
        print(self.working_dir)
        
    def join(self, path):
        return os.path.join(self.cbchome, path)
            
        
{'fraction_non_alphanumeric': 0.11405723905723905, 'fraction_numerical': 0.0016835016835016834, 'mean_word_length': 2.229619565217391, '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': '187011', 'n_tokens_mistral': 733, 'n_tokens_neox': 731, 'n_words': 138}