code: def test_oasst_conversation_chain_handler(tmp_path):
      """
      Test conversation chain handler on default OASST dataset.
      """
  
      df = prepare_default_dataset_causal_language_modeling(tmp_path)
      cfg = mock.MagicMock()
      cfg.dataset.prompt_column = "instruction"
      cfg.dataset.answer_column = "output"
      cfg.dataset.parent_id_column = "parent_id"
      cfg.dataset.system_column = "None"
  
      for limit_chained_samples in [False, True]:
          cfg.dataset.limit_chained_samples = limit_chained_samples
          conversation_chain_handler = ConversationChainHandler(
              df, cfg=cfg
          )
          for (
              conversation_chain_ids
          ) in conversation_chain_handler.conversation_chain_ids:
              parent_idx = conversation_chain_ids[0]
              for idx in conversation_chain_ids[1:]:
                  df.loc[idx, "parent_id"] = parent_idx
                  parent_idx = idx
  
      # explicit example of a chained conversation
      cfg.dataset.limit_chained_samples = True
      conversation_chain_handler = ConversationChainHandler(df, cfg=cfg)
  
      prompts = [
          "I am building a mechanical keyboard from scratch. I already have the working hardware and am in the process of configuring the firmware. However i find that the qwertz layout gives me wrist pain. I will use the keyboard for writing in english, german and french, and for coding mainly.\nWhat keyboard layout would be best suited for me?",  # noqa: E501
          "what is the advantage of BvoFrak and Bépo, over Azerty that is more common in France.",  # noqa: E501
          "Is there any information on how long it takes a typical person to adopt the BvoFrak or Bépo layouts? I worry that the time investment may be a concern, or that I may  make more mistakes when programming during the transition period.",  # noqa: E501
      ]
      answers = [
          "Generally, it seems that Neo layout may be what you are looking for.\nHere are some keyboard layouts for various use cases: \nFor French: BvoFrak, Bépo\nFor German: Neo, AdNW\nFor English: DHIATENSOR, Dvorak,\nFor programing: Programmer Dvorak, Evolved, Capewell, QGMLWY, Arensito\nNote that while layout may contribute to wrist pain, other factors like the angle of the keyboard, key spacing (vertical, horizontal, and depth), more may also be contributing factors. Learning a new layout takes time and effort, and may make it more difficult to type on other keyboards.",  # noqa: E501
          "BvoFrak and Bépo are alternative French keyboard layouts that aim to improve on the traditional Azerty layout. Some of the claimed advantages include:\n\n- BvoFrak aims to minimize finger movement and optimize typing efficiency. It groups letters by finger positions rather than alphabetic order.\n- Bépo aims to allow for faster typing of common French letters and letter combinations. It also groups letters by finger positions and makes some other rearrangements to commonly used keys.\n- Both BvoFrak and Bépo proponents argue that Azerty is inefficient and optimized for typewriters, not modern keyboards and typing. However, Azerty is deeply entrenched and the alternative layouts have not achieved widespread adoption.\n\nSo the potential advantages are increased typing efficiency and comfort, but the alternative layouts have to overcome the momentum of the established Azerty layout. Whether the claimed advantages hold up in practice for most typists is unclear without much broader adoption of the alternative layouts.",  # noqa: E501
          "The time it takes to learn a new keyboard layout can vary depending on several factors, including the individual's previous typing experience and the amount of time they can devote to practice. However, on average, it can take between 2-4 weeks to become proficient in a new keyboard layout.\n\nDuring the transition period, it's natural to make more mistakes when typing, especially when programming or using special characters. It's important to be patient with yourself and allow yourself time to adjust to the new layout. With practice, the new layout will become more natural and comfortable to use, and the speed and accuracy of your typing will improve.\n\nUltimately, the investment of time and effort required to learn a new keyboard layout is a personal decision, and it's important to consider the potential benefits and drawbacks before making a decision. While there may be some initial challenges, many people find that the improved ergonomics and efficiency of a new keyboard layout make the investment well worth it in the long run.",  # noqa: E501
      ]
      systems = ["", "", ""]
      sample = conversation_chain_handler[
          842
      ]  # 842 == first sample with 3 round conversation
      assert sample["prompts"] == prompts
      assert sample["answers"] == answers
      assert sample["systems"] == systems
  
file_path: h2o-llmstudio/tests/src/datasets/test_conversation_chain_handler.py
imports: import time
  from unittest import mock
  from unittest.mock import MagicMock
  import pandas
  import pytest
  from llm_studio.app_utils.default_datasets import prepare_default_dataset_causal_language_modeling
  from llm_studio.src.datasets.conversation_chain_handler import ConversationChainHandler
label_desc: Use image node_id 11 for calling a global function with example usage: test_oasst_conversation_chain_handler(tmp_path) without return types