MCPcopy Index your code
hub / github.com/python/cpython / get_params

Method get_params

Lib/email/message.py:689–709  ·  view source on GitHub ↗

Return the message's Content-Type parameters, as a list. The elements of the returned list are 2-tuples of key/value pairs, as split on the '=' sign. The left hand side of the '=' is the key, while the right hand side is the value. If there is no '=' sign in the pa

(self, failobj=None, header='content-type', unquote=True)

Source from the content-addressed store, hash-verified

687 return params
688
689 def get_params(self, failobj=None, header='content-type', unquote=True):
690 """Return the message's Content-Type parameters, as a list.
691
692 The elements of the returned list are 2-tuples of key/value pairs, as
693 split on the '=' sign. The left hand side of the '=' is the key,
694 while the right hand side is the value. If there is no '=' sign in
695 the parameter the value is the empty string. The value is as
696 described in the get_param() method.
697
698 Optional failobj is the object to return if there is no Content-Type
699 header. Optional header is the header to search instead of
700 Content-Type. If unquote is True, the value is unquoted.
701 """
702 missing = object()
703 params = self._get_params_preserve(missing, header)
704 if params is missing:
705 return failobj
706 if unquote:
707 return [(k, _unquotevalue(v)) for k, v in params]
708 else:
709 return params
710
711 def get_param(self, param, failobj=None, header='content-type',
712 unquote=True):

Callers 15

set_paramMethod · 0.95
del_paramMethod · 0.95
set_typeMethod · 0.95
test_set_paramMethod · 0.95
test_infoMethod · 0.80
test_read_textMethod · 0.80
test_read_text_base64Method · 0.80
test_get_paramsMethod · 0.80
test_del_paramMethod · 0.80
test_add_headerMethod · 0.80
test_add_headerMethod · 0.80
test_dsnMethod · 0.80

Calls 2

_get_params_preserveMethod · 0.95
_unquotevalueFunction · 0.85

Tested by 13

test_set_paramMethod · 0.76
test_infoMethod · 0.64
test_read_textMethod · 0.64
test_read_text_base64Method · 0.64
test_get_paramsMethod · 0.64
test_del_paramMethod · 0.64
test_add_headerMethod · 0.64
test_add_headerMethod · 0.64
test_dsnMethod · 0.64
test_content_typeMethod · 0.64