code: def add_rules(self, rules: List[Rule]):
      def _add_to_list(rule_list, rule_to_remove):
          if any(
              [
                  rule.rule_type != rule_to_remove.rule_type
                  for rule in rule_list
              ]
          ):
              rule_list.append(rule)
  
      for rule in rules:
          assert (
              rule.is_implementation_rule()
              or rule.is_stage_one_rewrite_rules()
              or rule.is_stage_two_rewrite_rules()
              or rule.is_logical_rule()
          ), f"Provided Invalid rule {rule}"
  
          if rule.is_implementation_rule():
              _add_to_list(self.implementation_rules, rule)
          elif rule.is_stage_one_rewrite_rules():
              _add_to_list(self.stage_one_rewrite_rules, rule)
          elif rule.is_stage_two_rewrite_rules():
              _add_to_list(self.stage_two_rewrite_rules, rule)
          elif rule.is_logical_rule():
              _add_to_list(self.logical_rules, rule)
  
file_path: evadb/evadb/optimizer/rules/rules_manager.py
imports: from __future__ import annotations
  from contextlib import contextmanager
  from typing import List
  from evadb.optimizer.rules.rules import CacheFunctionExpressionInApply, CacheFunctionExpressionInFilter, CacheFunctionExpressionInProject, CombineSimilarityOrderByAndLimitToVectorIndexScan, EmbedFilterIntoGet, EmbedSampleIntoGet, LogicalApplyAndMergeToPhysical, LogicalApplyAndMergeToRayPhysical, LogicalCreateFromSelectToPhysical, LogicalCreateFunctionFromSelectToPhysical, LogicalCreateFunctionToPhysical, LogicalCreateIndexToVectorIndex, LogicalCreateToPhysical, LogicalDeleteToPhysical, LogicalDerivedGetToPhysical, LogicalDropObjectToPhysical, LogicalExchangeToPhysical, LogicalExplainToPhysical, LogicalFilterToPhysical, LogicalFunctionScanToPhysical, LogicalGetToSeqScan, LogicalGroupByToPhysical, LogicalInnerJoinCommutativity, LogicalInsertToPhysical, LogicalJoinToPhysicalHashJoin, LogicalJoinToPhysicalNestedLoopJoin, LogicalLateralJoinToPhysical, LogicalLimitToPhysical, LogicalLoadToPhysical, LogicalOrderByToPhysical, LogicalProjectNoTableToPhysical, LogicalProjectToPhysical, LogicalProjectToRayPhysical, LogicalRenameToPhysical, LogicalShowToPhysical, LogicalUnionToPhysical, LogicalVectorIndexScanToPhysical, PushDownFilterThroughApplyAndMerge, PushDownFilterThroughJoin, ReorderPredicates, XformExtractObjectToLinearFlow, XformLateralJoinToLinearFlow
  from evadb.optimizer.rules.rules_base import Rule
  from evadb.utils.generic_utils import is_ray_enabled_and_installed
label_desc: Use image node_id 7 for calling the RulesManager obj's underlying member method code with example usage: obj.add_rules(rules) without return types