<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def put_log_events(awsclient, log_group_name, log_stream_name, log_events, sequence_token=None):
 """Put log events for the specified log group and stream. :param log_group_name: log group name :param log_stream_name: log stream name :param sequence_token: the sequence token :return: next_token """

    client_logs = awsclient.get_client('logs')
    request = {
        'logGroupName': log_group_name,
        'logStreamName': log_stream_name,
        'logEvents': log_events
    }
    if sequence_token:
        request['sequenceToken'] = sequence_token

    response = client_logs.put_log_events(**request)
    if 'rejectedLogEventsInfo' in response:
        log.warn(response['rejectedLogEventsInfo'])
    if 'nextSequenceToken' in response:
        return response['nextSequenceToken']