class_docstr: The Dataset to automatically download MedNIST data and generate items for training, validation or test.
  It's based on `CacheDataset` to accelerate the training process.
  
  Args:
      root_dir: target directory to download and load MedNIST dataset.
      section: expected data section, can be: `training`, `validation` or `test`.
      transform: transforms to execute operations on input data.
      download: whether to download and extract the MedNIST from resource link, default is False.
          if expected file already exists, skip downloading even set it to True.
          user can manually copy `MedNIST.tar.gz` file or `MedNIST` folder to root directory.
      seed: random seed to randomly split training, validation and test datasets, default is 0.
      val_frac: percentage of validation fraction in the whole dataset, default is 0.1.
      test_frac: percentage of test fraction in the whole dataset, default is 0.1.
      cache_num: number of items to be cached. Default is `sys.maxsize`.
          will take the minimum of (cache_num, data_length x cache_rate, data_length).
      cache_rate: percentage of cached data in total, default is 1.0 (cache all).
          will take the minimum of (cache_num, data_length x cache_rate, data_length).
      num_workers: the number of worker threads if computing cache in the initialization.
          If num_workers is None then the number returned by os.cpu_count() is used.
          If a value less than 1 is specified, 1 will be used instead.
      progress: whether to display a progress bar when downloading dataset and computing the transform cache content.
      copy_cache: whether to `deepcopy` the cache content before applying the random transforms,
          default to `True`. if the random transforms don't modify the cached content
          (for example, randomly crop from the cached image and deepcopy the crop region)
          or if every cache item is only used once in a `multi-processing` environment,
          may set `copy=False` for better performance.
      as_contiguous: whether to convert the cached NumPy array or PyTorch tensor to be contiguous.
          it may help improve the performance of following logic.
      runtime_cache: whether to compute cache at the runtime, default to `False` to prepare
          the cache content at initialization. See: :py:class:`monai.data.CacheDataset`.
  
  Raises:
      ValueError: When ``root_dir`` is not a directory.
      RuntimeError: When ``dataset_dir`` doesn't exist and downloading is not selected (``download=False``).
class_docstr_tok: ["The","Dataset","to","automatically","download","MedNIST","data","and","generate","items","for","training",",","validation","or","test",".","It","'s","based","on","`","CacheDataset","`","to","accelerate","the","training","process",".","Args",":","root_dir",":","target","directory","to","download","and","load","MedNIST","dataset",".","section",":","expected","data","section",",","can","be",":","`","training","`",",","`","validation","`","or","`","test","`",".","transform",":","transforms","to","execute","operations","on","input","data",".","download",":","whether","to","download","and","extract","the","MedNIST","from","resource","link",",","default","is","False",".","if","expected","file","already","exists",",","skip","downloading","even","set","it","to","True",".","user","can","manually","copy","`","MedNIST.tar.gz","`","file","or","`","MedNIST","`","folder","to","root","directory",".","seed",":","random","seed","to","randomly","split","training",",","validation","and","test","datasets",",","default","is","0.","val_frac",":","percentage","of","validation","fraction","in","the","whole","dataset",",","default","is","0.1.","test_frac",":","percentage","of","test","fraction","in","the","whole","dataset",",","default","is","0.1.","cache_num",":","number","of","items","to","be","cached",".","Default","is","`","sys.maxsize","`",".","will","take","the","minimum","of","(","cache_num",",","data_length","x","cache_rate",",","data_length",")",".","cache_rate",":","percentage","of","cached","data","in","total",",","default","is","1.0","(","cache","all",")",".","will","take","the","minimum","of","(","cache_num",",","data_length","x","cache_rate",",","data_length",")",".","num_workers",":","the","number","of","worker","threads","if","computing","cache","in","the","initialization",".","If","num_workers","is","None","then","the","number","returned","by","os.cpu_count","(",")","is","used",".","If","a","value","less","than","1","is","specified",",","1","will","be","used","instead",".","progress",":","whether","to","display","a","progress","bar","when","downloading","dataset","and","computing","the","transform","cache","content",".","copy_cache",":","whether","to","`","deepcopy","`","the","cache","content","before","applying","the","random","transforms",",","default","to","`","True","`",".","if","the","random","transforms","do","n't","modify","the","cached","content","(","for","example",",","randomly","crop","from","the","cached","image","and","deepcopy","the","crop","region",")","or","if","every","cache","item","is","only","used","once","in","a","`","multi-processing","`","environment",",","may","set","`","copy=False","`","for","better","performance",".","as_contiguous",":","whether","to","convert","the","cached","NumPy","array","or","PyTorch","tensor","to","be","contiguous",".","it","may","help","improve","the","performance","of","following","logic",".","runtime_cache",":","whether","to","compute","cache","at","the","runtime",",","default","to","`","False","`","to","prepare","the","cache","content","at","initialization",".","See",":",":","py",":","class",":","`","monai.data.CacheDataset","`",".","Raises",":","ValueError",":","When","``","root_dir","``","is","not","a","directory",".","RuntimeError",":","When","``","dataset_dir","``","does","n't","exist","and","downloading","is","not","selected","(","``","download=False","``",")","."]
code: def randomize(self, data: np.ndarray) -> None:
      self.R.shuffle(data)
  
imports: from __future__ import annotations
  import os
  import shutil
  import sys
  import warnings
  from collections.abc import Callable, Sequence
  from pathlib import Path
  from typing import Any
  import numpy
  from monai.apps.tcia import DCM_FILENAME_REGEX, download_tcia_series_instance, get_tcia_metadata, get_tcia_ref_uid, match_tcia_ref_uid_in_study
  from monai.apps.utils import download_and_extract
  from monai.config.type_definitions import PathLike
  from monai.data import CacheDataset, PydicomReader, load_decathlon_datalist, load_decathlon_properties, partition_dataset, select_cross_validation_folds
  from monai.transforms import LoadImaged, Randomizable
  from monai.utils import ensure_tuple
label_desc: Use image node_id 2 for calling the MedNISTDataset obj's underlying member method code with example usage: obj.randomize(data) without return types