合成函数 from: https://mathieularose.com/function-composition-in-python/
def compose(*functions): return functools.reduce(lambda f, g: lambda x: f(g(x)), functions, lambda x: x)