2 This file contains various utilitary functions
3 for basic number and list operations
6 def clamp(num, min_value, max_value):
7 return max(min(num, max_value), min_value)
10 i =
clamp(idx, 0, len(l)-1)
14 s =
clamp(start, 0, len(l)-1)
15 return [l[i]
for i
in range(s, len(l)-1)]
18 s =
clamp(start, 0, len(l)-1)
19 return [l[i:i+chunk_size]
for i
in range(s, len(l), chunk_size)]
27 if len(tmp) == chunk_size:
def dict_to_list_chunks(d, start, chunk_size)
def list_chunks(l, start, chunk_size)
def clamp(num, min_value, max_value)