<commit_before># /usr/bin/env python
import json
import os
import shutil
import sys
from subprocess import call

from datetime import date

cwd = os.getcwd()

PLUGIN_FILE_TEMPLATE = 'gauge-python-{}'

ZIP = 'zip'

VERSION = 'version'

PLUGIN_JSON = 'python.json'

BIN = os.path.join(cwd, 'bin')

DEPLOY = os.path.join(cwd, 'deploy')


def install():
    plugin_zip = create_zip()
    call(['gauge', 'uninstall', 'python', '-v', get_version()])
    exit_code = call(['gauge', 'install', 'python', '-f', os.path.join(BIN, plugin_zip)])
    generate_package()
    print('Install getgauge package using pip: \n\tpip install dist/*')
    sys.exit(exit_code)


def create_setup_file():
    tmpl = open("setup.tmpl", "r")
    setup = open("setup.py", "w+")
    if bool(os.getenv("NIGHTLY")):
        v = "{}.dev.{}".format(get_version(), str(date.today()).replace("-", ""))
    else:
        v = get_version()
    setup.write(tmpl.read().format(v, "{\n\t\t':python_version == \"2.7\"': ['futures']\n\t}"))
    setup.close()
    tmpl.close()
<commit_msg>Installing getgauge package along with python plugin.<commit_after># /usr/bin/env python
import json
import os
import shutil
import sys
from subprocess import call

from datetime import date

cwd = os.getcwd()

PLUGIN_FILE_TEMPLATE = 'gauge-python-{}'

ZIP = 'zip'

VERSION = 'version'

PLUGIN_JSON = 'python.json'

BIN = os.path.join(cwd, 'bin')

DEPLOY = os.path.join(cwd, 'deploy')


def install():
    plugin_zip = create_zip()
    call(['gauge', 'uninstall', 'python', '-v', get_version()])
    exit_code = call(['gauge', 'install', 'python', '-f', os.path.join(BIN, plugin_zip)])
    generate_package()
    p = os.listdir("dist")[0]
    print("Installing getgauge package using pip: \n\tpip install dist/{}".format(p))
    call([sys.executable, "-m", "pip", "install", "dist/{}".format(p), "--upgrade", "--user"])
    sys.exit(exit_code)


def create_setup_file():
    tmpl = open("setup.tmpl", "r")
    setup = open("setup.py", "w+")
    if bool(os.getenv("NIGHTLY")):
        v = "{}.dev.{}".format(get_version(), str(date.today()).replace("-", ""))
    else:
        v = get_version()
    setup.write(tmpl.read().format(v, "{\n\t\t':python_version == \"2.7\"': ['futures']\n\t}"))
    setup.close()
    tmpl.close()

{'fraction_non_alphanumeric': 0.2047556142668428, 'fraction_numerical': 0.002201673271686482, 'mean_word_length': 3.7932489451476794, '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': '4948062', 'n_tokens_mistral': 857, 'n_tokens_neox': 837, 'n_words': 181}