<commit_before># -*- coding: utf-8 -*-
#  _  __
# | |/ /___ ___ _ __  ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
#              |_|
#
# <NAME>
# Copyright 2015 Keeper Security Inc.
# Contact: <EMAIL>
#

import subprocess
import json


def delete_aws_key(user, key_id):
    pipe = subprocess.Popen(['aws',
                             'iam',
                             'delete-access-key',
                             '--user-name={0}'.format(user),
                             '--access-key-id={0}'.format(key_id)
                             ],
                            stdin=subprocess.PIPE,
                            stdout=subprocess.PIPE,
                            stderr=subprocess.PIPE)

    (output1, error1) = pipe.communicate(timeout=3)
    if pipe.poll() != 0:
        if error1 is not None:
            print("Warning: Delete AWS access key for user {1}: {0}".format(error1.decode(), user))


def rotate(record, newpassword):
    """
    @type record: Record
    """
    try:<commit_msg>Update awskey.py<commit_after># -*- coding: utf-8 -*-
#  _  __
# | |/ /___ ___ _ __  ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
#              |_|
#
# <NAME>er
# Copyright 2016 Keeper Security Inc.
# Contact: <EMAIL>
#

import subprocess
import json


def delete_aws_key(user, key_id):
    pipe = subprocess.Popen(['aws',
                             'iam',
                             'delete-access-key',
                             '--user-name={0}'.format(user),
                             '--access-key-id={0}'.format(key_id)
                             ],
                            stdin=subprocess.PIPE,
                            stdout=subprocess.PIPE,
                            stderr=subprocess.PIPE)

    (output1, error1) = pipe.communicate(timeout=3)
    if pipe.poll() != 0:
        if error1 is not None:
            print("Warning: Delete AWS access key for user {1}: {0}".format(error1.decode(), user))


def rotate(record, newpassword):
    """
    @type record: Record
    """
    try:
{'fraction_non_alphanumeric': 0.1544011544011544, 'fraction_numerical': 0.01443001443001443, 'mean_word_length': 1.3880597014925373, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '3003493', 'n_tokens_mistral': 672, 'n_tokens_neox': 646, 'n_words': 112}