<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wait_for_ipykernel(self, service_name, timeout=10):
 """Wait for an IPython kernel-nnnn.json filename message to appear in log."""

        kernel_line = self._services[service_name].logs.tail.until(
            lambda line: "--existing" in line[1], timeout=10, lines_back=5
        )
        return kernel_line.replace("--existing", "").strip()