def flatten(nested_list: list) -> list:
    """
    扁平化list
    :param nested_list: list
    :return: list
    """
    res_list = []
    for i in nested_list:
        if isinstance(i, list):
            res_list.extend(flatten(nested_list=i))
        else:
            res_list.append(i)
    return res_list