<commit_before>import boto3
import travispy
import yaml

from .travis import travis_encrypt as _travis_encrypt
from .iam import credentials_for_new_user, IAMName

def artifact_yaml(
        repo, pro, github_token, github_owner, s3_bucket,
        aws_region=None, aws_key=None, aws_secret=None, aws_profile=None):
    travis = travispy.TravisPy.github_auth(
            github_token,
            uri=travispy.travispy.PRIVATE if pro else travispy.travispy.PUBLIC,
            )
    iam = boto3.session.Session(
            aws_access_key_id=aws_key,
            aws_secret_access_key=aws_secret,
            region_name=aws_region,
            profile_name=aws_profile,
            ).client('iam')
    access_key = credentials_for_new_user(
            iam,
            '{}__{}__{}'.format(IAMName, github_owner, repo),
            s3_bucket,
            )
    repo_slug = '{}/{}'.format(github_owner, repo)
    return yaml.safe_dump({
        'key': {
            'secure': _travis_encrypt(travis, repo_slug, access_key['AccessKeyId']),
            },
        'secret': {
            'secure': _travis_encrypt(travis, repo_slug, access_key['SecretAccessKey']),
            },
        },
        default_flow_style=False,
        allow_unicode=True,
        )
<commit_msg>Add __all__ declaration in __init__.py.<commit_after>import boto3
import travispy
import yaml

from .travis import travis_encrypt as _travis_encrypt
from .iam import credentials_for_new_user, IAMName

__all__ = [ 'artifact_yaml', ]

def artifact_yaml(
        repo, pro, github_token, github_owner, s3_bucket,
        aws_region=None, aws_key=None, aws_secret=None, aws_profile=None):
    travis = travispy.TravisPy.github_auth(
            github_token,
            uri=travispy.travispy.PRIVATE if pro else travispy.travispy.PUBLIC,
            )
    iam = boto3.session.Session(
            aws_access_key_id=aws_key,
            aws_secret_access_key=aws_secret,
            region_name=aws_region,
            profile_name=aws_profile,
            ).client('iam')
    access_key = credentials_for_new_user(
            iam,
            '{}__{}__{}'.format(IAMName, github_owner, repo),
            s3_bucket,
            )
    repo_slug = '{}/{}'.format(github_owner, repo)
    return yaml.safe_dump({
        'key': {
            'secure': _travis_encrypt(travis, repo_slug, access_key['AccessKeyId']),
            },
        'secret': {
            'secure': _travis_encrypt(travis, repo_slug, access_key['SecretAccessKey']),
            },
        },
        default_flow_style=False,
        allow_unicode=True,
        )

{'fraction_non_alphanumeric': 0.10138248847926268, 'fraction_numerical': 0.0030721966205837174, 'mean_word_length': 2.441215323645971, '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': '6156590', 'n_tokens_mistral': 852, 'n_tokens_neox': 868, 'n_words': 140}