def split_content_type(c_type):
 delim = ';'
 ps = c_type.split(delim)
 tup = dict([(k.lower().strip(), v) for (k, v) in [p.split('=', 1) for p in ps[1:]]])
 return tup

def split_content_type ( c_type ) : delim = ';' ps = c_type . split ( delim ) tup = dict ( [ ( k . lower ( ) . strip ( ) , v ) for ( k , v ) in [ p . split ( '=' , 1 ) for p in ps [ 1 : ] ] ] ) return tup
parses the content type .