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

Function get_value

Lib/email/_header_value_parser.py:2465–2485  ·  view source on GitHub ↗

quoted-string / attribute

(value)

Source from the content-addressed store, hash-verified

2463
2464
2465def get_value(value):
2466 """ quoted-string / attribute
2467
2468 """
2469 v = Value()
2470 if not value:
2471 raise errors.HeaderParseError("Expected value but found end of string")
2472 leader = None
2473 if value[0] in CFWS_LEADER:
2474 leader, value = get_cfws(value)
2475 if not value:
2476 raise errors.HeaderParseError("Expected value but found "
2477 "only {}".format(leader))
2478 if value[0] == '"':
2479 token, value = get_quoted_string(value)
2480 else:
2481 token, value = get_extended_attribute(value)
2482 if leader is not None:
2483 token[:0] = [leader]
2484 v.append(token)
2485 return v, value
2486
2487def get_parameter(value):
2488 """ attribute [section] ["*"] [CFWS] "=" value

Callers 1

get_parameterFunction · 0.70

Calls 6

get_cfwsFunction · 0.85
get_quoted_stringFunction · 0.85
get_extended_attributeFunction · 0.85
ValueClass · 0.70
formatMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…