def lambda_handler(event, context):
<EOL>bucket = event['<STR_LIT>'][<NUM_LIT:0>]['<STR_LIT>']['<STR_LIT>']['<STR_LIT:name>']<EOL>key = urllib.unquote_plus(event['<STR_LIT>'][<NUM_LIT:0>]['<STR_LIT>']['<STR_LIT:object>']['<STR_LIT:key>'].encode('<STR_LIT:utf8>'))<EOL>try:<EOL><INDENT>response = detect_faces(bucket, key)<EOL>print(response)<EOL>return response<EOL><DEDENT>except Exception as e:<EOL><INDENT>print(e)<EOL>print("<STR_LIT>".format(key, bucket) +<EOL>"<STR_LIT>")<EOL>raise e<EOL><DEDENT>
Demonstrates S3 trigger that uses
    Rekognition APIs to detect faces, labels and index faces in S3 Object.