docstr: Creates a subset of a LightlyDataset.
  
  Args:
      base_dataset:
          The dataset to subset from.
      filenames_subset:
          The filenames of the samples to be part of the subset.
docstr_tok: ["Creates","a","subset","of","a","LightlyDataset",".","Args",":","base_dataset",":","The","dataset","to","subset","from",".","filenames_subset",":","The","filenames","of","the","samples","to","be","part","of","the","subset","."]
code: def __init__(
      self, base_dataset: LightlyDataset, filenames_subset: List[str]
  ):
      """Creates a subset of a LightlyDataset.
  
      Args:
          base_dataset:
              The dataset to subset from.
          filenames_subset:
              The filenames of the samples to be part of the subset.
      """
      self.base_dataset = base_dataset
      self.filenames_subset = filenames_subset
  
      dict_base_dataset_filename_index: Dict[str, int] = dict()
      for index in range(len(base_dataset)):
          fname = base_dataset.index_to_filename(self.dataset, index)
          dict_base_dataset_filename_index[fname] = index
  
      self.mapping_subset_index_to_baseset_index = [
          dict_base_dataset_filename_index[filename]
          for filename in filenames_subset
      ]
  
file_path: lightly/lightly/data/lightly_subset.py
imports: from typing import Dict, List, Tuple
  from lightly.data.dataset import LightlyDataset
label_desc: Use image node_id 1 to create a new LightlySubset object from inherited base classes: LightlyDataset with example: obj = LightlySubset(base_dataset, filenames_subset)