#NEWLINE# def transform_column_source_data( data ) : #NEWLINE# #INDENT# 'iterate through the data of a ColumnSourceData object replacing\n    non-JSON-compliant objects with compliant ones\n    ' #NEWLINE# data_copy = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for key in iterkeys ( data ) : #NEWLINE# #INDENT# if ( pd and isinstance ( data [ key ] , ( pd . Series , pd . Index ) ) ) : #NEWLINE# #INDENT# data_copy [ key ] = transform_series ( data [ key ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( data [ key ] , np . ndarray ) : #NEWLINE# #INDENT# data_copy [ key ] = transform_array ( data [ key ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# data_copy [ key ] = traverse_data ( data [ key ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return data_copy