def PickleToFile(records, outfile):
 encoded_records = []
 for record in records:
  encoded = record.Encode()
  encoded_records.append(encoded)
 pickle.dump(encoded_records, outfile, protocol=pickle.HIGHEST_PROTOCOL)

def PickleToFile ( records , outfile ) : encoded_records = [ ] for record in records : encoded = record . Encode ( ) encoded_records . append ( encoded ) pickle . dump ( encoded_records , outfile , protocol = pickle . HIGHEST_PROTOCOL )
writes appstats data to file .