<commit_before>import argparse
from vpsutil.api import DigitalOcean
from vpsutil.logger import logger
from vpsutil.config import config, Providers

try:
    from vpsutil_private import parser_hook
except ImportError:
    parser_hook = NotImplemented
    logger.warning(
        "parser_hook() will not be run, could not import vpsutil_private")


def destroy_resources(parser, args):
    logger.info("Destroying resources with the name %r", args.name)
    do = DigitalOcean()
    do.ssh.delete_key(name=args.name)

    do.droplets.delete_droplet(name=args.name)

    # For now we don't destroy any other record type
    for record_type in ("A", "AAAA"):
        do.dns.delete_record(args.domain, record_type, args.name)


def ocean():
    parser = argparse.ArgumentParser()
    subparsers = parser.add_subparsers()
    parser.add_argument(
        "-d", "--domain",
        help="The domain you wish to operate on when working with DNS records",
        default=config.get(Providers.DIGITAL_OCEAN, "domain"))

    destroy = subparsers.add_parser(
        "destroy", help="Destroy resources on Digital Ocean based on a name")
    destroy.add_argument("name", help="Name of objects to destroy")
    destroy.set_defaults(func=destroy_resources)

    if parser_hook is not NotImplemented:
        parser_hook(parser, subparsers)
<commit_msg>remove rsa key pair<commit_after>import argparse
from vpsutil.api import DigitalOcean
from vpsutil.logger import logger
from vpsutil.config import config, Providers
from vpsutil.ssh import SSHClient

try:
    from vpsutil_private import parser_hook
except ImportError:
    parser_hook = NotImplemented
    logger.warning(
        "parser_hook() will not be run, could not import vpsutil_private")


def destroy_resources(parser, args):
    logger.info("Destroying resources with the name %r", args.name)
    do = DigitalOcean()
    do.ssh.delete_key(name=args.name)

    do.droplets.delete_droplet(name=args.name)

    # For now we don't destroy any other record type
    for record_type in ("A", "AAAA"):
        do.dns.delete_record(args.domain, record_type, args.name)

    SSHClient.delete_rsa_key_pair(args.name)


def ocean():
    parser = argparse.ArgumentParser()
    subparsers = parser.add_subparsers()
    parser.add_argument(
        "-d", "--domain",
        help="The domain you wish to operate on when working with DNS records",
        default=config.get(Providers.DIGITAL_OCEAN, "domain"))

    destroy = subparsers.add_parser(
        "destroy", help="Destroy resources on Digital Ocean based on a name")
    destroy.add_argument("name", help="Name of objects to destroy")
    destroy.set_defaults(func=destroy_resources)

    if parser_hook is not NotImplemented:
        parser_hook(parser, subparsers)

{'fraction_non_alphanumeric': 0.09239130434782608, 'fraction_numerical': 0.0, 'mean_word_length': 3.8523725834797893, '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': '7417742', 'n_tokens_mistral': 843, 'n_tokens_neox': 817, 'n_words': 236}