code: def get_nonzero_indices_in_vector(vec):
      """Returns the nonzero indices in the vector vec."""
      if not isinstance(vec, np.ndarray):
          vec = np.asarray(vec.todense()).ravel()
      (ret,) = vec.nonzero()
      return ret
  
imports: from __future__ import print_function
  from __future__ import division
  import numpy
  from scipy.sparse import dok_matrix
  from scipy.linalg import solve_triangular
label_desc: Use image node_id 19 for calling a global function with example usage: get_nonzero_indices_in_vector(vec) and returns: ret