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

Function _parseparam

Lib/email/message.py:73–96  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

71 return param
72
73def _parseparam(s):
74 # RDM This might be a Header, so for now stringify it.
75 s = ';' + str(s)
76 plist = []
77 start = 0
78 while s.find(';', start) == start:
79 start += 1
80 end = s.find(';', start)
81 ind, diff = start, 0
82 while end > 0:
83 diff += s.count('"', ind, end) - s.count('\\"', ind, end)
84 if diff % 2 == 0:
85 break
86 end, ind = ind, s.find(';', end + 1)
87 if end < 0:
88 end = len(s)
89 i = s.find('=', start, end)
90 if i == -1:
91 f = s[start:end]
92 else:
93 f = s[start:i].rstrip().lower() + '=' + s[i+1:end].lstrip()
94 plist.append(f.strip())
95 start = end
96 return plist
97
98
99def _unquotevalue(value):

Callers 1

_get_params_preserveMethod · 0.85

Calls 8

strFunction · 0.85
findMethod · 0.45
countMethod · 0.45
lowerMethod · 0.45
rstripMethod · 0.45
lstripMethod · 0.45
appendMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…