class_docstr: Class for representing ImageNet/WordNet hierarchy. 
class_docstr_tok: ["Class","for","representing","ImageNet\/WordNet","hierarchy","."]
docstr: Get all descendants of a given node.
  
  Args:
      node_wnid (str) : WordNet ID for synset for node
      in_imagenet (bool) : If True, only considers descendants among 
                          ImageNet synsets, else considers all possible
                          descendants in the WordNet hierarchy
  
  Returns:
      A set of wnids corresponding to all the descendants
docstr_tok: ["Get","all","descendants","of","a","given","node",".","Args",":","node_wnid","(","str",")",":","WordNet","ID","for","synset","for","node","in_imagenet","(","bool",")",":","If","True",",","only","considers","descendants","among","ImageNet","synsets",",","else","considers","all","possible","descendants","in","the","WordNet","hierarchy","Returns",":","A","set","of","wnids","corresponding","to","all","the","descendants"]
code: def get_descendants(self, node_wnid, in_imagenet=False):
      """
      Get all descendants of a given node.
  
      Args:
          node_wnid (str) : WordNet ID for synset for node
          in_imagenet (bool) : If True, only considers descendants among
                              ImageNet synsets, else considers all possible
                              descendants in the WordNet hierarchy
  
      Returns:
          A set of wnids corresponding to all the descendants
      """
      if in_imagenet:
          return set(
              [
                  self.wnid_to_num[ww]
                  for ww in self.tree[node_wnid].descendants_all
                  if ww in set(self.in_wnids)
              ]
          )
      else:
          return self.tree[node_wnid].descendants_all
  
file_path: robustness/robustness/tools/imagenet_helpers.py
imports: import os
  import numpy
  import json
  from itertools import product
label_desc: Use image node_id 5 for calling the ImageNetHierarchy obj's underlying member method code with example usage: obj.get_descendants(node_wnid, in_imagenet) and returns: set, self