<commit_before># -*- coding: utf-8 -*-
""" Command Line Interface.
"""
# Copyright © 2013 1&1 Internet AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


def run():
    """Main CLI entry point."""
    print("hellp, world!")


if __name__ == "__main__":
    # When started via "python -m"
    run()<commit_msg>cli skeleton using cliff<commit_after># -*- coding: utf-8 -*-
""" Command Line Interface.
"""
# Copyright © 2013 1&1 Internet AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import, with_statement

import sys
import logging

from cliff.app import App
from cliff.commandmanager import CommandManager

from infrascope import pkg_info


class InfrascopeCLI(App):
    """ The main `infrascope` command line application.
    """

    log = logging.getLogger(__name__)

    def __init__(self):
        project = pkg_info()
        super(InfrascopeCLI, self).__init__(
            description=project["description"],
            version='0.1', # TODO: need to get version at runtime
            command_manager=CommandManager('infrascope.cli'),
        )

    def initialize_app(self, argv):
        self.log.debug('initialize_app')

    def prepare_to_run_command(self, cmd):
        self.log.debug('prepare_to_run_command %s', cmd.__class__.__name__)

    def clean_up(self, cmd, result, err):
        self.log.debug('clean_up %s', cmd.__class__.__name__)
        if err:
            self.log.debug('got an error: %s', err)


def run(argv=None):
    """Main CLI entry point."""
    cli = InfrascopeCLI()
    sys.exit(cli.run(argv if argv is None else sys.argv[1:]))


if __name__ == "__main__":
    # When started via "python -m"
    run()
{'fraction_non_alphanumeric': 0.10441616766467066, 'fraction_numerical': 0.0093562874251497, 'mean_word_length': 3.5152027027027026, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4294445', 'n_tokens_mistral': 779, 'n_tokens_neox': 747, 'n_words': 295}