Collection of useful functions.
The simplify function is used to de-nest an iterable with a single element in it, as for instance [1], while leaving everything else constant. It can also exchange a function for its default argument.
simplify({1})
simplify(simplify)(lambda x='lul': 2*x)
What's very convenient is that it leaves lists invariant (it doen't nest them into a new list).
listify([1, 2])
listify(1, 2, 3)
setify(1, 2, 3)
tuplify(1)
merge_tfms(
{'animals': ['cats', 'dog'], 'colors': 'blue'},
{'animals': 'cats', 'colors': 'red', 'OS': 'i use arch btw'}
)
def save_dataset(data):
return 'NotImplementedError'