def flatten(in_list):
    """given a list of values in_list, flatten returns the list obtained by 
       flattening the top-level elements of in_list."""
    out_list = []
    for val in in_list:
        if isinstance(val, list):
            out_list.extend(val)
        else:
            out_list.append(val)

    return out_list
given a list of values in_list, flatten returns the list obtained by 
       flattening the top-level elements of in_list.