datumaro.util#

Functions

cast(value, type_conv[, default])

dump_json(data, *[, sort_keys, allow_numpy, ...])

dump_json_file(path, data, *[, sort_keys, ...])

escape(s, escapes)

'escapes' is an iterable of (pattern, substitute) pairs

filter_dict(d, exclude_keys)

find(iterable[, pred, default])

is_method_redefined(method_name, base_class, ...)

optional_arg_decorator(fn)

pairs(iterable)

parse_json(data)

parse_json_file(path)

parse_str_enum_value(value, enum_class[, ...])

take_by(iterable, count)

Returns elements from the input iterable by batches of N items.

to_dict_from_streaming_json(obj)

to_snake_case(s)

unescape(s, escapes)

'escapes' is an iterable of (pattern, substitute) pairs

datumaro.util.find(iterable, pred=<function <lambda>>, default=None)[source]#
datumaro.util.cast(value, type_conv, default=None)[source]#
datumaro.util.to_snake_case(s)[source]#
datumaro.util.pairs(iterable)[source]#
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.filter_dict(d, exclude_keys)[source]#
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.is_method_redefined(method_name, base_class, target) bool[source]#
datumaro.util.optional_arg_decorator(fn)[source]#
datumaro.util.parse_json(data: str | bytes)[source]#
datumaro.util.parse_json_file(path: str)[source]#
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]#
datumaro.util.to_dict_from_streaming_json(obj: Any) Dict[str, Any][source]#

Modules

datumaro.util.annotation_util

datumaro.util.attrs_util

datumaro.util.definitions

datumaro.util.file_utils

datumaro.util.image

datumaro.util.image_cache

datumaro.util.import_util

datumaro.util.log_utils

datumaro.util.mask_tools

datumaro.util.meta_file_util

datumaro.util.multi_procs_util

datumaro.util.os_util

datumaro.util.pickle_util

datumaro.util.samples

datumaro.util.scope

datumaro.util.tabular_util

datumaro.util.telemetry_stub

datumaro.util.telemetry_utils

datumaro.util.tf_util