<commit_before>from __future__ import print_function

from six.moves.urllib import request as urllib2
from six.moves import cStringIO as StringIO
import pandas as pd
import click

from .help_messages import *
from .utils import (get_chart_params, get_charts_mapping,
                    get_data_series, keep_source_input_sync, get_data_from_url)
from .. import charts as bc

# Define a mapping to connect chart types supported arguments and chart classes
CHARTS_MAP = get_charts_mapping()

@click.command()
@click.option('--input', default=None,help=HELP_INPUT)
@click.option('--output', default='file://cli_output.html', help=HELP_OUTPUT)
@click.option('--title', default='Bokeh CLI')
@click.option('--plot_type', default='Line')
@click.option('--index', default='', help=HELP_INDEX)
@click.option('--series', default='', help=HELP_SERIES)
@click.option('--palette')
@click.option('--buffer', default='f', help=HELP_BUFFER)
@click.option('--sync_with_source', default=False)
def cli(input, output, title, plot_type, series, palette,
        index, buffer, sync_with_source):
    """Bokeh Command Line Tool is a minimal client to access high level plotting
    functionality provided by bokeh.charts API.

    Examples:

    >> python bokeh-cli.py --title "My Nice Plot" --series "High,Low,Close"
    --plot_type "Line" --palette Reds --input sample_data/stocks_data.csv

    >> cat sample_data/stocks_data.csv | python bokeh-cli.py --buffer t

    >> python bokeh-cli.py --help
    """
    cli = CLI(
        input, output, title, plot_type, series, palette, index, buffer,
        sync_with_source
    )
    cli.run()


class CLI(object):
    """This is the Bokeh Command Line Interface class and it is in
    charge of providing a very high level access to bokeh charts and
    extends it with functionality.

    """
    def __init__(self, input_source, output, title, plot_type, series, palette,
                 index, buffer, sync_with_source):
        """Args:
        input_source (str): path to the series data file (i.e.:
            /source/to/my/data.csv)
            NOTE: this can be either a path to a local file or an url<commit_msg>rename cli input argument<commit_after>from __future__ import print_function

from six.moves.urllib import request as urllib2
from six.moves import cStringIO as StringIO
import pandas as pd
import click

from .help_messages import *
from .utils import (get_chart_params, get_charts_mapping,
                    get_data_series, keep_source_input_sync, get_data_from_url)
from .. import charts as bc

# Define a mapping to connect chart types supported arguments and chart classes
CHARTS_MAP = get_charts_mapping()

@click.command()
@click.option('--input', 'input_source', default=None,help=HELP_INPUT)
@click.option('--output', default='file://cli_output.html', help=HELP_OUTPUT)
@click.option('--title', default='Bokeh CLI')
@click.option('--plot_type', default='Line')
@click.option('--index', default='', help=HELP_INDEX)
@click.option('--series', default='', help=HELP_SERIES)
@click.option('--palette')
@click.option('--buffer', default='f', help=HELP_BUFFER)
@click.option('--sync_with_source', default=False)
def cli(input_source, output, title, plot_type, series, palette,
        index, buffer, sync_with_source):
    """Bokeh Command Line Tool is a minimal client to access high level plotting
    functionality provided by bokeh.charts API.

    Examples:

    >> python bokeh-cli.py --title "My Nice Plot" --series "High,Low,Close"
    --plot_type "Line" --palette Reds --input sample_data/stocks_data.csv

    >> cat sample_data/stocks_data.csv | python bokeh-cli.py --buffer t

    >> python bokeh-cli.py --help
    """
    cli = CLI(
        input_source, output, title, plot_type, series, palette, index, buffer,
        sync_with_source
    )
    cli.run()


class CLI(object):
    """This is the Bokeh Command Line Interface class and it is in
    charge of providing a very high level access to bokeh charts and
    extends it with functionality.

    """
    def __init__(self, input_source, output, title, plot_type, series, palette,
                 index, buffer, sync_with_source):
        """Args:
        input_source (str): path to the series data file (i.e.:
            /source/to/my/data.csv)
            NOTE: this can be either a path to a local file or an url
{'fraction_non_alphanumeric': 0.11671270718232044, 'fraction_numerical': 0.00046040515653775324, 'mean_word_length': 3.6470588235294117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5585043', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1324, 'n_words': 413}