code: def run_permission_tests(
      action: Callable[[authentication.Credentials], None],
      cases: List[PermCase],
  ) -> None:
      for cred, raises in cases:
          if raises is None:
              action(cred)
          else:
              with pytest.raises(raises):
                  action(cred)
  
imports: import contextlib
  from typing import Any, Callable, Dict, Generator, List, NamedTuple, Optional, Tuple
  import pytest
  from determined.common import api
  from determined.common.api import authentication, bindings, errors
  from tests import api_utils
  from tests import config
  from tests.cluster.test_workspace_org import setup_workspaces
  from .test_groups import det_cmd, det_cmd_expect_error, det_cmd_json
  from .test_users import logged_in_user
label_desc: Use image node_id 4 for calling a global function with example usage: run_permission_tests(action, cases) without return types