code: def test_should_select_cheap_plan_with_tree(self):
      # mocking the cost model
      def side_effect_func(value):
          cost = dict(
              {
                  grp_expr00: 1,
                  grp_expr01: 2,
                  grp_expr10: 4,
                  grp_expr11: 3,
                  grp_expr20: 5,
              }
          )
          return cost[value]
  
      cm = CostModel()
      cm.calculate_cost = MagicMock(side_effect=side_effect_func)
      opt_cxt = OptimizerContext(MagicMock(), cm)
  
      # group 0
      grp_expr00 = GroupExpression(Operator(MagicMock()))
      grp_expr00.opr.is_logical = lambda: False
      grp_expr01 = GroupExpression(Operator(MagicMock()))
      grp_expr01.opr.is_logical = lambda: False
      opt_cxt.memo.add_group_expr(grp_expr00)
      opt_cxt.memo.add_group_expr(grp_expr01, grp_expr00.group_id)
  
      # group 1
      grp_expr10 = GroupExpression(Operator(MagicMock()))
      grp_expr10.opr.is_logical = lambda: False
      opt_cxt.memo.add_group_expr(grp_expr10)
      grp_expr11 = GroupExpression(Operator(MagicMock()))
      grp_expr11.opr.is_logical = lambda: False
      opt_cxt.memo.add_group_expr(grp_expr11, grp_expr10.group_id)
  
      # group 2
      grp_expr20 = GroupExpression(Operator(MagicMock()))
      grp_expr20.opr.is_logical = lambda: False
      opt_cxt.memo.add_group_expr(grp_expr20)
      grp = opt_cxt.memo.get_group_by_id(grp_expr20.group_id)
  
      # tree:  2->1->0
      grp_expr10.children = [grp_expr01.group_id]
      grp_expr11.children = [grp_expr01.group_id]
      grp_expr20.children = [grp_expr10.group_id]
  
      opt_cxt.task_stack.push(OptimizeGroup(grp, opt_cxt))
      self.execute_task_stack(opt_cxt.task_stack)
      plan = PlanGenerator(MagicMock()).build_optimal_physical_plan(
          grp_expr20.group_id, opt_cxt
      )
      subplan = copy(grp_expr11.opr)
      subplan.children = [copy(grp_expr01.opr)]
      expected_plan = copy(grp_expr20.opr)
      expected_plan.children = [subplan]
  
      self.assertEqual(plan, expected_plan)
      self.assertEqual(grp.get_best_expr_cost(PropertyType.DEFAULT), 9)
  
file_path: evadb/test/unit_tests/optimizer/test_cost_model.py
imports: import unittest
  from copy import copy
  from mock import MagicMock
  from evadb.optimizer.group_expression import GroupExpression
  from evadb.optimizer.operators import Operator
  from evadb.optimizer.optimizer_context import OptimizerContext
  from evadb.optimizer.optimizer_tasks import OptimizeGroup
  from evadb.optimizer.plan_generator import PlanGenerator
  from evadb.optimizer.property import PropertyType
label_desc: Use image node_id 3 for calling the CostModel obj's underlying member method code with example usage: obj.test_should_select_cheap_plan_with_tree() and returns: cost