def flatten_list(arg) -> list:
    """Function used for flattening lists recursively"""
    ls = []
    for i in arg:
        if isinstance(i, list):
            ls.extend(i)
        else:
            ls.append(i)
    return ls