https://github.com/NikVard/memstim-hh
Tip revision: 6f5b0c54a39579fc0fa992406d0d56cd383361cb authored by Nikolaos Vardalakis on 02 March 2023, 17:09:40 UTC
[DEL] Deleted old license
[DEL] Deleted old license
Tip revision: 6f5b0c5
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
