code: def test_dataset_conversation_chain_is_correct(
      df_with_conversation_chain_ids,
  ):
      cfg = ConfigProblemBase(
          dataset=ConfigDPODataset(
              prompt_column=("prompt_column",),
              answer_column="answer_column",
              rejected_answer_column="rejected_answer_column",
              parent_id_column="parent_id_column",
          )
      )
      dataset = CustomDataset(
          df_with_conversation_chain_ids, cfg, mode="train"
      )
  
      # Check for right formatting, e.g.:
      # dataset.conversation_chain_handler_chosen[0] ==
      # {
      #     "prompts": ["prompt 1", "prompt 2", "prompt 3", "prompt 4", "prompt 5"],
      #     "answers": [
      #         "response 1",
      #         "response 2",
      #         "response 3",
      #         "response 4",
      #         "chosen_response 5",
      #     ],
      #     "systems": ["", "", "", "", ""],
      # }
  
      for idx in range(200 // 5):
          for name, conversation_chain_handler in zip(
              ["chosen", "rejected"],
              [
                  dataset.conversation_chain_handler,
                  dataset.conversation_chain_handler_rejected,
              ],
          ):
              input_text_dict = conversation_chain_handler[idx]
              expected = {
                  "prompts": [
                      f"prompt {i + 1}"
                      for i in range(idx * 5, (idx + 1) * 5)
                  ],
                  "answers": [
                      f"response {i + 1}"
                      for i in range(idx * 5, (idx + 1) * 5 - 1)
                  ]
                  + [f"{name}_response {idx * 5 + 5}"],
                  "systems": [""] * 5,
              }
  
              for key in expected:
                  assert input_text_dict[key] == expected[key], (
                      input_text_dict[key],
                      expected[key],
                      name,
                  )
  
file_path: h2o-llmstudio/tests/src/datasets/test_text_dpo_modeling_ds.py
imports: import numpy
  import pandas
  import pytest
  import torch
  from tqdm import tqdm
  from llm_studio.python_configs.text_causal_language_modeling_config import ConfigNLPCausalLMTokenizer
  from llm_studio.python_configs.text_dpo_modeling_config import ConfigDPODataset, ConfigProblemBase
  from llm_studio.src.datasets.text_dpo_modeling_ds import CustomDataset
label_desc: Use image node_id 3 for calling a global function with example usage: test_dataset_conversation_chain_is_correct(df_with_conversation_chain_ids) without return types