def extract_swift_bytes(content_type):
 (content_type, params) = parse_content_type(content_type)
 swift_bytes = None
 for (k, v) in params:
  if (k == 'swift_bytes'):
   swift_bytes = v
  else:
   content_type += (';%s=%s' % (k, v))
 return (content_type, swift_bytes)

def extract_swift_bytes ( content_type ) : ( content_type , params ) = parse_content_type ( content_type ) swift_bytes = None for ( k , v ) in params : if ( k == 'swift_bytes' ) : swift_bytes = v else : content_type += ( ';%s=%s' % ( k , v ) ) return ( content_type , swift_bytes )
parse a content-type and return a tuple containing: - the content_type string minus any swift_bytes param .