parameters: (filename, data)
docstring: Write data to filename
      Only write changed data to avoid updating timestamps unnecessarily
docstring_summary: Write data to filename
      Only write changed data to avoid updating timestamps unnecessarily
docstring_tokens: Write data to filename Only write changed data to avoid updating timestamps unnecessarily
function: def write_file(filename, data):
      """
      Write data to filename
      Only write changed data to avoid updating timestamps unnecessarily
      """
      if os.path.exists(filename):
          with open(filename) as f:
              if data == f.read():
                  return
  
      with open(filename, 'w') as fid:
          fid.write(data)
function_tokens: def write_file ( filename , data ) : if os . path . exists ( filename ) : with open ( filename ) as f : if data == f . read ( ) : return with open ( filename , 'w' ) as fid : fid . write ( data )