code: def assign_user_role(
      session: api.Session,
      user: str,
      role: str,
      workspace: Optional[str],
  ) -> None:
      user_assign = api.create_user_assignment_request(
          session, user=user, role=role, workspace=workspace
      )
      req = bindings.v1AssignRolesRequest(
          userRoleAssignments=user_assign, groupRoleAssignments=[]
      )
      bindings.post_AssignRoles(session, body=req)
  
imports: import uuid
  from typing import Callable, Optional, Sequence, TypeVar
  import pytest
  from determined.common import api
  from determined.common.api import authentication, bindings, certs, errors
  from tests import config
label_desc: Use image node_id 4 for calling a global function with example usage: assign_user_role(session, user, role, workspace) without return types