sdcflows.utils.misc module

Basic miscellaneous utilities.

sdcflows.utils.misc.front(inlist)[source]

Pop from a list or tuple, otherwise return untouched.

Examples

>>> front([1, 0])
1
>>> front("/path/somewhere")
'/path/somewhere'
sdcflows.utils.misc.get_free_mem()[source]

Probe the free memory right now.

sdcflows.utils.misc.last(inlist)[source]

Return the last element from a list or tuple, otherwise return untouched.

Examples

>>> last([1, 0])
0
>>> last("/path/somewhere")
'/path/somewhere'