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

Function _splitparam

Lib/email/message.py:29–37  ·  view source on GitHub ↗
(param)

Source from the content-addressed store, hash-verified

27
28
29def _splitparam(param):
30 # Split header parameters. BAW: this may be too simple. It isn't
31 # strictly RFC 2045 (section 5.1) compliant, but it catches most headers
32 # found in the wild. We may eventually need a full fledged parser.
33 # RDM: we might have a Header here; for now just stringify it.
34 a, sep, b = str(param).partition(';')
35 if not sep:
36 return a.strip(), None
37 return a.strip(), b.strip()
38
39def _formatparam(param, value=None, quote=True):
40 """Convenience function to format and return a key=value pair.

Callers 2

get_content_typeMethod · 0.85

Calls 3

strFunction · 0.85
partitionMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…