code: def test_size():
      tree = BinaryBranch(
          BinaryBranch(
              BinaryBranch(BinaryBranch(Leaf(), Leaf()), Leaf()),
              BinaryBranch(Leaf(), Leaf()),
          ),
          BinaryBranch(Leaf(), Leaf()),
      )
  
      assert tree.n_nodes == tree.n_branches + tree.n_leaves == 6 + 7
      assert (
          tree.children[0].n_nodes
          == tree.children[0].n_branches + tree.children[0].n_leaves
          == 4 + 5
      )
      assert (
          tree.children[1].n_nodes
          == tree.children[1].n_branches + tree.children[1].n_leaves
          == 1 + 2
      )
      assert (
          tree.children[1].children[0].n_nodes
          == tree.children[1].children[0].n_branches
          + tree.children[1].children[0].n_leaves
          == 0 + 1
      )
  
file_path: river/river/tree/test_base.py
imports: from __future__ import annotations
  from river.tree.base import Branch, Leaf
label_desc: Use image node_id 1 for calling a global function with example usage: test_size() without return types