<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_jsonl(self, path, mode='wb', compression=None):
 """ Saves the sequence to a jsonl file. Each element is mapped using json.dumps then written with a newline separating each element. :param path: path to write file :param mode: mode to write in, defaults to 'w' to overwrite contents :param compression: compression format """

        with universal_write_open(path, mode=mode, compression=compression) as output:
            output.write((self.map(json.dumps).make_string('\n') + '\n').encode('utf-8'))