<commit_before>import errno
import os

from mkenv._cli import CLI, Argument, Flag, Positional
from mkenv.common import _ROOT

from bp.errors import PathError


@CLI(
    Argument(
        kind=Positional(name="name"),
        help="remove the named virtualenv",
    ),
    Argument(
        kind=Flag(names=("-f", "--force")),
        help="ignore errors if the virtualenv does not exist",
    ),
    _ROOT,
)
def run(arguments, stdin, stdout, stderr):
    virtualenv = arguments["locator"].for_name(arguments["name"])
    try:
        virtualenv.remove()
    except PathError as error:
        if error.errno != errno.ENOENT:
            raise
        if not arguments["force"]:
            return os.EX_NOINPUT<commit_msg>Er, whoops, guess PathError doesn't work on real filepaths. Sigh.<commit_after>import errno
import os

from mkenv._cli import CLI, Argument, Flag, Positional
from mkenv.common import _ROOT


@CLI(
    Argument(
        kind=Positional(name="name"),
        help="remove the named virtualenv",
    ),
    Argument(
        kind=Flag(names=("-f", "--force")),
        help="ignore errors if the virtualenv does not exist",
    ),
    _ROOT,
)
def run(arguments, stdin, stdout, stderr):
    virtualenv = arguments["locator"].for_name(arguments["name"])
    try:
        virtualenv.remove()
    except (IOError, OSError) as error:  # FIXME: Once bp has exceptions
        if error.errno != errno.ENOENT:
            raise
        if not arguments["force"]:
            return os.EX_NOINPUT
{'fraction_non_alphanumeric': 0.11597084161696487, 'fraction_numerical': 0.0, 'mean_word_length': 2.813131313131313, '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': '5647719', 'n_tokens_mistral': 457, 'n_tokens_neox': 447, 'n_words': 130}