def process_evaluations()

in rdklib/util/external.py [0:0]


def process_evaluations(event, client_factory, evaluations):
    config_client = client_factory.build_client('config')

    # Put together the request that reports the evaluation status
    result_token = event['resultToken']
    test_mode = False
    if result_token == 'TESTMODE':
        # Used solely for RDK test to skip actual put_evaluation API call
        test_mode = True

    if not evaluations:
        config_client.put_evaluations(Evaluations=[], ResultToken=result_token, TestMode=test_mode)
        return []

    # Invoke the Config API to report the result of the evaluation
    evaluation_copy = []
    evaluation_copy = evaluations[:]
    while evaluation_copy:
        config_client.put_evaluations(Evaluations=evaluation_copy[:100], ResultToken=result_token, TestMode=test_mode)
        del evaluation_copy[:100]

    # Used solely for RDK test to be able to test Lambda function
    return evaluations