code: def workspace_by_name(
      session: api.Session, name: str
  ) -> bindings.v1Workspace:
      assert name, "workspace name cannot be empty"
      w = bindings.get_GetWorkspaces(
          session, nameCaseSensitive=name
      ).workspaces
      assert len(w) <= 1, "workspace name is assumed to be unique."
      if len(w) == 0:
          raise not_found_errs("workspace", name, session)
      return bindings.get_GetWorkspace(session, id=w[0].id).workspace
  
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 6 for calling a global function with example usage: workspace_by_name(session, name) and returns: bindings