code: def _convert_to_batch(dataset: Dict) -> SampleBatchType:
      # Converts D4RL dataset to SampleBatch
      d = {}
      d[SampleBatch.OBS] = dataset["observations"]
      d[SampleBatch.ACTIONS] = dataset["actions"]
      d[SampleBatch.NEXT_OBS] = dataset["next_observations"]
      d[SampleBatch.REWARDS] = dataset["rewards"]
      d[SampleBatch.TERMINATEDS] = dataset["terminals"]
  
      return SampleBatch(d)
  
file_path: ray/python/ray/rllib/offline/d4rl_reader.py
imports: import logging
  import gymnasium
  from ray.rllib.offline.input_reader import InputReader
  from ray.rllib.offline.io_context import IOContext
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils.annotations import override, PublicAPI
  from ray.rllib.utils.typing import SampleBatchType
  from typing import Dict
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_to_batch(dataset) and returns: SampleBatch