metann.utils package¶
Submodules¶
metann.utils.containers module¶
-
class
metann.utils.containers.DefaultList(factory=<function _none_fun>, fill=None)[source]¶ Bases:
object
-
class
metann.utils.containers.SubDict(super_dict: collections.abc.Mapping, keys=[], keep_order=True)[source]¶ Bases:
collections.abc.MutableMappingProvide a sub dict access to a super dict.
Parameters: - super_dict (Mapping) – The super dictionary where you want to take a sub dict
- keys (iterable) – An iterable of keys according to which you want to access a sub dict
- keep_order (bool) – If set to true the sub dict will keep the iteration order of the super dict when it is iterated. Default: True
Examples
>>> super_dict = collections.OrderedDict({'a': 1, 'b': 2, 'c': 3}) >>> sub_dict = SubDict(super_dict, keys=['a', 'b'])
Module contents¶
-
class
metann.utils.SubDict(super_dict: collections.abc.Mapping, keys=[], keep_order=True)[source]¶ Bases:
collections.abc.MutableMappingProvide a sub dict access to a super dict.
Parameters: - super_dict (Mapping) – The super dictionary where you want to take a sub dict
- keys (iterable) – An iterable of keys according to which you want to access a sub dict
- keep_order (bool) – If set to true the sub dict will keep the iteration order of the super dict when it is iterated. Default: True
Examples
>>> super_dict = collections.OrderedDict({'a': 1, 'b': 2, 'c': 3}) >>> sub_dict = SubDict(super_dict, keys=['a', 'b'])