(self, key)
| 469 | self._dataset_name = dataset_name # deprecated, please don't use |
| 470 | |
| 471 | def __getitem__(self, key) -> SplitInfo | SubSplitInfo: |
| 472 | if not self: |
| 473 | raise KeyError( |
| 474 | f'Trying to access `splits[{key!r}]` but `splits` is empty. ' |
| 475 | 'This likely indicates the dataset has not been generated yet.' |
| 476 | ) |
| 477 | # 1st case: The key exists: `info.splits['train']` |
| 478 | elif str(key) in self.keys(): |
| 479 | return super().__getitem__(str(key)) |
| 480 | # 2nd case: Uses instructions: `info.splits['train[50%]']` |
| 481 | else: |
| 482 | instructions = _make_file_instructions( |
| 483 | split_infos=list(self.values()), |
| 484 | instruction=key, |
| 485 | ) |
| 486 | return SubSplitInfo(name=key, file_instructions=instructions) |
| 487 | |
| 488 | @classmethod |
| 489 | def from_proto( |
nothing calls this directly
no test coverage detected