code: def _get_instances(self, instance):
          
  
          return [
              x
              for x in self.tree.body
              if isinstance(x, instance)
          ]
docs: Finds all instances of instance in tree
  
          :param instance: type of object
          :return: list of objects in tree of same instance