def remove_shim_context(event):
 if ('context' in event):
  context = event['context']
  context_fields_to_remove = set(CONTEXT_FIELDS_TO_INCLUDE)
  context_fields_to_remove.add('client_id')
  for field in context_fields_to_remove:
   if (field in context):
    del context[field]

def remove_shim_context ( event ) : if ( 'context' in event ) : context = event [ 'context' ] context_fields_to_remove = set ( CONTEXT_FIELDS_TO_INCLUDE ) context_fields_to_remove . add ( 'client_id' ) for field in context_fields_to_remove : if ( field in context ) : del context [ field ]
remove obsolete fields from event context .