datumaro.util#
Functions
|
|
|
|
|
|
|
'escapes' is an iterable of (pattern, substitute) pairs |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns elements from the input iterable by batches of N items. |
|
'escapes' is an iterable of (pattern, substitute) pairs |
- datumaro.util.take_by(iterable, count)[source]#
Returns elements from the input iterable by batches of N items. (‘abcdefg’, 3) -> [‘a’, ‘b’, ‘c’], [‘d’, ‘e’, ‘f’], [‘g’]
- datumaro.util.parse_str_enum_value(value, enum_class, default=<object object>, unknown_member_error=None)[source]#
- datumaro.util.escape(s: str, escapes: Iterable[Tuple[str, str]]) str [source]#
‘escapes’ is an iterable of (pattern, substitute) pairs
- datumaro.util.unescape(s: str, escapes: Iterable[Tuple[str, str]]) str [source]#
‘escapes’ is an iterable of (pattern, substitute) pairs
- datumaro.util.dump_json(data: Any, *, sort_keys: bool = False, allow_numpy: bool = True, indent: bool = False, append_newline: bool = False) bytes [source]#
- datumaro.util.dump_json_file(path: str, data: Any, *, sort_keys: bool = False, allow_numpy: bool = True, indent: bool = False, append_newline: bool = False) None [source]#
Modules