def merge_headers_by_name(name, headers):
 matching_headers = find_matching_headers(name, headers)
 return ','.join((str(headers[h]) for h in matching_headers if (headers[h] is not None)))

def merge_headers_by_name ( name , headers ) : matching_headers = find_matching_headers ( name , headers ) return ',' . join ( ( str ( headers [ h ] ) for h in matching_headers if ( headers [ h ] is not None ) ) )
takes a specific header name and a dict of headers {"name": "value"} .