emodpy.collections_utils module

emodpy.collections_utils.cut_iterable_to(obj: Iterable, to: int)Tuple[Union[List, Mapping], int]

Cut an iterable to a certain length.

Parameters
  • obj – The iterable to cut.

  • to – The number of elements to return.

Returns

A list or dictionary (depending on the type of object) of elements and the remaining elements in the original list or dictionary.

emodpy.collections_utils.deep_get(d, key, default: Optional[callable] = None, getter: Optional[callable] = None, sep: str = '.')
emodpy.collections_utils.deep_set(d, key, value, default: Optional[callable] = None, getter: Optional[callable] = None, setter: Optional[callable] = None, sep: str = '.')
emodpy.collections_utils.deep_del(d: dict, key, getter: Optional[callable] = None, deleter: Optional[callable] = None, sep: str = '.')