def product(self, projection=None):
        if self.empty():
            if projection:
                return projection(1)
            else:
                return 1
        if self.size() == 1:
            if projection:
                return projection(self.first())
            else:
                return self.first()

        if projection:
            return self.map(projection).reduce(mul)
        else:
            return self.reduce(mul)
Takes product of elements in sequence.
dataset/ETHPy150Open EntilZha/PyFunctional/functional/pipeline.py/Sequence.product