class_docstr: Wrap a value (int or dict with int keys), so that the computation on it can be replayed.
  It builds a binary tree. If ``value`` is not None, it's a leaf node.
  Otherwise, it has left sub-tree and right sub-tree and an operation.
  
  Only support basic arithmetic operations: ``+``, ``-``, ``*``, ``//``.
code: def __init__(
      self,
      value: int_or_int_dict | None = None,
      *,
      lhs: "MaybeWeighted" | int | None = None,
      rhs: "MaybeWeighted" | int | None = None,
      operation: Callable[
          [int_or_int_dict, int_or_int_dict], int_or_int_dict
      ]
      | None = None,
  ):
      if operation is None:
          if not isinstance(value, (int, dict)):
              raise TypeError(f"Unsupported value type: {type(value)}")
      self.value = value
      self.lhs = lhs
      self.rhs = rhs
      self.operation = operation
  
imports: from __future__ import annotations
  import operator
  from typing import Callable, Iterator, TypeVar, Any, Optional, Tuple, Union, List, Dict, Generic, cast
  import numpy
  import torch
label_desc: Use image node_id 1 to create a new MaybeWeighted object  with example: obj = MaybeWeighted(value)