code: def twenty_news_text(
      n, num_classes=10, subset="train", multi_label=False
  ):
      train = fetch_20newsgroups(subset=subset)
      x = train.data[:n]
      if multi_label:
          y = list_to_csr(
              [
                  np.sort(
                      random_labeling(num_classes, multi_label)
                  ).tolist()
                  for _ in range(n)
              ],
              (n, num_classes),
          )
      else:
          y = np.random.randint(0, num_classes, size=n)
      y = assure_all_labels_occur_numpy(
          y, num_classes, multi_label=multi_label
      )
      return TextDataset(x, y)
  
imports: import string
  import numpy
  from collections import Counter
  from scipy import sparse
  from sklearn.datasets import fetch_20newsgroups
  from small_text.data.datasets import SklearnDataset, TextDataset
  from small_text.data.sampling import _get_class_histogram
  from small_text.utils.labels import csr_to_list, list_to_csr
label_desc: Use image node_id 13 for calling a global function with example usage: twenty_news_text(n, num_classes, subset, multi_label) and returns: TextDataset