code: def _set_binary_at(
      base, name: str, op: Callable[[Any, Any, Any], Any]
  ) -> None:
      def fn(self, other):
          if isinstance(other, ω):
              if jtu.tree_structure(self.value) != jtu.tree_structure(
                  other.ω
              ):
                  raise ValueError("PyTree structures must match.")
              if not _equal_code(self.is_leaf, other.is_leaf):
                  raise ValueError("is_leaf specifications must match.")
              return ω(
                  jtu.tree_map(
                      lambda x, y: op(x, self.item, y),
                      self.value,
                      other.ω,
                      is_leaf=self.is_leaf,
                  ),
                  is_leaf=self.is_leaf,
              )
          elif isinstance(
              other, (bool, complex, float, int, jax.Array)
          ):
              return ω(
                  jtu.tree_map(
                      lambda x: op(x, self.item, other),
                      self.value,
                      is_leaf=self.is_leaf,
                  ),
                  is_leaf=self.is_leaf,
              )
          else:
              raise RuntimeError("Type of `other` not understood.")
  
      fn.__name__ = name
      fn.__qualname__ = base.__qualname__ + "." + name
      setattr(base, name, fn)
  
imports: import operator
  from collections.abc import Callable
  from typing import Any, Optional, TYPE_CHECKING
  import jax
  import jax.tree_util
label_desc: Use image node_id 5 for calling a global function with example usage: _set_binary_at(base, name, op) and returns: ω, ω