code: def _find_instances(self, cls):
          
  
          instances = collections.OrderedDict()
  
          for child_name, child in self._children.iteritems():
  
              if isinstance(child, cls):
  
                  key_name = ".".join(child._get_path())
  
                  instances[key_name] = child
  
                  # Now check if the instance has children,
                  # and if it does go deeper in the tree
  
                  # NOTE: an empty dictionary evaluate as False
  
                  if child._children:
  
                      instances.update(child._find_instances(cls))
  
              else:
  
                  instances.update(child._find_instances(cls))
  
          return instances
docs: Find all the instances of cls below this node.
  
          :return: a dictionary of instances of cls