<commit_before>from setuptools import setup, find_packages, Command
import subprocess
import os
import shutil

src_dir = 'src/python'
protobuf_src_dir = 'src/protobuf'
generated_dir = 'generated/python'
package_directory = 'cloudfoundry_client'
package_name = 'cloudfoundry-client'

__version__ = None
version_file = '%s/%s/__init__.py' % (src_dir, package_directory)
with open(version_file, 'r') as f:
    for line in f.readlines():
        if line.find('__version__') >= 0:
            exec line

if __version__ is None:
    raise AssertionError('Failed to load version from %s' % version_file)


def purge_sub_dir(path):
    shutil.rmtree(os.path.join(os.path.dirname(__file__), path))
<commit_msg>Add generate command if install launched<commit_after>from setuptools import setup, find_packages, Command
import subprocess
import os
import sys
import shutil

src_dir = 'src/python'
protobuf_src_dir = 'src/protobuf'
generated_dir = 'generated/python'
package_directory = 'cloudfoundry_client'
package_name = 'cloudfoundry-client'

__version__ = None
version_file = '%s/%s/__init__.py' % (src_dir, package_directory)
with open(version_file, 'r') as f:
    for line in f.readlines():
        if line.find('__version__') >= 0:
            exec line

if __version__ is None:
    raise AssertionError('Failed to load version from %s' % version_file)


def purge_sub_dir(path):
    shutil.rmtree(os.path.join(os.path.dirname(__file__), path))

# add generate command if install
cpt_install = None
for cpt_arg in xrange(1, len(sys.argv)):
    if sys.argv[cpt_arg] == "generate":
        break
    elif sys.argv[cpt_arg] == "install":
        cpt_install = cpt_arg
        break
if cpt_install is not None:
    sys.argv.insert(cpt_install, 'generate')

{'fraction_non_alphanumeric': 0.10761305094447625, 'fraction_numerical': 0.0017172295363480253, 'mean_word_length': 4.428571428571429, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, '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': '2414125', 'n_tokens_mistral': 579, 'n_tokens_neox': 572, 'n_words': 152}