<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_list(self, n=None):
 """ Converts sequence to list of elements. list functional.pipeline.Sequence [1, 2, 3] :param n: Take n elements of sequence if not None :return: list of elements in sequence """

        if n is None:
            self.cache()
            return self._base_sequence
        else:
            return self.cache().take(n).list()