code: def test_simulator_first_step():
      order = get_order()
      simulator = get_simulator(order)
      state = simulator.get_state()
      assert state.cur_time == pd.Timestamp("2019-03-04 09:30:00")
      assert state.position == TOTAL_POSITION
  
      AMOUNT = 300.0
      simulator.step(AMOUNT)
      state = simulator.get_state()
      assert state.cur_time == pd.Timestamp("2019-03-04 10:00:00")
      assert state.position == TOTAL_POSITION - AMOUNT
      assert len(state.history_exec) == 30
      assert state.history_exec.index[0] == pd.Timestamp(
          "2019-03-04 09:30:00"
      )
  
      assert is_close(
          state.history_exec["market_volume"].iloc[0], 109382.382812
      )
      assert is_close(
          state.history_exec["market_price"].iloc[0], 149.566483
      )
      assert (state.history_exec["amount"] == AMOUNT / 30).all()
      assert (state.history_exec["deal_amount"] == AMOUNT / 30).all()
      assert is_close(
          state.history_exec["trade_price"].iloc[0], 149.566483
      )
      assert is_close(
          state.history_exec["trade_value"].iloc[0], 1495.664825
      )
      assert is_close(
          state.history_exec["position"].iloc[0],
          TOTAL_POSITION - AMOUNT / 30,
      )
      assert is_close(
          state.history_exec["ffr"].iloc[0],
          AMOUNT / TOTAL_POSITION / 30,
      )
  
      assert is_close(
          state.history_steps["market_volume"].iloc[0],
          1254848.5756835938,
      )
      assert state.history_steps["amount"].iloc[0] == AMOUNT
      assert state.history_steps["deal_amount"].iloc[0] == AMOUNT
      assert (
          state.history_steps["ffr"].iloc[0] == AMOUNT / TOTAL_POSITION
      )
      assert is_close(
          state.history_steps["pa"].iloc[0]
          * (1.0 if order.direction == OrderDir.SELL else -1.0),
          (
              state.history_steps["trade_price"].iloc[0]
              / simulator.twap_price
              - 1
          )
          * 10000,
      )
  
file_path: qlib/tests/rl/test_qlib_simulator.py
imports: import sys
  from pathlib import Path
  from typing import Tuple
  import pandas
  import pytest
  from qlib.backtest.decision import Order, OrderDir
  from qlib.backtest.executor import SimulatorExecutor
  from qlib.rl.order_execution import CategoricalActionInterpreter
  from qlib.rl.order_execution.simulator_qlib import SingleAssetOrderExecution
label_desc: Use image node_id 5 for calling a global function with example usage: test_simulator_first_step() without return types