def compose_functions(*func_list):
    """
    Referenes:
        https://mathieularose.com/function-composition-in-python/
    """
    def apply_composition(f, g):
        def compose(x):
            return f(g(x))
        return compose
    composed_func = functools.reduce(apply_composition, func_list)
    return composed_func
Referenes:
        https://mathieularose.com/function-composition-in-python/