<commit_before>from __future__ import print_function

import argparse
import logging
import sys


from . import __version__
from .shell import Shell

try:
    raw_input
except NameError:
    raw_input = input


class CLI(object):
    def run(self):
        logging.basicConfig(level=logging.ERROR)

        params = self.get_params()
        s = Shell(params.hosts,
                  params.connect_timeout,
                  setup_readline=params.run_once == "")

        if params.run_once != "":
            sys.exit(0 if s.onecmd(params.run_once) == None else 1)<commit_msg>Handle IOError in run_once mode so paging works<commit_after>from __future__ import print_function

import argparse
import logging
import sys


from . import __version__
from .shell import Shell

try:
    raw_input
except NameError:
    raw_input = input


class CLI(object):
    def run(self):
        logging.basicConfig(level=logging.ERROR)

        params = self.get_params()
        s = Shell(params.hosts,
                  params.connect_timeout,
                  setup_readline=params.run_once == "")

        if params.run_once != "":
            try:
                sys.exit(0 if s.onecmd(params.run_once) == None else 1)
            except IOError:
                sys.exit(1)
{'fraction_non_alphanumeric': 0.08445146014206788, 'fraction_numerical': 0.003946329913180742, 'mean_word_length': 2.3280839895013123, 'pattern_counts': {'":': 2, '<': 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': '756487', 'n_tokens_mistral': 382, 'n_tokens_neox': 360, 'n_words': 94}