<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def product(self, projection=None):
 """ Takes product of elements in sequence. 24 1 1 :param projection: function to project on the sequence before taking the product :return: product of elements in sequence """

        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)