class_docstr: Abstract data generator.
class_docstr_tok: ["Abstract","data","generator","."]
docstr: Convert a scipy matrix into indices, data, and shape.
  
  Args:
      array_of_sparse: The sparse data array.
  
  Returns:
      A list of dense numpy arrays representing the sparse data.
docstr_tok: ["Convert","a","scipy","matrix","into","indices",",","data",",","and","shape",".","Args",":","array_of_sparse",":","The","sparse","data","array",".","Returns",":","A","list","of","dense","numpy","arrays","representing","the","sparse","data","."]
code: def _scipy_matrix_to_values(
      array_of_sparse: FeatureArray,
  ) -> List[np.ndarray]:
      """Convert a scipy matrix into indices, data, and shape.
  
      Args:
          array_of_sparse: The sparse data array.
  
      Returns:
          A list of dense numpy arrays representing the sparse data.
      """
      if array_of_sparse.number_of_dimensions == 4:
          return RasaDataGenerator._4d_scipy_matrix_to_values(
              array_of_sparse
          )
  
      # we need to make sure that the matrices are coo_matrices otherwise the
      # transformation does not work (e.g. you cannot access x.row, x.col)
      if not isinstance(array_of_sparse[0], scipy.sparse.coo_matrix):
          array_of_sparse = [x.tocoo() for x in array_of_sparse]  # type: ignore[assignment]  # noqa: E501
  
      max_seq_len = max([x.shape[0] for x in array_of_sparse])
  
      # get the indices of values
      indices = np.hstack(
          [
              np.vstack([i * np.ones_like(x.row), x.row, x.col])
              for i, x in enumerate(array_of_sparse)
          ]
      ).T
  
      data = np.hstack([x.data for x in array_of_sparse])
  
      number_of_features = array_of_sparse[0].shape[-1]
      shape = np.array(
          (len(array_of_sparse), max_seq_len, number_of_features)
      )
  
      return [
          indices.astype(np.int64),
          data.astype(np.float32),
          shape.astype(np.int64),
      ]
  
imports: import math
  from typing import List, Union, Text, Optional, Any, Tuple, Dict, cast
  import logging
  import scipy.sparse
  import numpy
  from tensorflow.keras.utils import Sequence
  from rasa.utils.tensorflow.constants import SEQUENCE, BALANCED
  from rasa.utils.tensorflow.model_data import RasaModelData, Data, FeatureArray
label_desc: Use image node_id 9 for calling the RasaDataGenerator obj's underlying member method code with example usage: obj._scipy_matrix_to_values(array_of_sparse) and returns: list, RasaDataGenerator