code: def group_name_to_group_id(
      session: api.Session, group_name: str
  ) -> int:
      body = bindings.v1GetGroupsRequest(
          name=group_name, limit=1, offset=0
      )
      resp = bindings.post_GetGroups(session, body=body)
      groups = resp.groups
      if (
          groups is None
          or len(groups) != 1
          or groups[0].group.groupId is None
      ):
          raise api.errors.BadRequestException(
              f"could not find user group name {group_name}"
          )
      return groups[0].group.groupId
  
file_path: determined/harness/determined/common/api/_rbac.py
imports: from typing import Dict, List, Optional
  from determined.common import api
  from determined.common.api import bindings
label_desc: Use image node_id 5 for calling a global function with example usage: group_name_to_group_id(session, group_name) and returns: groups