code: def test_should_select_cheap_plan(self):
      # mocking the cost model
      def side_effect_func(value):
          if value is grp_expr1:
              return 1
          elif value is grp_expr2:
              return 2
  
      cm = CostModel()
      cm.calculate_cost = MagicMock(side_effect=side_effect_func)
      opt_cxt = OptimizerContext(MagicMock(), cm)
  
      grp_expr1 = GroupExpression(MagicMock())
      grp_expr1.opr.is_logical = lambda: False
  
      grp_expr2 = GroupExpression(MagicMock())
      grp_expr2.opr.is_logical = lambda: False
      opt_cxt.memo.add_group_expr(grp_expr1)
      opt_cxt.memo.add_group_expr(grp_expr2, grp_expr1.group_id)
      grp = opt_cxt.memo.get_group_by_id(grp_expr1.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_expr1.group_id, opt_cxt
      )
      self.assertEqual(plan, grp_expr1.opr)
      self.assertEqual(grp.get_best_expr_cost(PropertyType.DEFAULT), 1)
  
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 2 for calling the CostModel obj's underlying member method code with example usage: obj.test_should_select_cheap_plan() and returns: int, int