code: def get_train_dataset_sizes(
      self, data_param_list, datasets, epoch, shard_epoch=None
  ):
      num_shards = [
          self.get_split_num_data_shards(param["split"])[param["key"]]
          for param in data_param_list
      ]
      data_sizes = []
      for (key, d), num_shard in zip(datasets, num_shards):
          my_data_sizes = self._training_data_sizes[key]
          shard_ind = self.get_shard_id(num_shard, epoch, shard_epoch)
          if shard_ind not in my_data_sizes:
              my_data_sizes[shard_ind] = len(d)
          known_size = max(my_data_sizes.values())
          data_sizes.append(
              # If we don't know the data size of the shard yet,
              # use the the max known data size to approximate.
              # Note that we preprocess shards by a designated shard size
              # and put any remaining data at the end into the last shard so
              # the max shard size approximation is almost correct before loading
              # the last shard; after loading the last shard, it will have the
              # exact data sizes of the whole data size.
              (
                  key,
                  sum(
                      my_data_sizes.get(i, known_size)
                      for i in range(num_shard)
                  ),
              )
          )
      logger.info(
          f"estimated total data sizes of all shards used in sampling ratios: {data_sizes}. "
          "Note that if the data a shard has not been loaded yet, use the max known data size to approximate"
      )
      return [s for _, s in data_sizes]
  
imports: import itertools
  import json
  import logging
  import math
  import os
  from collections import OrderedDict, defaultdict
  from argparse import ArgumentError
  from fairseq import utils
  from fairseq.data import AppendTokenDataset, ConcatDataset, Dictionary, LanguagePairDataset, PrependTokenDataset, SampledMultiDataset, SampledMultiEpochDataset, StripTokenDataset, TransformEosLangPairDataset, TruncateDataset, data_utils, indexed_dataset
  from fairseq.data.multilingual.multilingual_utils import EncoderLangtok, LangTokSpec, LangTokStyle, augment_dictionary, get_lang_tok
  from fairseq.data.multilingual.sampled_multi_dataset import CollateFormat
  from fairseq.file_io import PathManager
  from fairseq.utils import FileContentsAction, csv_str_list, eval_str_dict
label_desc: Use image node_id 32 for calling the MultilingualDatasetManager obj's underlying member method code with example usage: obj.get_train_dataset_sizes(data_param_list, datasets, epoch, shard_epoch) and returns: unknown