code: def random_matrix_data(
      matrix_type,
      label_type,
      num_samples=100,
      num_dimension=40,
      num_labels=2,
  ):
      if matrix_type == "dense":
          x = np.random.rand(num_samples, num_dimension)
      elif matrix_type == "sparse":
          x = sparse.random(
              num_samples, num_dimension, density=0.15, format="csr"
          )
      else:
          raise ValueError(f"Invalid matrix_type: {matrix_type}")
  
      if label_type == "dense":
          y = np.random.randint(0, high=num_labels, size=x.shape[0])
      elif label_type == "sparse":
          y = sparse.random(
              num_samples, num_labels, density=0.5, format="csr"
          )
          y.data[np.s_[:]] = 1
          y = y.astype(int)
      else:
          raise ValueError(f"Invalid label_type: {label_type}")
  
      return 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 1 for calling a global function with example usage: random_matrix_data(matrix_type, label_type, num_samples, num_dimension, num_labels) and returns: x,  y