class_docstr: - **homepage**: https://www.image-net.org/
class_docstr_tok: ["-","*","*","homepage","*","*",":","https",":","\/\/www.image-net.org\/"]
code: def _generate_categories(self) -> List[Tuple[str, ...]]:
      self._split = "val"
      resources = self._resources()
  
      devkit_dp = resources[1].load(self._root)
      meta_dp = Filter(devkit_dp, self._filter_meta)
      meta_dp = CategoryAndWordNetIDExtractor(meta_dp)
  
      categories_and_wnids = cast(List[Tuple[str, ...]], list(meta_dp))
      categories_and_wnids.sort(
          key=lambda category_and_wnid: category_and_wnid[1]
      )
      return categories_and_wnids
  
imports: import enum
  import pathlib
  import re
  from typing import Any, BinaryIO, cast, Dict, Iterator, List, Match, Optional, Tuple, Union
  from torchdata.datapipes.iter import Demultiplexer, Enumerator, Filter, IterDataPipe, IterKeyZipper, LineReader, Mapper, TarArchiveLoader
  from torchdata.datapipes.map import IterToMapConverter
  from torchvision.prototype.datasets.utils import Dataset, EncodedImage, ManualDownloadResource, OnlineResource
  from torchvision.prototype.datasets.utils._internal import getitem, hint_sharding, hint_shuffling, INFINITE_BUFFER_SIZE, path_accessor, read_categories_file, read_mat
  from torchvision.prototype.tv_tensors import Label
  from .._api import register_dataset, register_info
label_desc: Use image node_id 12 for calling the ImageNet obj's underlying member method code with example usage: obj._generate_categories() and returns: categories_and_wnids