<commit_before>#!/usr/bin/env bash

AWSVERSION=$(aws --version |awk -F"/" '{print $2}' |sed 's/ Python//')

if [[ $AWSVERSION < '1.11.24' ]]; then
  echo "Your version of AWS CLI is out of date"
  case `uname` in
  "Darwin" )
  	type brew
  	if [ $? -ne 0 ]
  	then
  		echo "brew not found. Please install at http://brew.sh"
  		exit 1
  	else
  		echo "brew already installed..."
  	fi

    type python3
  	if [ $? -ne 0 ]
  	then
  		echo "python3 not found. Installing.."
  		brew install python3
  		if [ $? -ne 0 ]
  		then
  			echo "Failed to install python3.."
  			exit 1
  		fi
  	else
  		echo "python3 already installed..."
  	fi

  	type pip3
  	if [ $? -ne 0 ]
  	then
  		echo "pip3 not found. Please correct."
  		exit 1
  	else
  		echo "pip3 already installed..."
  	fi

    pip3 show awscli
    if [ $? -ne 0 ]
    then
      echo "You're not using pip. "
      brew install awscli
    else
      echo "awscli already installed using pip, upgrading..."
      pip3 install -U awscli
    fi
  ;;
  Linux )
  	echo  "For Linux systems, please manually install / update AWS CLI. "
  	exit 1
  ;;
  * )
  	echo `uname` "is an unsupported OS. Please manually install  / update AWS CLI. "
  	exit 1
  ;;
  esac
else
  echo "Your version of AWS CLI is up to date! Nothing to do. "
fi<commit_msg>Updating AWS CLI Shell Script to use functions<commit_after>#!/usr/bin/env bash

# Install / Update Function
update_awscli() {
  case `uname` in
  "Darwin" )
  	type brew
  	if [ $? != 0 ]
  	then
  		echo "brew not found. Please install at http://brew.sh"
  		exit 1
  	else
  		echo "brew already installed..."
  	fi

    type python3
  	if [ $? != 0 ]
  	then
  		echo "python3 not found. Installing.."
  		brew install python3
  		if [ $? != 0 ]
  		then
  			echo "Failed to install python3.."
  			exit 1
  		fi
  	else
  		echo "python3 already installed..."
  	fi

  	type pip3
  	if [ $? != 0 ]
  	then
  		echo "pip3 not found. Please correct."
  		exit 1
  	else
  		echo "pip3 already installed..."
  	fi

    pip3 show awscli
    if [ $? != 0 ]
    then
      echo "You're not using pip. Installing using Brew... "
      brew install awscli
    else
      echo "awscli already installed using pip, upgrading..."
      pip3 install -U awscli
    fi
  ;;
  Linux )
  	echo  "For Linux systems, please manually install / update AWS CLI. "
  	exit 1
  ;;
  * )
  	echo `uname` "is an unsupported OS. Please manually install  / update AWS CLI. "
  	exit 1
  ;;
  esac
}

# Variables
AWSVERSION=$(aws --version |awk -F"/" '{print $2}' |sed 's/ Python//')

if [[ -z $AWSVERSION ]]; then
  echo "AWS CLI isn't installed. "
  update_awscli
fi

if [[ $AWSVERSION < '1.11.24' ]]; then
  echo "Your version of AWS CLI is out of date! Updating ... "
  update_awscli
else
  echo "Your version of AWS CLI is up to date! Nothing to do. "
fi
{'fraction_non_alphanumeric': 0.11181434599156118, 'fraction_numerical': 0.01828410689170183, 'mean_word_length': 2.06243272335845, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7343165', 'n_tokens_mistral': 1101, 'n_tokens_neox': 1032, 'n_words': 370}