<commit_before>from __future__ import absolute_import

import click

from accountable.accountable import Accountable


def prettyprint(*args):
    click.echo(' - '.join([arg for arg in args]))


@click.group()
def cli():
    """
    A Jira CLI.
    """
    pass


@click.command()
@click.option('--username', prompt='Your Jira username')
@click.option('--password', prompt='Your Jira password', hide_input=True)
@click.option('--domain', prompt='The domain where your account is hosted')
def configure(username, password, domain):
    """
    Initial configuration. Used to specify your username, password and domain.
    Configuration is stored in ~/.accountable/config.yaml.
    """
    Accountable(username=username,
                password=password,
                domain=domain,
                create_config=True)


@click.command()
def projects():
    """
    List all projects.
    """
    accountable = Accountable()
    projects = accountable.projects()
    for pid, key, name in projects:
        prettyprint(pid, key, name)


@click.command()
@click.argument('project_key', default='')
def issuetypes(project_key):
    """
    List all issue types. Optional parameter to list issue types by a given
    project.
    """
    accountable = Accountable()
    projects = accountable.issue_types(project_key)
    for key, issue_types in projects.items():
        for i in issue_types:
            prettyprint(key, i['id'], i['name'], i['description'])


@click.command()
@click.argument('options', nargs=-1)
def createissue(options):
    accountable = Accountable()
    issue = accountable.issue_create(options)
    prettyprint(issue['id'], issue['key'], issue['self'])


@click.command()
@click.argument('options', nargs=-1)
def checkoutbranch(options):
    accountable = Accountable()
    issue = accountable.checkout_branch(options)
    prettyprint(issue['id'], issue['key'], issue['self'])


@click.group(invoke_without_command=True)
@click.argument('issue_key')
@click.pass_context
def issue(ctx, issue_key):
    """
    List metadata for a given issue key. Issue keys should take the format of
    {PROJECT-ID}-{ISSUE-ID}.
    """
    ctx.obj = {}
    ctx.obj['issue_key'] = issue_key
    if not ctx.invoked_subcommand:<commit_msg>Make issuetype output consistent with projects<commit_after>from __future__ import absolute_import

import click

from accountable.accountable import Accountable


def prettyprint(*args):
    click.echo(' - '.join([arg for arg in args]))


@click.group()
def cli():
    """
    A Jira CLI.
    """
    pass


@click.command()
@click.option('--username', prompt='Your Jira username')
@click.option('--password', prompt='Your Jira password', hide_input=True)
@click.option('--domain', prompt='The domain where your account is hosted')
def configure(username, password, domain):
    """
    Initial configuration. Used to specify your username, password and domain.
    Configuration is stored in ~/.accountable/config.yaml.
    """
    Accountable(username=username,
                password=password,
                domain=domain,
                create_config=True)


@click.command()
def projects():
    """
    List all projects.
    """
    accountable = Accountable()
    projects = accountable.projects()
    for pid, key, name in projects:
        prettyprint(pid, key, name)


@click.command()
@click.argument('project_key', default='')
def issuetypes(project_key):
    """
    List all issue types. Optional parameter to list issue types by a given
    project.
    """
    accountable = Accountable()
    projects = accountable.issue_types(project_key)
    for key, issue_types in projects.items():
        for i in issue_types:
            prettyprint(i['id'], key, i['name'], i['description'])


@click.command()
@click.argument('options', nargs=-1)
def createissue(options):
    accountable = Accountable()
    issue = accountable.issue_create(options)
    prettyprint(issue['id'], issue['key'], issue['self'])


@click.command()
@click.argument('options', nargs=-1)
def checkoutbranch(options):
    accountable = Accountable()
    issue = accountable.checkout_branch(options)
    prettyprint(issue['id'], issue['key'], issue['self'])


@click.group(invoke_without_command=True)
@click.argument('issue_key')
@click.pass_context
def issue(ctx, issue_key):
    """
    List metadata for a given issue key. Issue keys should take the format of
    {PROJECT-ID}-{ISSUE-ID}.
    """
    ctx.obj = {}
    ctx.obj['issue_key'] = issue_key
    if not ctx.invoked_subcommand:
{'fraction_non_alphanumeric': 0.13657458563535912, 'fraction_numerical': 0.0008839779005524862, 'mean_word_length': 3.665979381443299, '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': '2595474', 'n_tokens_mistral': 1333, 'n_tokens_neox': 1293, 'n_words': 348}