class_docstr: For now, we assume every group has only one logic expression.
class_docstr_tok: ["For","now",",","we","assume","every","group","has","only","one","logic","expression","."]
docstr: Add an expression into the memo.
  If expr exists, we return it.
  If group_id is not specified, creates a new group
  Otherwise, inserts the expr into specified group.
docstr_tok: ["Add","an","expression","into","the","memo",".","If","expr","exists",",","we","return","it",".","If","group_id","is","not","specified",",","creates","a","new","group","Otherwise",",","inserts","the","expr","into","specified","group","."]
code: def add_group_expr(
      self, expr: GroupExpression, group_id: int = UNDEFINED_GROUP_ID
  ) -> GroupExpression:
      """
      Add an expression into the memo.
      If expr exists, we return it.
      If group_id is not specified, creates a new group
      Otherwise, inserts the expr into specified group.
      """
      # check duplicate expression
      duplicate_expr = self.find_duplicate_expr(expr)
      if duplicate_expr is not None:
          return duplicate_expr
  
      # did not find a duplicate expression
      expr.group_id = group_id
  
      if expr.group_id == UNDEFINED_GROUP_ID:
          self._create_new_group(expr)
      else:
          self._insert_expr(expr, group_id)
  
      assert (
          expr.group_id is not UNDEFINED_GROUP_ID
      ), """Expr should have a valid group id"""
      return expr
  
file_path: evadb/evadb/optimizer/memo.py
imports: from typing import Dict, List
  from evadb.constants import UNDEFINED_GROUP_ID
  from evadb.optimizer.group import Group
  from evadb.optimizer.group_expression import GroupExpression
  from evadb.optimizer.operators import OperatorType
  from evadb.utils.logging_manager import logger
label_desc: Use image node_id 10 for calling the Memo obj's underlying member method code with example usage: obj.add_group_expr(expr, group_id) and returns: expr, duplicate_expr