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: Note: Internal function Generate a group expressions from a
  logical operator tree. Caller is responsible for assigning
  the group to the returned GroupExpression.
docstr_tok: ["Note",":","Internal","function","Generate","a","group","expressions","from","a","logical","operator","tree",".","Caller","is","responsible","for","assigning","the","group","to","the","returned","GroupExpression","."]
code: def _xform_opr_to_group_expr(self, opr: Operator) -> GroupExpression:
      """
      Note: Internal function Generate a group expressions from a
      logical operator tree. Caller is responsible for assigning
      the group to the returned GroupExpression.
      """
      # Go through the children first.
      child_ids = []
      for child_opr in opr.children:
          if isinstance(child_opr, Dummy):
              child_ids.append(child_opr.group_id)
          else:
              child_expr = self._xform_opr_to_group_expr(opr=child_opr)
              # add the expr to memo
              # handles duplicates and assigns group id
              memo_expr = self.memo.add_group_expr(child_expr)
              child_ids.append(memo_expr.group_id)
  
      # Group Expression only needs the operator content. Remove
      # the opr children as parent-child relationship is captured
      # by the group expressions.
      # Hack: Shallow copy all the content except children and
      # manually clearing the children as we don't need the
      # dependency. Better fix is to rewrite the operator class to
      # support  exposing only the content
      opr_copy = copy.copy(opr)
      opr_copy.clear_children()
      expr = GroupExpression(opr=opr_copy, children=child_ids)
      return 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 7 for calling the OptimizerContext obj's underlying member method code with example usage: obj._xform_opr_to_group_expr(opr) and returns: expr