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

import os.path
import distutils.core
import distutils.command.build

from distutils.command.build import build
import os.path
import sys

DEPENDENCIES = [
    "numpy",
    "scikit-learn==0.20",
    "scipy",
    "rolling_measures"
]


class BuildModelsCommand(distutils.core.Command):
    description = "Train models and save the model parameters to file"
    user_options = []
    def initialize_options(self):
        pass
    def finalize_options(self):
        pass
    def run(self):
        if os.path.exists(os.path.join(os.path.dirname(__file__), 'vessel_scoring', 'models')):
            return
        print "Training models...",
        sys.stdout.flush()
        import vessel_scoring.models
        vessel_scoring.models.train_models()
        print "done."
        sys.stdout.flush()

class build(distutils.command.build.build):
    def run(self):
        self.run_command("build_models")
        distutils.command.build.build.run(self)

cmdclass = {}
cmdclass['build_models'] = BuildModelsCommand
cmdclass['build'] = build


distutils.core.setup(
    name='vessel-scoring',
    description="Tools to score fishing behviour of vessels",
    long_description='',
    packages=[
        'vessel_scoring',
    ],
    package_data={
        'vessel_scoring': ['models/*']},
    install_requires=DEPENDENCIES,
    extras_require={
        'dev': ['matplotlib', 'ipython', 'coveralls']},
    version='1.1',
    author='<NAME>, <NAME>',
    author_email='<EMAIL>, <EMAIL>',
    url='',
    license='Apache',
    cmdclass=cmdclass
)
<commit_msg>convert print statements to functions in setup.py<commit_after>#!/usr/bin/env python
from __future__ import print_function
import os.path
import distutils.core
import distutils.command.build

from distutils.command.build import build
import os.path
import sys

DEPENDENCIES = [
    "numpy",
    "scikit-learn==0.20",
    "scipy",
    "rolling_measures"
]


class BuildModelsCommand(distutils.core.Command):
    description = "Train models and save the model parameters to file"
    user_options = []
    def initialize_options(self):
        pass
    def finalize_options(self):
        pass
    def run(self):
        if os.path.exists(os.path.join(os.path.dirname(__file__), 'vessel_scoring', 'models')):
            return
        print("Training models...", end='')
        sys.stdout.flush()
        import vessel_scoring.models
        vessel_scoring.models.train_models()
        print("done.")
        sys.stdout.flush()

class build(distutils.command.build.build):
    def run(self):
        self.run_command("build_models")
        distutils.command.build.build.run(self)

cmdclass = {}
cmdclass['build_models'] = BuildModelsCommand
cmdclass['build'] = build


distutils.core.setup(
    name='vessel-scoring',
    description="Tools to score fishing behviour of vessels",
    long_description='',
    packages=[
        'vessel_scoring',
    ],
    package_data={
        'vessel_scoring': ['models/*']},
    install_requires=DEPENDENCIES,
    extras_require={
        'dev': ['matplotlib', 'ipython', 'coveralls']},
    version='1.1',
    author='<NAME>, <NAME>',
    author_email='<EMAIL>, <EMAIL>',
    url='',
    license='Apache',
    cmdclass=cmdclass
)

{'fraction_non_alphanumeric': 0.13443830570902393, 'fraction_numerical': 0.003069367710251688, 'mean_word_length': 3.210594315245478, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2414264', 'n_tokens_mistral': 1044, 'n_tokens_neox': 1025, 'n_words': 203}