code: def test_prepare_for_training_with_spacy(self, request, records):
      records = request.getfixturevalue(records)
  
      ds = DatasetForTextClassification(records)
      with pytest.raises(ValueError):
          train = ds.prepare_for_training(framework="spacy", seed=42)
      nlp = spacy.blank("en")
      doc_bin = ds.prepare_for_training(
          framework="spacy", lang=nlp, seed=42
      )
  
      assert isinstance(doc_bin, spacy.tokens.DocBin)
      docs = list(doc_bin.get_docs(nlp.vocab))
      assert len(docs) == 2
  
      if records[0].multi_label:
          assert set(list(docs[0].cats.keys())) == set(["a", "b"])
      else:
          assert isinstance(docs[0].cats, dict)
  
      train, test = ds.prepare_for_training(
          train_size=0.5, framework="spacy", lang=nlp, seed=42
      )
      docs_train = list(train.get_docs(nlp.vocab))
      docs_test = list(train.get_docs(nlp.vocab))
      assert len(list(docs_train)) == 1
      assert len(list(docs_test)) == 1
      assert "id" in docs_train[0].user_data
      assert "id" in docs_test[0].user_data
  
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 8 for calling the TestDatasetForTextClassification obj's underlying member method code with example usage: obj.test_prepare_for_training_with_spacy(request, records) without return types