code: def get_num_training_steps_multi(
      config: ml_collections.ConfigDict,
      datasets_metadata: Dict[str, Dict[str, Any]],
  ) -> Tuple[int, Optional[int]]:
      """Calculates the total number of training step and possibly steps_per_epoch.
  
      The main training loop is based on number of training steps. Thus, for
      datasets
      that we want to train based on number of epochs, we need to calculate the
      total number of training steps. This function looks for `num_training_steps`
      in config, if it exists it returns that as the total step and `None` as
      `steps_per_epoch`. If num_training_steps doesn't exist, then it looks for
      `num_training_epochs` and given the size of training data calculates the total
      steps and steps_per_epoch. In this computation, we assume that
      drop_remainder=True.
  
      Args:
        config: Configuration of the experiment.
        datasets_metadata: Meta-data that is generated by the dataset_builder.
  
      Returns:
        total_steps: Total number of training steps.
        steps_per_epoch: Number of steps in every epoch.
      """
      num_total_train_examples = 0
      for ds_metadata in datasets_metadata.values():
          num_total_train_examples += ds_metadata.get(
              "num_train_examples", 0
          )
  
      # We either use num_training_epochs or num_training_steps.
      steps_per_epoch = (
          num_total_train_examples // get_average_batch_size(config)
      )
  
      if config.get("num_training_steps"):
          assert not config.get("num_training_epochs")
          return config.num_training_steps, steps_per_epoch or None
      else:
          assert config.num_training_epochs and not config.get(
              "num_training_steps"
          )
          return (
              steps_per_epoch * config.num_training_epochs
          ), steps_per_epoch
  
imports: from typing import Any, Dict, Optional, Tuple
  from flax.core import frozen_dict
  import ml_collections
  from scenic.train_lib_deprecated.train_utils import TrainState
label_desc: Use image node_id 2 for calling a global function with example usage: get_num_training_steps_multi(config, datasets_metadata) and returns: config,  unknown, unknown,  steps_per_epoch