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

Method is_

Lib/tomllib/_parser.py:247–262  ·  view source on GitHub ↗
(self, key: Key, flag: int)

Source from the content-addressed store, hash-verified

245 cont[key_stem]["recursive_flags" if recursive else "flags"].add(flag)
246
247 def is_(self, key: Key, flag: int) -> bool:
248 if not key:
249 return False # document root has no flags
250 cont = self._flags
251 for k in key[:-1]:
252 if k not in cont:
253 return False
254 inner_cont = cont[k]
255 if flag in inner_cont["recursive_flags"]:
256 return True
257 cont = inner_cont["nested"]
258 key_stem = key[-1]
259 if key_stem in cont:
260 cont = cont[key_stem]
261 return flag in cont["flags"] or flag in cont["recursive_flags"]
262 return False
263
264
265class NestedDict:

Callers 6

parse_inline_tableFunction · 0.95
test_operatorMethod · 0.80
test_isMethod · 0.80
create_dict_ruleFunction · 0.80
create_list_ruleFunction · 0.80
key_value_ruleFunction · 0.80

Calls

no outgoing calls

Tested by 2

test_operatorMethod · 0.64
test_isMethod · 0.64