code: def create_users_with_gloabl_roles(
      user_roles: List[List[str]],
  ) -> List[authentication.Credentials]:
      """
      Set up users with the provided global role assignments.
      user_roles: list of roles to assign to each user, one entry per user.
      """
      user_creds: List[authentication.Credentials] = []
      sess = api_utils.determined_test_session(admin=True)
      for roles in user_roles:
          user = bindings.v1User(
              username=api_utils.get_random_string(),
              admin=False,
              active=True,
          )
          creds = api_utils.create_test_user(True, user=user)
          for role in roles:
              api_utils.assign_user_role(
                  session=sess,
                  user=creds.username,
                  role=role,
                  workspace=None,
              )
          user_creds.append(creds)
      return user_creds
  
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 5 for calling a global function with example usage: create_users_with_gloabl_roles(user_roles) and returns: user_creds