code: def test_job_filtering() -> None:
      with create_workspaces_with_users(
          [
              [
                  (0, ["Viewer", "Editor"]),
                  (1, ["Viewer"]),
              ],
              [
                  (2, ["Viewer"]),
                  (0, ["Viewer"]),
              ],
              [
                  (0, ["Editor"]),
              ],
          ]
      ) as (workspaces, creds):
          for ws in workspaces:
              seed_workspace(ws)
  
          jobs_per_ws = 5
          max_jobs = jobs_per_ws * len(workspaces)
          expectations: Dict[api.authentication.Credentials, int] = {
              conf.ADMIN_CREDENTIALS: max_jobs,
              creds[0]: max_jobs,
              creds[1]: jobs_per_ws,
              creds[2]: jobs_per_ws,
          }
  
          workspace_ids = {ws.id for ws in workspaces}
  
          for cred, visible_count in expectations.items():
              v1_jobs = bindings.get_GetJobs(
                  api_utils.determined_test_session(cred)
              ).jobs
              # filterout jobs from other workspaces as the cluster is shared between tests
              v1_jobs = [
                  j for j in v1_jobs if j.workspaceId in workspace_ids
              ]
              assert (
                  len(v1_jobs) == visible_count
              ), f"expected {visible_count} jobs for {cred}. {v1_jobs}"
  
              jobs = bindings.get_GetJobsV2(
                  api_utils.determined_test_session(cred)
              ).jobs
              full_jobs = [
                  j
                  for j in jobs
                  if j.full is not None
                  and j.full.workspaceId in workspace_ids
              ]
              limited_jobs = [
                  j
                  for j in jobs
                  if j.limited is not None
                  and j.limited.workspaceId in workspace_ids
              ]
              assert len(limited_jobs) == max_jobs - visible_count
              assert len(full_jobs) == max_jobs - len(limited_jobs)
  
file_path: determined/e2e_tests/tests/job/test_rbac.py
imports: from typing import Dict
  import pytest
  import tests.config
  from determined.common import api
  from determined.common.api import NTSC_Kind, bindings, errors
  from tests import api_utils
  from tests import experiment
  from tests.cluster import test_rbac
  from tests.cluster.test_rbac import create_users_with_gloabl_roles, create_workspaces_with_users, rbac_disabled
  from tests.cluster.test_users import det_run, logged_in_user
label_desc: Use image node_id 4 for calling a global function with example usage: test_job_filtering() without return types