def _run_lab(self):
    token = str(uuid.uuid1())
    print(f'Jupyter lab token: {token}')
    base_cmd = "jupyter-lab --ip='localhost' --allow-root --ServerApp.allow_remote_access=True --no-browser"
    os.system(f'fuser -n tcp -k {self.port}')
    if (self._mount and colab_env):
        drive.mount('/content/drive')
    if self.password:
        lab_cmd = f" --ServerApp.token='{token}' --ServerApp.password='{self.password}' --port {self.port}"
    else:
        lab_cmd = f" --ServerApp.token='{token}' --ServerApp.password='' --port {self.port}"
    lab_cmd = (base_cmd + lab_cmd)
    with subprocess.Popen([lab_cmd], shell=True, stdout=subprocess.PIPE, bufsize=1, universal_newlines=True) as proc:
        for line in proc.stdout:
            print(line, end='')
def _run_lab(self):
    token = str(uuid.uuid1())
    print(f'Jupyter lab token: {token}')
    base_cmd = "jupyter-lab --ip='localhost' --allow-root --ServerApp.allow_remote_access=True --no-browser"
    os.system(f'fuser -n tcp -k {self.port}')
    if (self._mount and colab_env):
        drive.mount('/content/drive')
    if self.password:
        lab_cmd = f" --ServerApp.token='{token}' --ServerApp.password='{self.password}' --port {self.port}"
    else:
        lab_cmd = f" --ServerApp.token='{token}' --ServerApp.password= --port {self.port}"
    lab_cmd = (base_cmd + lab_cmd)
    with subprocess.Popen([lab_cmd], shell=True, stdout=subprocess.PIPE, bufsize=1, universal_newlines=True) as proc:
        for line in proc.stdout:
            print(line, end=)