<commit_before>from subprocess import check_call


def init_parser(parser):
    parser.add_argument('name', type=str, help='Cluster name.')
    parser.add_argument('--async', action='store_true', dest='asink',
                        help="Do not wait for cluster deletion.")


def main(args, pass_through_args):  # pylint: disable=unused-argument
    print("Stopping cluster '{}'...".format(args.name))

    cmd = ['gcloud', 'dataproc', 'clusters', 'delete', '--quiet', args.name]
    if args.asink:
        cmd.append('--async')

    check_call(cmd)<commit_msg>hailctl dataproc stop now supports passthrough, dry-run (#7027)<commit_after>from subprocess import check_call


def init_parser(parser):
    parser.add_argument('name', type=str, help='Cluster name.')
    parser.add_argument('--async', action='store_true', dest='asink',
                        help="Do not wait for cluster deletion.")
    parser.add_argument('--dry-run', action='store_true',
                        help="Print gcloud dataproc command, but don't run it.")


def main(args, pass_through_args):
    print("Stopping cluster '{}'...".format(args.name))

    cmd = ['gcloud', 'dataproc', 'clusters', 'delete', '--quiet', args.name]
    if args.asink:
        cmd.append('--async')

    cmd.extend(pass_through_args)

    # print underlying gcloud command
    print(' '.join(cmd[:6]) + ' \\\n    ' + ' \\\n    '.join(cmd[6:]))

    if not args.dry_run:
        check_call(cmd)
{'fraction_non_alphanumeric': 0.16506189821182943, 'fraction_numerical': 0.0041265474552957355, 'mean_word_length': 3.2052023121387285, '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': '6878509', 'n_tokens_mistral': 476, 'n_tokens_neox': 450, 'n_words': 103}