<commit_before>from __future__ import print_function
import saliweb.backend
from optparse import OptionParser
import sys


def get_options():
    parser = OptionParser()
    parser.set_usage("""
%prog [-h] [-f] STATE JOBNAME [...]

Delete the job(s) JOBNAME in the given STATE.

STATE must be either FAILED or EXPIRED if the backend daemon is running.
Jobs in other states can only be deleted if the backend is stopped first.
""")
    parser.add_option("-f", "--force", action="store_true",
                      default=False, dest="force",
                      help="Delete jobs without prompting")
    opts, args = parser.parse_args()
    if len(args) < 2:
        parser.error("Need to specify a state and at least one job name")
    return args[0], args[1:], opts


def delete_job(job, force):
    if not force:
        sys.stdout.write("Delete job %s? " % job.name)
        reply = sys.stdin.readline()
        if len(reply) < 1 or reply[0].upper() != 'Y':
            return
    job.delete()<commit_msg>Make sure that prompt is visible<commit_after>from __future__ import print_function
import saliweb.backend
from optparse import OptionParser
import sys


def get_options():
    parser = OptionParser()
    parser.set_usage("""
%prog [-h] [-f] STATE JOBNAME [...]

Delete the job(s) JOBNAME in the given STATE.

STATE must be either FAILED or EXPIRED if the backend daemon is running.
Jobs in other states can only be deleted if the backend is stopped first.
""")
    parser.add_option("-f", "--force", action="store_true",
                      default=False, dest="force",
                      help="Delete jobs without prompting")
    opts, args = parser.parse_args()
    if len(args) < 2:
        parser.error("Need to specify a state and at least one job name")
    return args[0], args[1:], opts


def delete_job(job, force):
    if not force:
        sys.stdout.write("Delete job %s? " % job.name)
        sys.stdout.flush()
        reply = sys.stdin.readline()
        if len(reply) < 1 or reply[0].upper() != 'Y':
            return
    job.delete()
{'fraction_non_alphanumeric': 0.11605415860735009, 'fraction_numerical': 0.004835589941972921, 'mean_word_length': 2.7824497257769654, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7199112', 'n_tokens_mistral': 622, 'n_tokens_neox': 603, 'n_words': 219}