code: def link_with_agent_user(parsed_args: Namespace) -> None:
      if parsed_args.agent_uid is None:
          raise api.errors.BadRequestException(
              "agent-uid argument required"
          )
      elif parsed_args.agent_user is None:
          raise api.errors.BadRequestException(
              "agent-user argument required"
          )
      elif parsed_args.agent_gid is None:
          raise api.errors.BadRequestException(
              "agent-gid argument required"
          )
      elif parsed_args.agent_group is None:
          raise api.errors.BadRequestException(
              "agent-group argument required"
          )
  
      user_obj = client.get_user_by_name(parsed_args.det_username)
      user_obj.link_with_agent(
          agent_gid=parsed_args.agent_gid,
          agent_group=parsed_args.agent_group,
          agent_uid=parsed_args.agent_uid,
          agent_user=parsed_args.agent_user,
      )
  
imports: import getpass
  from argparse import Namespace
  from collections import namedtuple
  from typing import Any, List
  from determined.cli import errors, login_sdk_client, render, setup_session
  from determined.common import api
  from determined.common.api import authentication, bindings, certs
  from determined.common.declarative_argparse import Arg, Cmd, string_to_bool
  from determined.experimental import client
  from determined.experimental.client import Determined
label_desc: Use image node_id 8 for calling a global function with example usage: link_with_agent_user(parsed_args) without return types