def write_metadata(fd, metadata):
 metastr = pickle.dumps(metadata, PICKLE_PROTOCOL)
 key = 0
 while metastr:
  setxattr(fd, ('%s%s' % (METADATA_KEY, (key or ''))), metastr[:254])
  metastr = metastr[254:]
  key += 1

def write_metadata ( fd , metadata ) : metastr = pickle . dumps ( metadata , PICKLE_PROTOCOL ) key = 0 while metastr : setxattr ( fd , ( '%s%s' % ( METADATA_KEY , ( key or '' ) ) ) , metastr [ : 254 ] ) metastr = metastr [ 254 : ] key += 1
helper function to write pickled metadata for an object file .