code: def explode_matrix(matrix: Union[Column, str]) -> Column:
      """
      Explodes a ``spark.ml`` ``Matrix`` (sparse or dense) into multiple arrays, one per row of the matrix.
  
      Added in version 0.3.0.
  
      Examples:
          >>> from pyspark.ml.linalg import DenseMatrix
          >>> m = DenseMatrix(numRows=3, numCols=2, values=[1, 2, 3, 4, 5, 6])
          >>> df = spark.createDataFrame([Row(matrix=m)])
          >>> df.select(glow.explode_matrix('matrix').alias('row')).collect()
          [Row(row=[1.0, 4.0]), Row(row=[2.0, 5.0]), Row(row=[3.0, 6.0])]
  
      Args:
          matrix : The ``sparl.ml`` ``Matrix`` to explode
  
      Returns:
          An array column in which each row is a row of the input matrix
      """
      assert check_argument_types()
      output = Column(
          sc()._jvm.io.projectglow.functions.explode_matrix(
              _to_java_column(matrix)
          )
      )
      assert check_return_type(output)
      return output
  
imports: from pyspark import SparkContext
  from pyspark.sql.column import Column, _to_java_column, _to_seq
  from typeguard import check_argument_types, check_return_type
  from typing import Union
label_desc: Use image node_id 7 for calling a global function with example usage: explode_matrix(matrix) and returns: output