code: def top_down_rewrite(self, opr):
      opt_cxt = OptimizerContext(
          MagicMock(), CostModel(), RulesManager()
      )
      grp_expr = opt_cxt.add_opr_to_group(opr)
      root_grp_id = grp_expr.group_id
      opt_cxt.task_stack.push(
          TopDownRewrite(
              grp_expr, RulesManager().stage_one_rewrite_rules, opt_cxt
          )
      )
      self.execute_task_stack(opt_cxt.task_stack)
      return opt_cxt, root_grp_id
  
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 3 for calling the TestOptimizerTask obj's underlying member method code with example usage: obj.top_down_rewrite(opr) and returns: opt_cxt,  root_grp_id