<commit_before>#!/usr/bin/env python

try:
    from setuptools import setup, find_packages
    HAS_SETUPTOOLS = True
except ImportError:
    from distutils.core import setup
    HAS_SETUPTOOLS = False

if not HAS_SETUPTOOLS:
    import os
    from os import getcwdd, listdir
    from os.path import isdir, isfile

    def is_package(path):
        return isdir(path) and isfile(os.path.join(path, "__init__.py"))

    def find_packages(where="."):
        packages = {}
        for item in listdir(where):
            dir = os.path.join(where, item)
            if is_package( dir ):
                module_name = item
                packages[module_name] = dir
                packages.update(find_packages(dir, module_name))
        return packages

from circuits.version import forget_version, remember_version

forget_version()
version = remember_version()<commit_msg>setup.py: Fixed incorrect import of getcwd if no setuptools available<commit_after>#!/usr/bin/env python

try:
    from setuptools import setup, find_packages
    HAS_SETUPTOOLS = True
except ImportError:
    from distutils.core import setup
    HAS_SETUPTOOLS = False

if not HAS_SETUPTOOLS:
    import os
    from os import getcwd, listdir
    from os.path import isdir, isfile

    def is_package(path):
        return isdir(path) and isfile(os.path.join(path, "__init__.py"))

    def find_packages(where="."):
        packages = {}
        for item in listdir(where):
            dir = os.path.join(where, item)
            if is_package( dir ):
                module_name = item
                packages[module_name] = dir
                packages.update(find_packages(dir, module_name))
        return packages

from circuits.version import forget_version, remember_version

forget_version()
version = remember_version()
{'fraction_non_alphanumeric': 0.08106607440310938, 'fraction_numerical': 0.0, 'mean_word_length': 2.730848861283644, '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': '5571124', 'n_tokens_mistral': 549, 'n_tokens_neox': 535, 'n_words': 146}