class_docstr: Class implementing the Perfect Tree Traversal strategy in PyTorch for tree-base models.
code: def _traverse_by_level(
      self, node_by_levels, node_id, current_level, max_level
  ):
      current_level += 1
      if current_level == max_level:
          return node_id
      node_by_levels[current_level].add(node_id)
      node_id += 1
      node_id = self._traverse_by_level(
          node_by_levels, node_id, current_level, max_level
      )
      node_id = self._traverse_by_level(
          node_by_levels, node_id, current_level, max_level
      )
      return node_id
  
imports: from abc import abstractmethod
  from enum import Enum
  import numpy
  import torch
  from .None import constants
  from ._physical_operator import PhysicalOperator
  from .None import _tree_commons
label_desc: Use image node_id 4 for calling the PerfectTreeTraversalTreeImpl obj's underlying member method code with example usage: obj._traverse_by_level(node_by_levels, node_id, current_level, max_level) and returns: node_id, node_id