<commit_before>VERSION = (0, 1, 0, "", "") # following PEP 386
DEV_N = 8
POST_N = 0

def get_version():
    version = "%s.%s" % (VERSION[0], VERSION[1])
    if VERSION[2]:
        version = "%s.%s" % (version, VERSION[2])
    if VERSION[3] != "f":
        version = "%s%s%s" % (version, VERSION[3], VERSION[4])
        if DEV_N:
            version = "%s.dev%s" % (version, DEV_N)
    elif POST_N > 0:
        version = "%s.post%s" % (version, POST_N)
    return version


__version__ = get_version()


class IdiosSettings(object):
    """
    Combine the settings ``AUTH_PROFILE_MODULE`` and
    ``IDIOS_PROFILE_MODULES`` into a single ``PROFILE_MODULES`` list.
    
    ``MULTIPLE_PROFILES`` is True if there is more than one profile model
    defined, False otherwise.
    
    ``DEFAULT_PROFILE_MODULE`` is the profile model referenced by
    ``AUTH_PROFILE_MODULE``, or the first one listed in
    ``IDIOS_PROFILE_MODULES``.
    
    """
    def __init__(self):
        from django.conf import settings
        
        self.PROFILE_MODULES = []
        
        modules = []
        mod = getattr(settings, "AUTH_PROFILE_MODULE", None)
        if mod:
            modules.append(mod)
        
        self.DEFAULT_PROFILE_MODULE = None
        
        for module in modules + getattr(settings, "IDIOS_PROFILE_MODULES", []):
            if self.DEFAULT_PROFILE_MODULE is None:
                self.DEFAULT_PROFILE_MODULE = module
            self.PROFILE_MODULES.append(module)
        
        self.MULTIPLE_PROFILES = len(self.PROFILE_MODULES) > 1
        
        self.PROFILE_BASE = getattr(settings, "IDIOS_PROFILE_BASE", None)


settings = IdiosSettings()<commit_msg>implemented lazy settings to allow import idios to work without Django and only call into Django when needed<commit_after>VERSION = (0, 1, 0, "", "") # following PEP 386
DEV_N = 8
POST_N = 0

def get_version():
    version = "%s.%s" % (VERSION[0], VERSION[1])
    if VERSION[2]:
        version = "%s.%s" % (version, VERSION[2])
    if VERSION[3] != "f":
        version = "%s%s%s" % (version, VERSION[3], VERSION[4])
        if DEV_N:
            version = "%s.dev%s" % (version, DEV_N)
    elif POST_N > 0:
        version = "%s.post%s" % (version, POST_N)
    return version


__version__ = get_version()


try:
    import django
except ImportError:
    django = None
else:
    from django.utils.functional import LazyObject

if django:
    class IdiosLazySettings(LazyObject):
        
        def _setup(self):
            self._wrapped = IdiosSettings()
    
    
    class IdiosSettings(object):
        """
        Combine the settings ``AUTH_PROFILE_MODULE`` and
        ``IDIOS_PROFILE_MODULES`` into a single ``PROFILE_MODULES`` list.
        
        ``MULTIPLE_PROFILES`` is True if there is more than one profile model
        defined, False otherwise.
        
        ``DEFAULT_PROFILE_MODULE`` is the profile model referenced by
        ``AUTH_PROFILE_MODULE``, or the first one listed in
        ``IDIOS_PROFILE_MODULES``.
        
        """
        
        def __init__(self):
            from django.conf import settings
            
            self.PROFILE_MODULES = []
            
            modules = []
            mod = getattr(settings, "AUTH_PROFILE_MODULE", None)
            if mod:
                modules.append(mod)
            
            self.DEFAULT_PROFILE_MODULE = None
            
            for module in modules + getattr(settings, "IDIOS_PROFILE_MODULES", []):
                if self.DEFAULT_PROFILE_MODULE is None:
                    self.DEFAULT_PROFILE_MODULE = module
                self.PROFILE_MODULES.append(module)
            
            self.MULTIPLE_PROFILES = len(self.PROFILE_MODULES) > 1
            self.PROFILE_BASE = getattr(settings, "IDIOS_PROFILE_BASE", None)
    
    settings = IdiosLazySettings()
{'fraction_non_alphanumeric': 0.10721703011422637, 'fraction_numerical': 0.008826583592938734, 'mean_word_length': 2.2054908485856903, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 7, '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': '6465040', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1211, 'n_words': 294}