code: def compute_num_training_steps(
      experiment_config: Dict, global_batch_size: int
  ) -> int:
      max_length_unit = list(
          experiment_config["searcher"]["max_length"].keys()
      )[0]
      max_length: int = experiment_config["searcher"]["max_length"][
          max_length_unit
      ]
      if max_length_unit == "batches":
          return max_length
      if max_length_unit == "epochs":
          if "records_per_epoch" in experiment_config:
              return max_length * int(
                  experiment_config["records_per_epoch"]
                  / global_batch_size
              )
          raise Exception(
              "Missing num_training_steps hyperparameter in the experiment "
              "configuration, which is needed to configure the learning rate scheduler."
          )
      # Otherwise, max_length_unit=='records'
      return int(max_length / global_batch_size)
  
file_path: determined/model_hub/model_hub/utils.py
imports: import logging
  import os
  import typing
  import urllib.parse
  from typing import Any, Dict, List, Union
  import filelock
  import numpy
  import requests
  import torch
label_desc: Use image node_id 4 for calling a global function with example usage: compute_num_training_steps(experiment_config, global_batch_size) and returns: int, max_length, unknown