def flatten(nested_list):
    """flatten nested list"""
    # test if nested
    if any(isinstance(i, list) for i in nested_list):
        flat_list = [item for sublist in nested_list for item in sublist]
        return flat_list
    else:
        return nested_list