<commit_before>"""The ``prepare`` command configures a project to run, asking the user questions if necessary."""
from __future__ import absolute_import, print_function

import os
import sys

from project.prepare import prepare, UI_MODE_BROWSER
from project.project import Project


def prepare_command(dirname, ui_mode):
    """Configure the project to run.

    Returns:
        True on success.
    """
    project = Project(dirname)
    result = prepare(project, ui_mode=ui_mode)

    if result.failed:
        result.print_output()

    return result


def main(argv):
    """Start the prepare command."""
    # future: real arg parser
    if len(argv) > 1:
        dirname = argv[1]
    else:
        dirname = "."
    dirname = os.path.abspath(dirname)
    if prepare_command(dirname, ui_mode=UI_MODE_BROWSER):
        sys.exit(0)
    else:
        sys.exit(1)
<commit_msg>prepare command: Don't print output twice<commit_after>"""The ``prepare`` command configures a project to run, asking the user questions if necessary."""
from __future__ import absolute_import, print_function

import os
import sys

from project.prepare import prepare, UI_MODE_BROWSER
from project.project import Project


def prepare_command(dirname, ui_mode):
    """Configure the project to run.

    Returns:
        Prepare result (can be treated as True on success).
    """
    project = Project(dirname)
    result = prepare(project, ui_mode=ui_mode)

    return result


def main(argv):
    """Start the prepare command."""
    # future: real arg parser
    if len(argv) > 1:
        dirname = argv[1]
    else:
        dirname = "."
    dirname = os.path.abspath(dirname)
    if prepare_command(dirname, ui_mode=UI_MODE_BROWSER):
        sys.exit(0)
    else:
        sys.exit(1)

{'fraction_non_alphanumeric': 0.09661016949152543, 'fraction_numerical': 0.004519774011299435, 'mean_word_length': 3.1966824644549763, 'pattern_counts': {'":': 0, '<': 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': '895917', 'n_tokens_mistral': 537, 'n_tokens_neox': 512, 'n_words': 166}