code: def test_nested_implementation(self):
      child_predicate = MagicMock()
      root_predicate = MagicMock()
      with patch(
          "evadb.optimizer.rules.rules.extract_pushdown_predicate"
      ) as mock:
          with patch(
              "evadb.optimizer.rules.rules.is_video_table"
          ) as mock_vid:
              mock_vid.return_value = True
              mock.side_effect = [
                  (child_predicate, None),
                  (root_predicate, None),
              ]
  
              child_get_opr = LogicalGet(
                  MagicMock(), MagicMock(), MagicMock()
              )
              child_filter_opr = LogicalFilter(
                  child_predicate, children=[child_get_opr]
              )
              child_project_opr = LogicalProject(
                  [MagicMock()], children=[child_filter_opr]
              )
              root_derived_get_opr = LogicalQueryDerivedGet(
                  MagicMock(), children=[child_project_opr]
              )
              root_filter_opr = LogicalFilter(
                  root_predicate, children=[root_derived_get_opr]
              )
              root_project_opr = LogicalProject(
                  [MagicMock()], children=[root_filter_opr]
              )
  
              opt_cxt, root_grp_id = self.top_down_rewrite(
                  root_project_opr
              )
              opt_cxt, root_grp_id = self.bottom_up_rewrite(
                  root_grp_id, opt_cxt
              )
              opt_cxt, root_grp_id = self.implement_group(
                  root_grp_id, opt_cxt
              )
  
              expected_expr_order = [
                  ProjectPlan,
                  PredicatePlan,
                  SeqScanPlan,
                  ProjectPlan,
                  SeqScanPlan,
              ]
              curr_grp_id = root_grp_id
              idx = 0
              while True:
                  root_grp = opt_cxt.memo.groups[curr_grp_id]
                  best_root_grp_expr = root_grp.get_best_expr(
                      PropertyType.DEFAULT
                  )
                  self.assertEqual(
                      type(best_root_grp_expr.opr),
                      expected_expr_order[idx],
                  )
                  idx += 1
                  if idx == len(expected_expr_order):
                      break
                  curr_grp_id = best_root_grp_expr.children[0]
  
imports: import unittest
  from unittest.mock import patch
  from mock import MagicMock
  from evadb.optimizer.cost_model import CostModel
  from evadb.optimizer.operators import LogicalFilter, LogicalGet, LogicalProject, LogicalQueryDerivedGet
  from evadb.optimizer.optimizer_context import OptimizerContext
  from evadb.optimizer.optimizer_tasks import BottomUpRewrite, OptimizeGroup, OptimizerTask, TopDownRewrite
  from evadb.optimizer.property import PropertyType
  from evadb.optimizer.rules.rules_manager import RulesManager
  from evadb.plan_nodes.predicate_plan import PredicatePlan
  from evadb.plan_nodes.project_plan import ProjectPlan
  from evadb.plan_nodes.seq_scan_plan import SeqScanPlan
label_desc: Use image node_id 7 for calling the TestOptimizerTask obj's underlying member method code with example usage: obj.test_nested_implementation() without return types