understanding list comprehension for flattening list of lists in python,[item for sublist in list_of_lists for item in sublist if valid(item)]