#NEWLINE# def backfill( self , customer_id , name , timestamp , **data ) : #NEWLINE# #INDENT# 'Backfill an event (track with timestamp) for a given customer_id' #NEWLINE# url = self . get_event_query_string ( customer_id ) #NEWLINE# if isinstance ( timestamp , datetime ) : #NEWLINE# #INDENT# timestamp = self . _datetime_to_timestamp ( timestamp ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not isinstance ( name , int ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# timestamp = int ( timestamp ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# raise CustomerIOException ( '{t} is not a valid timestamp ({err})' . format ( t = timestamp , err = e ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# post_data = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'data' : data , #NEWLINE# 'timestamp' : timestamp , #NEWLINE# #UNINDENT# } #NEWLINE# self . send_request ( 'POST' , url , post_data )