<commit_before>#!/bin/bash

AMIID="ami-d511e5b3"
PROFILE="default"
REGION="ap-northeast-1"

INSTID=`aws --profile $PROFILE --region $REGION --output text ec2 describe-instances --filters "Name=key-name,Values=zesty64docker-key" --query 'Reservations[].Instances[0].InstanceId'`

echo "Waiting for instance deletion..."
sleep 10
echo "aws --profile $PROFILE --region $REGION --output text ec2 terminate-instances --instance-id $INSTID"
aws --profile $PROFILE --region $REGION --output text ec2 terminate-instances --instance-id $INSTID


aws --profile $PROFILE --region $REGION --output text ec2 delete-security-group --group-name zesty64docker-sg


rm -rf zesty64docker-key.pem
aws --profile $PROFILE --region $REGION --output text ec2 delete-key-pair --key-name zesty64docker-key<commit_msg>Add instance shutdown waiting<commit_after>#!/bin/bash

AMIID="ami-d511e5b3"
PROFILE="default"
REGION="ap-northeast-1"

echo "Querying Instance..."
INSTID=`aws --profile $PROFILE --region $REGION --output text ec2 describe-instances --filters "Name=key-name,Values=zesty64docker-key" --query 'Reservations[].Instances[0].InstanceId'`

echo "Deleting Instance..."
aws --profile $PROFILE --region $REGION --output text ec2 terminate-instances --instance-id $INSTID


for i in `seq 4 -1 0`; do
  echo "Waiting Instance shutdown..."
  sleep 5
  echo "Deleteing Security Group..."
  aws --profile $PROFILE --region $REGION --output text ec2 delete-security-group --group-name zesty64docker-sg
  if [ "$?" -eq "0" ]; then
    break;
  fi
  echo "Security Group deletion Failed. $i try left."
done


echo "Deleting SSH Key-Pair..."
aws --profile $PROFILE --region $REGION --output text ec2 delete-key-pair --key-name zesty64docker-key
rm -rf zesty64docker-key.pem

{'fraction_non_alphanumeric': 0.1452258433390509, 'fraction_numerical': 0.026300743281875358, 'mean_word_length': 3.9575070821529743, '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': '186285', 'n_tokens_mistral': 607, 'n_tokens_neox': 576, 'n_words': 170}