code: def sparse_matrix_to_string(m: scipy.sparse.spmatrix) -> Text:
      """Turns a sparse matrix into a string.
  
      Will return a line "(i,j)  v" for each value in the matrix.
  
      taken from official scipy source to operate on full sparse matrix to not have
      to change the `maxprint` property in-place.
      https://github.com/scipy/scipy/blob/v1.7.0/scipy/sparse/base.py#L258
      """
      # make sure sparse matrix is in COOrdinate format
      m_coo = m.tocoo()
      triples = zip(list(zip(m_coo.row, m_coo.col)), m_coo.data)
      return "\n".join([("  %s\t%s" % t) for t in triples])
  
imports: import json
  import logging
  import os
  import re
  from typing import Any, Dict, Optional, Text, Match, List
  import scipy.sparse
  from rasa.shared.nlu.constants import ENTITIES, EXTRACTOR, PRETRAINED_EXTRACTORS, ENTITY_ATTRIBUTE_START, ENTITY_ATTRIBUTE_END, ENTITY_ATTRIBUTE_VALUE, ENTITY_ATTRIBUTE_TYPE, ENTITY_ATTRIBUTE_ROLE, ENTITY_ATTRIBUTE_GROUP
  from rasa.shared.constants import UTTER_PREFIX
  import rasa.shared.utils.io
  import rasa.shared.data
label_desc: Use image node_id 11 for calling a global function with example usage: sparse_matrix_to_string(m) and returns: str