def split_repeated_headers(kvset):
 headers = defaultdict(list)
 for (key, value) in kvset:
  headers[key] = value.split('\x00')
 return dict(headers)

def split_repeated_headers ( kvset ) : headers = defaultdict ( list ) for ( key , value ) in kvset : headers [ key ] = value . split ( '\x00' ) return dict ( headers )
given a set of key-value pairs .