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

Function get_atom

Lib/email/_header_value_parser.py:1338–1363  ·  view source on GitHub ↗

atom = [CFWS] 1*atext [CFWS] An atom could be an rfc2047 encoded word.

(value)

Source from the content-addressed store, hash-verified

1336 return quoted_string, value
1337
1338def get_atom(value):
1339 """atom = [CFWS] 1*atext [CFWS]
1340
1341 An atom could be an rfc2047 encoded word.
1342 """
1343 atom = Atom()
1344 if value and value[0] in CFWS_LEADER:
1345 token, value = get_cfws(value)
1346 atom.append(token)
1347 if value and value[0] in ATOM_ENDS:
1348 raise errors.HeaderParseError(
1349 "expected atom but found '{}'".format(value))
1350 if value.startswith('=?'):
1351 try:
1352 token, value = get_encoded_word(value)
1353 except errors.HeaderParseError:
1354 # XXX: need to figure out how to register defects when
1355 # appropriate here.
1356 token, value = get_atext(value)
1357 else:
1358 token, value = get_atext(value)
1359 atom.append(token)
1360 if value and value[0] in CFWS_LEADER:
1361 token, value = get_cfws(value)
1362 atom.append(token)
1363 return atom, value
1364
1365def get_dot_atom_text(value):
1366 """ dot-text = 1*atext *("." 1*atext)

Callers 2

get_wordFunction · 0.85
get_domainFunction · 0.85

Calls 7

AtomClass · 0.85
get_cfwsFunction · 0.85
get_encoded_wordFunction · 0.85
get_atextFunction · 0.85
appendMethod · 0.45
formatMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…