def run():
    """CLI runner
    """
    gogo_logger = gogo.Gogo(__name__, verbose=args.verbose).get_logger('run')

    if args.version:
        gogo_logger.info('gogo v%s' % gogo.__version__)
        exit(0)

    counted = {'get', 'tcp'}
    appended = {'filename', 'subject', 'url', 'host', 'port'}
    items = args._get_kwargs()
    counted_args = [i for i in items if i[0] in counted]
    appended_args = [i for i in items if i[0] in appended]

    high_appended_args = [(k, v[0]) for k, v in appended_args]
    high_counted_args = [(k, v > 0) for k, v in counted_args]
    high_kwargs = dict(it.chain(high_appended_args, high_counted_args))

    low_appended_args = [(k, v[-1]) for k, v in appended_args]
    low_counted_args = [(k, v > 1) for k, v in counted_args]
    low_kwargs = dict(it.chain(low_appended_args, low_counted_args))

    high_hdlr = getattr(gogo.handlers, '%s_hdlr' % args.high_hdlr)
    low_hdlr = getattr(gogo.handlers, '%s_hdlr' % args.low_hdlr)
    high_format = getattr(gogo.formatters, '%s_formatter' % args.high_format)
    low_format = getattr(gogo.formatters, '%s_formatter' % args.low_format)

    nkwargs = {
        'verbose': args.verbose,
        'high_level': args.high_level.upper(),
        'low_level': args.low_level.upper(),
        'high_formatter': high_format,
        'low_formatter': low_format,
        'monolog': args.monolog,
        'high_hdlr': high_hdlr(**high_kwargs),
        'low_hdlr': low_hdlr(**low_kwargs)}

    logger = gogo.Gogo(args.name, **nkwargs).get_logger('runner')

    try:
        message = args.message.read()
    except AttributeError:
        message = args.message

    getattr(logger, args.level)(message)
    exit(0)
dataset/ETHPy150Open reubano/pygogo/pygogo/main.py/run/original