code: def get_simulator_executor(
      executor: BaseExecutor,
  ) -> SimulatorExecutor:
      while isinstance(executor, NestedExecutor):
          executor = executor.inner_executor
      assert isinstance(executor, SimulatorExecutor)
      return executor
  
file_path: qlib/qlib/rl/order_execution/utils.py
imports: from __future__ import annotations
  from typing import Any, cast
  import numpy
  import pandas
  from qlib.backtest.decision import OrderDir
  from qlib.backtest.executor import BaseExecutor, NestedExecutor, SimulatorExecutor
  from qlib.constant import float_or_ndarray
label_desc: Use image node_id 3 for calling a global function with example usage: get_simulator_executor(executor) and returns: executor