code: def generate_dataset_statistics(
      training_set: Dataset,
      validation_set: Optional[Union[str, dict, pd.DataFrame, Dataset]],
      test_set: Optional[Union[str, dict, pd.DataFrame, Dataset]],
  ) -> List[Tuple[str, int, int]]:
      from ludwig.benchmarking.utils import format_memory
  
      dataset_statistics = [
          ["Dataset", "Size (Rows)", "Size (In Memory)"],
          [
              "Training",
              len(training_set),
              format_memory(training_set.in_memory_size_bytes),
          ],
      ]
      if validation_set is not None:
          dataset_statistics.append(
              [
                  "Validation",
                  len(validation_set),
                  format_memory(validation_set.in_memory_size_bytes),
              ]
          )
      if test_set is not None:
          dataset_statistics.append(
              [
                  "Test",
                  len(test_set),
                  format_memory(test_set.in_memory_size_bytes),
              ]
          )
      return dataset_statistics
  
file_path: ludwig/ludwig/utils/dataset_utils.py
imports: from typing import List, Optional, Tuple, Union
  import pandas
  from sklearn.model_selection import train_test_split
  from ludwig.api_annotations import PublicAPI
  from ludwig.constants import TEST_SPLIT, TRAIN_SPLIT, VALIDATION_SPLIT
  from ludwig.data.dataset.base import Dataset
  from ludwig.utils.defaults import default_random_seed
label_desc: Use image node_id 2 for calling a global function with example usage: generate_dataset_statistics(training_set, validation_set, test_set) and returns: dataset_statistics