class_docstr: Maintain context information for the optimizer
  
  Arguments:
      _task_queue(OptimizerTaskStack):
          stack to keep track outstanding tasks
class_docstr_tok: ["Maintain","context","information","for","the","optimizer","Arguments",":","_task_queue","(","OptimizerTaskStack",")",":","stack","to","keep","track","outstanding","tasks"]
docstr: Removes all the expressions from the specified group and
  create a new expression. This is called by rewrite rules. The
  new expr gets assigned a new group id
docstr_tok: ["Removes","all","the","expressions","from","the","specified","group","and","create","a","new","expression",".","This","is","called","by","rewrite","rules",".","The","new","expr","gets","assigned","a","new","group","id"]
code: def replace_expression(self, opr: Operator, group_id: int):
      """
      Removes all the expressions from the specified group and
      create a new expression. This is called by rewrite rules. The
      new expr gets assigned a new group id
      """
      self.memo.erase_group(group_id)
      new_expr = self._xform_opr_to_group_expr(opr)
      new_expr = self.memo.add_group_expr(new_expr, group_id)
      return new_expr
  
file_path: evadb/evadb/optimizer/optimizer_context.py
imports: import copy
  from evadb.constants import UNDEFINED_GROUP_ID
  from evadb.database import EvaDBDatabase
  from evadb.optimizer.cost_model import CostModel
  from evadb.optimizer.group_expression import GroupExpression
  from evadb.optimizer.memo import Memo
  from evadb.optimizer.operators import Dummy, Operator
  from evadb.optimizer.optimizer_task_stack import OptimizerTaskStack
  from evadb.optimizer.rules.rules_manager import RulesManager
label_desc: Use image node_id 8 for calling the OptimizerContext obj's underlying member method code with example usage: obj.replace_expression(opr, group_id) and returns: new_expr