code: def group_operations(self):
      current_front: Set[Node] = set()
      next_front: Set[Node] = set()
      stages = []
  
      for node in self.root_nodes.keys():
          current_front.add(node)
  
      while current_front:
          current_stage = list()
          jitted_stage = len(stages) % 2 == 0
  
          while current_front:
              node = current_front.pop()
              if (
                  node.is_jitted == jitted_stage
                  or node.is_jitted is None
              ):
                  current_stage.append(self.node_to_id[node])
                  current_front.update(set(self.adjacency_list[node]))
  
              else:
                  next_front.add(node)
  
          stages.append(current_stage)
          current_front = next_front
  
      return stages
  
imports: from distutils.log import warn
  import warnings
  import ast
  from collections import defaultdict
  from typing import Callable, Dict, List, Optional, Sequence, Set
  from abc import ABC, abstractmethod
  from ffcv.pipeline.allocation_query import AllocationQuery
  from ffcv.pipeline.pipeline_spec import PipelineSpec
  from ffcv.pipeline.compiler import Compiler
  from ffcv.pipeline.allocation_query import allocate_query
  from .operation import Operation
  from ..transforms import ModuleWrapper
  from .state import State
  import torch
  import numpy
label_desc: Use image node_id 4 for calling the Graph obj's underlying member method code with example usage: obj.group_operations() and returns: stages