MCPcopy Index your code
hub / github.com/RustPython/RustPython / header_fetch_parse

Method header_fetch_parse

Lib/email/policy.py:150–163  ·  view source on GitHub ↗

+ If the value has a 'name' attribute, it is returned to unmodified. Otherwise the name and the value with any linesep characters removed are passed to the header_factory method, and the resulting custom header object is returned. Any surrogateescaped bytes get turne

(self, name, value)

Source from the content-addressed store, hash-verified

148 return (name, self.header_factory(name, value))
149
150 def header_fetch_parse(self, name, value):
151 """+
152 If the value has a 'name' attribute, it is returned to unmodified.
153 Otherwise the name and the value with any linesep characters removed
154 are passed to the header_factory method, and the resulting custom
155 header object is returned. Any surrogateescaped bytes get turned
156 into the unicode unknown-character glyph.
157
158 """
159 if hasattr(value, 'name'):
160 return value
161 # We can't use splitlines here because it splits on more than \r and \n.
162 value = ''.join(linesep_splitter.split(value))
163 return self.header_factory(name, value)
164
165 def fold(self, name, value):
166 """+

Callers 4

valuesMethod · 0.45
itemsMethod · 0.45
getMethod · 0.45
get_allMethod · 0.45

Calls 3

hasattrFunction · 0.85
joinMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected