from jaraco functools 3 5 2 from jaraco functools 3 5 2
import functools



def compose(*funcs):
    def compose_two(f1, f2):
        return lambda *args, **kwargs: f1(f2(*args, **kwargs))

    return functools.reduce(compose_two, funcs)