def send_to_delivery_stream(events, stream_name):
if not events:<EOL><INDENT>logger.info("<STR_LIT>")<EOL>return<EOL><DEDENT>records = []<EOL>for event in events:<EOL><INDENT>if not isinstance(event, str):<EOL><INDENT>event = json.dumps(event) + "<STR_LIT:\n>"<EOL><DEDENT>records.append({"<STR_LIT>": event})<EOL><DEDENT>firehose = boto3.client("<STR_LIT>")<EOL>logger.info("<STR_LIT>",<EOL>len(records), stream_name)<EOL>resp = firehose.put_record_batch(<EOL>DeliveryStreamName=stream_name,<EOL>Records=records)<EOL>return resp<EOL>
Sends a list of events to a Firehose delivery stream.