def files_re_match_multiline(file1, file2, attributes=None):
 local_file = open(file1, 'U').read()
 if (attributes is None):
  attributes = {}
 if attributes.get('sort', False):
  history_data = open(file2, 'U').readlines()
  history_data.sort()
  history_data = ''.join(history_data)
 else:
  history_data = open(file2, 'U').read()
 assert re.match(local_file, history_data, re.MULTILINE), 'Multiline Regular expression did not match data file'

def files_re_match_multiline ( file1 , file2 , attributes = None ) : local_file = open ( file1 , 'U' ) . read ( ) if ( attributes is None ) : attributes = { } if attributes . get ( 'sort' , False ) : history_data = open ( file2 , 'U' ) . readlines ( ) history_data . sort ( ) history_data = '' . join ( history_data ) else : history_data = open ( file2 , 'U' ) . read ( ) assert re . match ( local_file , history_data , re . MULTILINE ) , 'Multiline Regular expression did not match data file'
check the contents of 2 files for differences using re .