code: def get_optimization_result(
      self,
      original_entity: EntityType,
      default: Optional[EntityType] = None,
  ) -> EntityType:
      entity = original_entity
      if entity not in self._original_entity_to_records:
          return default
      while entity in self._original_entity_to_records:
          record = self._original_entity_to_records[entity]
          if record.record_type == OptimizationRecordType.replace:
              entity = record.new_entity
          else:
              assert record.record_type == OptimizationRecordType.delete
              return None
      return entity
  
imports: import functools
  import weakref
  from abc import ABC, abstractmethod
  from collections import defaultdict
  from dataclasses import dataclass
  from enum import Enum
  from typing import Dict, List, Optional, Type, Set
  from ...core import OperandType, EntityType, enter_mode
  from ...core.graph import EntityGraph
  from ...utils import implements
label_desc: Use image node_id 3 for calling the OptimizationRecords obj's underlying member method code with example usage: obj.get_optimization_result(original_entity, default) and returns: entity, default, None