code: def main(readcsv=pd_read_csv):
      nComponents = 2
      data_path = Path(__file__).parent / "data" / "batch"
      infile = data_path / "em_gmm.csv"
      # We load the data
      data = readcsv(infile)
  
      # configure a em_gmm init object
      algo1 = d4p.em_gmm_init(nComponents)
      # and compute initial model
      result1 = algo1.compute(data)
  
      # configure a em_gmm object
      algo2 = d4p.em_gmm(nComponents)
  
      # and compute em_gmm using initial weights and means
      result2 = algo2.compute(
          data, result1.weights, result1.means, result1.covariances
      )
  
      # implicit als prediction result objects provide covariances,
      # goalFunction, means, nIterations and weights
      return result2
  
imports: from pathlib import Path
  import numpy
  from readcsv import pd_read_csv
  import daal4py
label_desc: Use image node_id 1 for calling a global function with example usage: main(readcsv) and returns: result2