class_docstr: Interface to retrieve ImageNet class indeces from class names.
  
  This class implements a dictionary like object, aiming to provide an
  easy-to-use look-up table for finding a target class index from an ImageNet
  class name.
  
  Reference:
      - ImageNet class index: https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json
      - Synsets: http://image-net.org/challenges/LSVRC/2015/browse-synsets
  
  Note:
      Class names in `imagenet_class_index.json` has been slightly modified
      from the source due to duplicated class names (e.g. crane). This helps
      make the use of this tool simpler.
class_docstr_tok: ["Interface","to","retrieve","ImageNet","class","indeces","from","class","names",".","This","class","implements","a","dictionary","like","object",",","aiming","to","provide","an","easy-to-use","look-up","table","for","finding","a","target","class","index","from","an","ImageNet","class","name",".","Reference",":","-","ImageNet","class","index",":","https",":","\/\/s3.amazonaws.com\/deep-learning-models\/image-models\/imagenet_class_index.json","-","Synsets",":","http",":","\/\/image-net.org\/challenges\/LSVRC\/2015\/browse-synsets","Note",":","Class","names","in","`","imagenet_class_index.json","`","has","been","slightly","modified","from","the","source","due","to","duplicated","class","names","(","e.g",".","crane",")",".","This","helps","make","the","use","of","this","tool","simpler","."]
code: def __getitem__(self, phrase):
      if type(phrase) != str:
          raise TypeError("Target class needs to be a string.")
  
      if phrase in self._index:
          return self._index[phrase]
  
      partial_matches = self._find_partial_matches(phrase)
  
      if not any(partial_matches):
          return None
      elif len(partial_matches) > 1:
          raise ValueError(
              "Multiple potential matches found: {}".format(
                  ", ".join(map(str, partial_matches))
              )
          )
  
      target_class = partial_matches.pop()
  
      return self._index[target_class]
  
file_path: flashtorch/flashtorch/utils/imagenet.py
imports: import json
  from collections.abc import Mapping
  from importlib_resources import path
  from .None import resources
label_desc: Use image node_id 4 for calling the ImageNetIndex obj's underlying member method code with example usage: obj.__getitem__(phrase) and returns: self, self, None