class_docstr: Batch sampler for making random batches of a single frame
  from one list and a number of known frames from another list.
class_docstr_tok: ["Batch","sampler","for","making","random","batches","of","a","single","frame","from","one","list","and","a","number","of","known","frames","from","another","list","."]
docstr: Args:
      first_indices: indexes of dataset items to use as the first element
                  of each batch.
      rest_indices: indexes of dataset items to use as the subsequent
                  elements of each batch. Not used if batch_size==1.
      batch_size: The common size of any batch.
      replacement: Whether the sampling of first items is with replacement.
      num_batches: The number of batches in an epoch. If 0 or None,
                  one epoch is the length of `first_indices`.
docstr_tok: ["Args",":","first_indices",":","indexes","of","dataset","items","to","use","as","the","first","element","of","each","batch",".","rest_indices",":","indexes","of","dataset","items","to","use","as","the","subsequent","elements","of","each","batch",".","Not","used","if","batch_size==1",".","batch_size",":","The","common","size","of","any","batch",".","replacement",":","Whether","the","sampling","of","first","items","is","with","replacement",".","num_batches",":","The","number","of","batches","in","an","epoch",".","If","0","or","None",",","one","epoch","is","the","length","of","`","first_indices","`","."]
code: def __init__(
      self,
      first_indices: List[int],
      rest_indices: List[int],
      batch_size: int,
      replacement: bool,
      num_batches: Optional[int] = None,
  ) -> None:
      """
      Args:
          first_indices: indexes of dataset items to use as the first element
                      of each batch.
          rest_indices: indexes of dataset items to use as the subsequent
                      elements of each batch. Not used if batch_size==1.
          batch_size: The common size of any batch.
          replacement: Whether the sampling of first items is with replacement.
          num_batches: The number of batches in an epoch. If 0 or None,
                      one epoch is the length of `first_indices`.
      """
      self.first_indices = first_indices
      self.rest_indices = rest_indices
      self.batch_size = batch_size
      self.replacement = replacement
      self.num_batches = None if num_batches == 0 else num_batches
  
      if batch_size - 1 > len(rest_indices):
          raise ValueError(
              f"Cannot make up ({batch_size})-batches from {len(self.rest_indices)}"
          )
  
      # copied from RandomSampler
      seed = int(torch.empty((), dtype=torch.int64).random_().item())
      self.generator = torch.Generator()
      self.generator.manual_seed(seed)
  
imports: from dataclasses import dataclass
  from enum import Enum
  from typing import Iterator, List, Optional, Tuple
  import torch
  from pytorch3d.implicitron.tools.config import registry, ReplaceableBase
  from torch.utils.data import BatchSampler, ConcatDataset, DataLoader, RandomSampler, Sampler
  from .dataset_base import DatasetBase
  from .dataset_map_provider import DatasetMap
  from .frame_data import FrameData
  from .scene_batch_sampler import SceneBatchSampler
  from .utils import is_known_frame_scalar
label_desc: Use image node_id 1 to create a new DoublePoolBatchSampler object from inherited base classes: Sampler with example: obj = DoublePoolBatchSampler(first_indices, rest_indices, batch_size, replacement, num_batches)