code: def test_connect(gcloud_run, subprocess):
      runner.invoke(cli.app, ["connect", "test-cluster", "notebook"])
  
      gcloud_args = gcloud_run.call_args[0][0]
      assert gcloud_args[:2] == ["compute", "ssh"]
      assert (
          gcloud_args[2][(gcloud_args[2].find("@") + 1) :]
          == "test-cluster-m"
      )
  
      assert "--ssh-flag=-D 10000" in gcloud_args
      assert "--ssh-flag=-N" in gcloud_args
      assert "--ssh-flag=-f" in gcloud_args
      assert "--ssh-flag=-n" in gcloud_args
  
      popen_args = subprocess.Popen.call_args[0][0]
      assert popen_args[0] == "chromium"
      assert popen_args[1].startswith("http://test-cluster-m")
  
      assert "--proxy-server=socks5://localhost:10000" in popen_args
      assert any(
          arg.startswith("--user-data-dir=") for arg in popen_args
      )
  
file_path: hail/hail/python/test/hailtop/hailctl/dataproc/test_connect.py
imports: from unittest.mock import Mock
  from typer.testing import CliRunner
  import pytest
  from hailtop.hailctl.dataproc import cli
label_desc: Use image node_id 5 for calling a global function with example usage: test_connect(gcloud_run, subprocess) without return types