code: def wait_for_ipykernel(self, service_name, timeout=10):
          
          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()
docs: Wait for an IPython kernel-nnnn.json filename message to appear in log.