code: def configure_helm(args: argparse.Namespace) -> None:
      helm_dir = Path(args.helm_dir)
      with (helm_dir / "Chart.yaml").open() as f:
          helm_chart = safe_load_yaml_with_exceptions(f)
      if args.det_version:
          helm_chart["appVersion"] = args.det_version
      elif "dev" in helm_chart["appVersion"]:
          # Preserve user overridden appVersion in helm chart unless it includes dev in the version.
          helm_chart["appVersion"] = determined.__version__
      if args.gpu_coscheduler:
          helm_chart["defaultScheduler"] = "coscheduler"
      elif args.preemption:
          helm_chart["defaultScheduler"] = "preemption"
      with (helm_dir / "Chart.yaml").open("w") as f:
          yaml.round_trip_dump(helm_chart, f)
      with (helm_dir / "values.yaml").open() as f:
          helm_values = safe_load_yaml_with_exceptions(f)
      checkpointStorage = {}
      checkpointStorage["saveExperimentBest"] = helm_values[
          "checkpointStorage"
      ].get("saveExperimentBest", 0)
      checkpointStorage["saveTrialBest"] = helm_values[
          "checkpointStorage"
      ].get("saveTrialBest", 1)
      checkpointStorage["saveTrialLatest"] = helm_values[
          "checkpointStorage"
      ].get("saveTrialLatest", 1)
      checkpointStorage["type"] = "gcs"
      checkpointStorage["bucket"] = args.gcs_bucket_name
      helm_values["checkpointStorage"] = checkpointStorage
      helm_values["maxSlotsPerPod"] = args.gpus_per_node
  
      if args.multiple_node_pools:
          gpu_pod_spec = make_spec(
              helm_values["taskContainerDefaults"], "gpuPodSpec"
          )
          gpu_spec = cast(Dict, gpu_pod_spec["spec"])
          gpu_spec["tolerations"] = [
              {
                  "key": "gpuAvailable",
                  "operator": "Equal",
                  "value": "True",
                  "effect": "NoSchedule",
              }
          ]
          gpu_spec["nodeSelector"] = {"accelerator_type": "gpu"}
  
          helm_values["taskContainerDefaults"][
              "gpuPodSpec"
          ] = gpu_pod_spec
  
          cpu_pod_spec = make_spec(
              helm_values["taskContainerDefaults"], "cpuPodSpec"
          )
          cpu_spec = cast(Dict, cpu_pod_spec["spec"])
          cpu_spec["tolerations"] = [
              {
                  "key": "gpuAvailable",
                  "operator": "Equal",
                  "value": "False",
                  "effect": "NoSchedule",
              }
          ]
          cpu_spec["nodeSelector"] = {"accelerator_type": "cpu"}
  
          helm_values["taskContainerDefaults"][
              "cpuPodSpec"
          ] = cpu_pod_spec
  
      with (helm_dir / "values.yaml").open("w") as f:
          yaml.round_trip_dump(helm_values, f)
  
imports: import argparse
  import json
  import subprocess
  import sys
  from pathlib import Path
  from typing import Any, Dict, Optional, Union, cast
  from termcolor import cprint
  import determined
  from determined.common import yaml
  from determined.common.declarative_argparse import Arg, ArgGroup, Cmd
  from determined.common.util import safe_load_yaml_with_exceptions
  from determined.deploy.gke.constants import defaults
label_desc: Use image node_id 11 for calling a global function with example usage: configure_helm(args) without return types