def __init__(self, base_dataset: LightlyDataset, filenames_subset: List[str]):
        """Creates a subset of a LightlyDataset by filtering samples based on their filenames.

        Args:
            base_dataset:
                The original dataset from which a subset will be created.
            filenames_subset:
                List of filenames to be included in the subset.
        """
        self.base_dataset = base_dataset
        self.filenames_subset = filenames_subset

        # Create a dictionary mapping filenames to their indices in the base dataset
        dict_base_dataset_filename_index: Dict[str, int] = {}
        for index in range(len(base_dataset)):
            fname = base_dataset.index_to_filename(base_dataset.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
        ]
Creates a subset of a LightlyDataset by filtering samples based on their filenames.

        Args:
            base_dataset:
                The original dataset from which a subset will be created.
            filenames_subset:
                List of filenames to be included in the subset.
        
lightly/data/lightly_subset.py