code: def main(readcsv=pd_read_csv):
      data_path = (
          Path(__file__).parent.parent / "daal4py" / "data" / "batch"
      )
      data_file = data_path / "distance.csv"
      data = readcsv(data_file, usecols=range(10))
  
      # Create algorithm to compute cosine distance (no parameters)
      algorithm = d4p.cosine_distance()
  
      # Computed cosine distance with file or numpy array
      res1 = algorithm.compute(str(data_file))
      res2 = algorithm.compute(data)
  
      assert np.allclose(res1.cosineDistance, res2.cosineDistance)
  
      return res1
  
imports: import os
  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: res1