<commit_before>#!/usr/bin/env python
from __future__ import (absolute_import, division, print_function, unicode_literals)

import sys
import argparse
import os
import re

from envy import VERSION

VENV_ROOT = "~/.virtualenvs/{}/lib/python{}/site-packages/{}"
ENVY_BASE = os.path.expanduser("~/.envies")

help = None

class helper(object):
    def get_sys_prefix(self):
        return sys.prefix

    def get_py_version(self):
        return str(sys.version_info.major) + "." + str(sys.version_info.minor)

def get_helper():
    global help
    if help is None:
        help = helper()

    return help

def validate(f):

    def wrapper(args):
        if not active_venv():
            print("ERR: No active virtual env!")
            return False

        if not in_python_package():
            print("ERR: must be run from within a python package")
            return False

        return f(args)
    return wrapper


def get_sys_prefix():
    return get_helper().get_sys_prefix()

def active_venv():
    return '/.virtualenvs/' in get_sys_prefix()

def get_active_venv():
    return re.search(".virtualenvs/([^/]{1,})/bin", get_sys_prefix()).group(1)

def in_python_package():
    return os.path.isfile(os.getcwd() + '/setup.py') or os.path.isfile(os.getcwd() + '/../setup.py')

def get_package_name():
    return os.getcwd().split("/")[-1]

def get_envy_path():
    return os.path.expanduser("~/.envies/{}/{}".format(get_active_venv(), get_package_name()))

def get_py_version():
    return get_helper().get_py_version()

def get_venv_package_path():
    package_name = get_package_name()
    venv = get_active_venv()<commit_msg>no need for the get_helper() method<commit_after>#!/usr/bin/env python
from __future__ import (absolute_import, division, print_function, unicode_literals)

import sys
import argparse
import os
import re

from envy import VERSION

VENV_ROOT = "~/.virtualenvs/{}/lib/python{}/site-packages/{}"
ENVY_BASE = os.path.expanduser("~/.envies")

class helper(object):
    def get_sys_prefix(self):
        return sys.prefix

    def get_py_version(self):
        return str(sys.version_info.major) + "." + str(sys.version_info.minor)


help = helper()

def validate(f):
    def wrapper(args):
        if not active_venv():
            print("ERR: No active virtual env!")
            return False

        if not in_python_package():
            print("ERR: must be run from within a python package")
            return False

        return f(args)
    return wrapper


def get_sys_prefix():
    return helper.get_sys_prefix()

def active_venv():
    return '/.virtualenvs/' in get_sys_prefix()

def get_active_venv():
    return re.search(".virtualenvs/([^/]{1,})/bin", get_sys_prefix()).group(1)

def in_python_package():
    return os.path.isfile(os.getcwd() + '/setup.py') or os.path.isfile(os.getcwd() + '/../setup.py')

def get_package_name():
    return os.getcwd().split("/")[-1]

def get_envy_path():
    return os.path.expanduser("~/.envies/{}/{}".format(get_active_venv(), get_package_name()))

def get_py_version():
    return helper.get_py_version()

def get_venv_package_path():
    package_name = get_package_name()
    venv = get_active_venv()
{'fraction_non_alphanumeric': 0.14151239410103544, 'fraction_numerical': 0.0018826482585503608, 'mean_word_length': 3.4712482468443198, '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': '2714355', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1051, 'n_words': 240}