<commit_before><commit_msg>Uploading Lambda's code to get the key(s) from a subject<commit_after>import boto3
from boto3.dynamodb.conditions import Key


def lambda_handler(event, context):
    dynamodb = boto3.resource('dynamodb')
    table = dynamodb.Table('photo_subject')
    result = table.query(
        ProjectionExpression='file_key',
        KeyConditionExpression=Key('subject').eq(event['subject'])
    )
    return result['Items']
{'fraction_non_alphanumeric': 0.11538461538461539, 'fraction_numerical': 0.006787330316742082, 'mean_word_length': 4.828947368421052, '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': '527934', 'n_tokens_mistral': 137, 'n_tokens_neox': 131, 'n_words': 28}