code: def test_to_from_datasets(self, records, request):
      records = request.getfixturevalue(records)
      expected_dataset = DatasetForTextClassification(records)
  
      expected_dataset.prepare_for_training(train_size=0.5)
      dataset_ds = expected_dataset.to_datasets()
  
      assert isinstance(dataset_ds, datasets.Dataset)
  
      assert dataset_ds.column_names == [
          "text",
          "inputs",
          "prediction",
          "prediction_agent",
          "annotation",
          "annotation_agent",
          "vectors",
          "multi_label",
          "explanation",
          "id",
          "metadata",
          "status",
          "event_timestamp",
          "metrics",
      ]
      assert dataset_ds.features["prediction"] == [
          {
              "label": datasets.Value("string"),
              "score": datasets.Value("float64"),
          }
      ]
  
      dataset = DatasetForTextClassification.from_datasets(dataset_ds)
  
      assert isinstance(dataset, DatasetForTextClassification)
      _compare_datasets(dataset, expected_dataset)
  
      missing_optional_cols = datasets.Dataset.from_dict(
          {"inputs": ["mock"]}
      )
      rec = DatasetForTextClassification.from_datasets(
          missing_optional_cols
      )[0]
      assert rec.inputs == {"text": "mock"}
  
imports: import copy
  import os
  import sys
  from time import sleep
  import datasets
  import pandas
  import pytest
  import spacy
  from argilla.client.datasets import DatasetBase, DatasetForText2Text, DatasetForTextClassification, DatasetForTokenClassification, WrongRecordTypeError, read_datasets, read_pandas
  from argilla.client.models import Text2TextRecord, TextClassificationRecord, TokenClassificationRecord
  from argilla.datasets import TextClassificationSettings
label_desc: Use image node_id 2 for calling the TestDatasetForTextClassification obj's underlying member method code with example usage: obj.test_to_from_datasets(records, request) without return types