warg.functions

Created on 14/01/2020

Functions

kws_sink(*args)

Returns args without any modification what so ever.

sink(*args, **kwargs)

Returns None, but accepts everything

prod(iterable)

Calculate the product of an Iterable, of int or floats :param iterable: :return:

collate_first_dim(batch)

call_identity(*args, **kwargs)

args_sink(*args, **kwargs)

identity(a)

description

invert_shallow_mapping(m)

flip_two_level_mapping(m)

result = {} [result.setdefault(a, {}).update({k:b}) for k, v in m.items() for a, b in v.items()] return result

swap_mapping_order(m, order)

nop()

empty_str()

list_keys(d)

first_key(d)

last_key(d)

to_list(x)

to_tuple(x)

recurse_replace_empty(iterable)

text_in_file(text, filename)

int_limits(c_int_type)

flatten_mapping(mapping[, seperator])

iterates and recursively flattens nested mappings by appending keys for each level

most_common_substrings(strings[, ...])

Finds common substrings in Iterable of strings, ordered in most to least occurring

mappings_agreement_reduce(m1, m2)

takes two mappings and reduces it to one mapping, if the agree or one of them is None take one or the other.