parameters: (file_name, data)
docstring: write data to a file but only if file does not exist or it content different from data
docstring_summary: write data to a file but only if file does not exist or it content different from data
docstring_tokens: write data to a file but only if file does not exist or it content different from data
function: def update_source_file(file_name, data):
      ''' write data to a file but only if file does not exist or it content different from data '''
      if( not os.path.isfile(file_name)  or  open(file_name).read() != data ):
          print('Writing '+ file_name)
          with open(file_name, 'w') as f: f.write(data)
function_tokens: def update_source_file ( file_name , data ) : if ( not os . path . isfile ( file_name ) or open ( file_name ) . read ( ) != data ) : print ( 'Writing ' + file_name ) with open ( file_name , 'w' ) as f : f . write ( data )