class_docstr: Class for few-shot evaluation.
class_docstr_tok: ["Class","for","few-shot","evaluation","."]
docstr: Lazy-loads given dataset.
docstr_tok: ["Lazy-loads","given","dataset","."]
code: def _get_dataset(
      self,
      dataset_name: str,
      train_split: str,
      test_split: str,
      num_train_examples: Optional[int] = None,
      num_test_examples: Optional[int] = None,
  ):
      """Lazy-loads given dataset."""
      assert train_split == "train", (
          "train_split should be set to train for "
          "few-shot-video evaluator"
      )
      assert test_split == "validation" or test_split == "test", (
          "test_split should be set to validation or test for few-shot-video "
          "evaluator"
      )
      if dataset_name in self._datasets:
          return self._datasets[dataset_name]
      else:
          rng = jax.random.PRNGKey(self.config.rng_seed)
          data_rng, rng = jax.random.split(rng)
          with self.config.unlocked():
              self.config.dataset_name = dataset_name
          dataset = train_utils.get_dataset(self.config, data_rng)
          train_ds = dataset.train_iter
          num_train_samples = min_without_none(
              num_train_examples,
              dataset.meta_data["num_train_examples"],
          )
          if test_split == "validation":
              test_ds = dataset.valid_iter
              num_test_samples = min_without_none(
                  num_test_examples,
                  dataset.meta_data["num_eval_examples"],
              )
          elif test_split == "test":
              test_ds = dataset.test_iter
              num_test_samples = min_without_none(
                  num_test_examples,
                  dataset.meta_data["num_test_examples"],
              )
          num_classes = dataset.meta_data["num_classes"]
          is_one_hot = dataset.meta_data["target_is_onehot"]
          return self._datasets.setdefault(
              dataset_name,
              (
                  train_ds,
                  test_ds,
                  num_train_samples,
                  num_test_samples,
                  num_classes,
                  is_one_hot,
              ),
          )
  
imports: import functools
  from typing import Any, Optional, Tuple
  from absl import logging
  from clu import metric_writers
  from flax import jax_utils
  import jax
  import jax.numpy
  import numpy
  from scenic.dataset_lib import dataset_utils
  from scenic.dataset_lib.big_transfer import builder
  from scenic.train_lib import train_utils
  import tensorflow_datasets
label_desc: Use image node_id 2 for calling the FewShotEvaluatorVideo obj's underlying member method code with example usage: obj._get_dataset(dataset_name, train_split, test_split, num_train_examples, num_test_examples) and returns: self, self