code: def _to_float_array(v: List[Any]) -> np.ndarray:
      arr = np.array(v)
      if arr.dtype == np.float64:
          return arr.astype(np.float32)  # save some memory
      return arr
  
imports: import collections
  import logging
  import numpy
  from typing import List, Any, Dict, Optional, TYPE_CHECKING
  from ray.rllib.env.base_env import _DUMMY_AGENT_ID
  from ray.rllib.evaluation.episode import Episode
  from ray.rllib.policy.policy import Policy
  from ray.rllib.policy.sample_batch import SampleBatch, MultiAgentBatch
  from ray.rllib.utils.annotations import DeveloperAPI
  from ray.rllib.utils.deprecation import Deprecated
  from ray.rllib.utils.debug import summarize
  from ray.rllib.utils.deprecation import deprecation_warning
  from ray.rllib.utils.typing import PolicyID, AgentID
  from ray.util.debug import log_once
label_desc: Use image node_id 1 for calling a global function with example usage: _to_float_array(v) and returns: arr, arr