code: def list_groups_roles(args: Namespace) -> None:
      session = setup_session(args)
      group_id = api.group_name_to_group_id(session, args.group_name)
      resp = bindings.get_GetRolesAssignedToGroup(
          session, groupId=group_id
      )
      if args.json:
          determined.cli.render.print_json(resp.to_json())
          return
  
      if resp.roles is None or len(resp.roles) == 0:
          print("group has no role assignments")
          return
  
      for i, r in enumerate(resp.roles):
          workspaces = []  # type: List[Dict[str, Any]]
          if resp.assignments[i].scopeCluster:
              workspaces.append(
                  {
                      "workspaceID": None,
                      "workspaceName": None,
                      "assignedGlobally": True,
                  }
              )
  
          workspace_ids = resp.assignments[i].scopeWorkspaceIds or []
          for wid in workspace_ids:
              workspace_name = bindings.get_GetWorkspace(
                  session, id=wid
              ).workspace.name
              workspaces.append(
                  {
                      "workspaceID": wid,
                      "workspaceName": workspace_name,
                      "assignedGlobally": False,
                  }
              )
  
          print(f"role '{r.name}' with ID {r.roleId} assigned")
          render.render_objects(
              workspaceAssignedToHeaders,
              [
                  render.unmarshal(workspaceAssignedToHeaders, w)
                  for w in workspaces
              ],
          )
          print()
  
file_path: determined/harness/determined/cli/rbac.py
imports: from argparse import Namespace
  from collections import namedtuple
  from typing import Any, Dict, List, Set, Tuple
  import determined.cli.render
  from determined.cli import default_pagination_args, render, require_feature_flag, setup_session
  from determined.common import api
  from determined.common.api import authentication, bindings
  from determined.common.declarative_argparse import Arg, Cmd
label_desc: Use image node_id 5 for calling a global function with example usage: list_groups_roles(args) without return types