def remove_entity_headers(headers, allowed=('expires', 'content-location')):
 allowed = set((x.lower() for x in allowed))
 headers[:] = [(key, value) for (key, value) in headers if ((not is_entity_header(key)) or (key.lower() in allowed))]

def remove_entity_headers ( headers , allowed = ( 'expires' , 'content-location' ) ) : allowed = set ( ( x . lower ( ) for x in allowed ) ) headers [ : ] = [ ( key , value ) for ( key , value ) in headers if ( ( not is_entity_header ( key ) ) or ( key . lower ( ) in allowed ) ) ]
remove all entity headers from a list or :class:headers object .