https://github.com/NikVard/memstim-hh
Tip revision: 13f58bbfa77333a6a4e4f10b979338f54687ff7f authored by NikVard on 26 June 2022, 15:40:57 UTC
[FIX] working version w/ proper colors
[FIX] working version w/ proper colors
Tip revision: 13f58bb
annex_funcs.py
# -------------------------------------------
# Miscellaneous helper functions
# -------------------------------------------
def make_flat(old_list):
''' Takes as argument a list of lists and flattens it (i.e. returns a 1D list with all the elements) '''
new_list = []
for elem in old_list :
if type(elem)==list:
elem_flat = make_flat(elem)
new_list += elem_flat
else :
new_list.append(elem)
return new_list
