<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _flatten_list(x):
 """Flatten an arbitrarily nested list into a new list. This can be useful to select pandas DataFrame columns. From https://stackoverflow.com/a/16176969/10581531 Examples -------- ['X1', 'M1', 'M2', 'Y1', 'Y2'] ['Xaa', 'Xbb', 'Xcc'] """

    result = []
    # Remove None
    x = list(filter(None.__ne__, x))
    for el in x:
        x_is_iter = isinstance(x, collections.Iterable)
        if x_is_iter and not isinstance(el, (str, tuple)):
            result.extend(_flatten_list(el))
        else:
            result.append(el)
    return result