code: def get_collected_stat_nodes(self, query_granularity):
      self.update_stat_nodes_granularity()
  
      collected_nodes = []
      stack = list()
      stack.append(self.root_node)
      while len(stack) > 0:
          node = stack.pop()
          for child in reversed(node.children):
              stack.append(child)
          if node.depth == query_granularity:
              collected_nodes.append(node)
          if node.depth < query_granularity <= node.granularity:
              collected_nodes.append(node)
      return collected_nodes
  
imports: import queue
label_desc: Use image node_id 4 for calling the StatTree obj's underlying member method code with example usage: obj.get_collected_stat_nodes(query_granularity) and returns: collected_nodes