MCPcopy
hub / github.com/pydantic/pydantic / for_element

Method for_element

pydantic/v1/utils.py:514–521  ·  view source on GitHub ↗

:param e: key or index of element on value :return: raw values for element if self._items is dict and contain needed element

(self, e: 'IntStr')

Source from the content-addressed store, hash-verified

512 return item in self._items
513
514 def for_element(self, e: 'IntStr') -> Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']]:
515 """
516 :param e: key or index of element on value
517 :return: raw values for element if self._items is dict and contain needed element
518 """
519
520 item = self._items.get(e)
521 return item if not self.is_true(item) else None
522
523 def _normalize_indexes(self, items: 'MappingIntStrAny', v_length: int) -> 'DictIntStrAny':
524 """

Callers 5

test_value_itemsFunction · 0.95
_get_valueMethod · 0.45
_iterMethod · 0.45
_iterFunction · 0.45
_get_valueFunction · 0.45

Calls 2

is_trueMethod · 0.95
getMethod · 0.45

Tested by 1

test_value_itemsFunction · 0.76