def flatten(lol):
new_list = []<EOL>for element in lol:<EOL><INDENT>if element is None:<EOL><INDENT>continue<EOL><DEDENT>elif not isinstance(element, list) and not isinstance(element, tuple):<EOL><INDENT>new_list.append(element)<EOL><DEDENT>elif len(element) > <NUM_LIT:0>:<EOL><INDENT>new_list.extend(flatten(element))<EOL><DEDENT><DEDENT>return new_list<EOL>
Flatten a list of lists to a list.

    :param lol: A list of lists in arbitrary depth.
    :type lol: list of list.

    :returns: flat list of elements.