class_docstr: Base class to define any optimization rule
  
  Arguments:
      rule_type(RuleType): type of the rule, can be rewrite,
          logical->physical
      pattern: the match pattern for the rule
docstr: Check whether the rule is applicable for the input_expr
  
  Args:
      before (Operator): the before operator expression
  
  Returns:
      bool: If the rule is applicable, return true, else false
docstr_tok: ["Check","whether","the","rule","is","applicable","for","the","input_expr","Args",":","before","(","Operator",")",":","the","before","operator","expression","Returns",":","bool",":","If","the","rule","is","applicable",",","return","true",",","else","false"]
code: def check(self, before: Operator, context: OptimizerContext) -> bool:
      """Check whether the rule is applicable for the input_expr
  
      Args:
          before (Operator): the before operator expression
  
      Returns:
          bool: If the rule is applicable, return true, else false
      """
      raise NotImplementedError
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from enum import Flag, IntEnum, auto
  from typing import TYPE_CHECKING
  from evadb.optimizer.operators import Operator
label_desc: Use image node_id 10 for calling the Rule obj's underlying member method code with example usage: obj.check(before, context) without return types