<commit_before>from collections import defaultdict
import boto3
import functools
from multiprocessing.pool import ThreadPool
import re

boto3.setup_default_session(region_name='us-east-1')
ecs = boto3.client('ecs')
ec2 = boto3.resource('ec2')
auto_scaling = boto3.client('autoscaling')
ecr = boto3.client('ecr')


def get_authorization():
    authorization = ecr.get_authorization_token()[0]
    token = authorization['authorizationToken']
    proxy = authorization['proxyEndpoint']
    index = token.find(':')
    username = token[:index]
    password = token[index+1:]
    return {'username': username, 'password': password, 'endpoint': proxy}
<commit_msg>Fixed errors in encoded API responses.<commit_after>from collections import defaultdict
import boto3
import functools
from multiprocessing.pool import ThreadPool
import re
import base64

boto3.setup_default_session(region_name='us-east-1')
ecs = boto3.client('ecs')
ec2 = boto3.resource('ec2')
auto_scaling = boto3.client('autoscaling')
ecr = boto3.client('ecr')


def get_authorization():
    authorization = ecr.get_authorization_token()['authorizationData'][0]
    encoded_token = authorization['authorizationToken']
    token = str(base64.b64decode(encoded_token), "utf-8")
    proxy = authorization['proxyEndpoint']
    index = token.find(':')
    username = token[:index]
    password = token[index+1:]
    print(username, password)
    return {'username': username, 'password': password, 'endpoint': proxy}

{'fraction_non_alphanumeric': 0.12635869565217392, 'fraction_numerical': 0.01970108695652174, 'mean_word_length': 5.851162790697674, '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': '202066', 'n_tokens_mistral': 470, 'n_tokens_neox': 455, 'n_words': 100}