code: def _to_float_np_array(v: List[Any]) -> np.ndarray:
      if torch and torch.is_tensor(v[0]):
          raise ValueError
      arr = np.array(v)
      if arr.dtype == np.float64:
          return arr.astype(np.float32)  # save some memory
      return arr
  
imports: import copy
  import logging
  import math
  from typing import Any, Dict, List, Optional
  import numpy
  import tree
  from gymnasium.spaces import Space
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy.view_requirement import ViewRequirement
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.spaces.space_utils import flatten_to_single_ndarray, get_dummy_batch_for_space
  from ray.rllib.utils.typing import EpisodeID, EnvID, TensorType, ViewRequirementsDict
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 1 for calling a global function with example usage: _to_float_np_array(v) and returns: arr, arr