def flatten_list(list_):
res = []<EOL>for elem in list_:<EOL><INDENT>if isinstance(elem, list):<EOL><INDENT>res.extend(flatten_list(elem))<EOL><DEDENT>else:<EOL><INDENT>res.append(elem)<EOL><DEDENT><DEDENT>return res<EOL>
Banana banana