code: def change_password(parsed_args: Namespace) -> None:
      if parsed_args.target_user:
          username = parsed_args.target_user
      elif parsed_args.user:
          username = parsed_args.user
      else:
          username = client.get_session_username()
  
      if not username:
          # The default user should have been set by now by autologin.
          raise errors.CliError(
              "Please log in as an admin or user to change passwords"
          )
  
      password = getpass.getpass(
          "New password for user '{}': ".format(username)
      )
      check_password = getpass.getpass("Confirm password: ")
  
      if password != check_password:
          raise errors.CliError("Passwords do not match")
  
      user_obj = client.get_user_by_name(username)
      user_obj.change_password(new_password=password)
  
      # If the target user's password isn't being changed by another user, reauthenticate after
      # password change so that the user doesn't have to do so manually.
      if parsed_args.target_user is None:
          token_store = authentication.TokenStore(parsed_args.master)
          token = authentication.do_login(
              parsed_args.master, username, password, certs.cli_cert
          )
          token_store.set_token(username, token)
          token_store.set_active(username)
  
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 7 for calling a global function with example usage: change_password(parsed_args) without return types