def transfer_events_to_another_collection(client, source_collection, destination_collection, dry, reverse=False):
 schemas_match = make_sure_keen_schemas_match(source_collection, destination_collection, client)
 if (not schemas_match):
  raise ValueError('The two provided schemas in keen do not match, you will need to do a bit more work.')
 events_from_source = extract_events_from_keen(client, source_collection)
 for event in events_from_source:
  event['keen'].pop('created_at')
  event['keen'].pop('id')
 if reverse:
  remove_events_from_keen(client, destination_collection, events_from_source, dry)
 else:
  add_events_to_keen(client, destination_collection, events_from_source, dry)
  logger.info('Transferred {} events from the {} collection to the {} collection'.format(len(events_from_source), source_collection, destination_collection))

def transfer_events_to_another_collection ( client , source_collection , destination_collection , dry , reverse = False ) : schemas_match = make_sure_keen_schemas_match ( source_collection , destination_collection , client ) if ( not schemas_match ) : raise ValueError ( 'The two provided schemas in keen do not match, you will need to do a bit more work.' ) events_from_source = extract_events_from_keen ( client , source_collection ) for event in events_from_source : event [ 'keen' ] . pop ( 'created_at' ) event [ 'keen' ] . pop ( 'id' ) if reverse : remove_events_from_keen ( client , destination_collection , events_from_source , dry ) else : add_events_to_keen ( client , destination_collection , events_from_source , dry ) logger . info ( 'Transferred {} events from the {} collection to the {} collection' . format ( len ( events_from_source ) , source_collection , destination_collection ) )
transfer analytics from source collection to the destination collection .