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

Function get_no_fold_literal

Lib/email/_header_value_parser.py:2080–2100  ·  view source on GitHub ↗

no-fold-literal = "[" *dtext "]"

(value)

Source from the content-addressed store, hash-verified

2078
2079
2080def get_no_fold_literal(value):
2081 """ no-fold-literal = "[" *dtext "]"
2082 """
2083 no_fold_literal = NoFoldLiteral()
2084 if not value:
2085 raise errors.HeaderParseError(
2086 "expected no-fold-literal but found '{}'".format(value))
2087 if value[0] != '[':
2088 raise errors.HeaderParseError(
2089 "expected '[' at the start of no-fold-literal "
2090 "but found '{}'".format(value))
2091 no_fold_literal.append(ValueTerminal('[', 'no-fold-literal-start'))
2092 value = value[1:]
2093 token, value = get_dtext(value)
2094 no_fold_literal.append(token)
2095 if not value or value[0] != ']':
2096 raise errors.HeaderParseError(
2097 "expected ']' at the end of no-fold-literal "
2098 "but found '{}'".format(value))
2099 no_fold_literal.append(ValueTerminal(']', 'no-fold-literal-end'))
2100 return no_fold_literal, value[1:]
2101
2102def get_msg_id(value):
2103 """msg-id = [CFWS] "<" id-left '@' id-right ">" [CFWS]

Callers 1

get_msg_idFunction · 0.85

Calls 5

NoFoldLiteralClass · 0.85
ValueTerminalClass · 0.85
get_dtextFunction · 0.85
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…