class_docstr: Test both vector operations and MLlib algorithms with SciPy sparse matrices,
  if SciPy is available.
class_docstr_tok: ["Test","both","vector","operations","and","MLlib","algorithms","with","SciPy","sparse","matrices",",","if","SciPy","is","available","."]
code: def test_squared_distance(self):
      from scipy.sparse import lil_matrix
  
      lil = lil_matrix((4, 1))
      lil[1, 0] = 3
      lil[3, 0] = 2
      dv = DenseVector(array([1.0, 2.0, 3.0, 4.0]))
      sv = SparseVector(4, {0: 1, 1: 2, 2: 3, 3: 4})
      self.assertEqual(15.0, dv.squared_distance(lil))
      self.assertEqual(15.0, sv.squared_distance(lil))
  
imports: import array
  import unittest
  from numpy import array, array_equal, zeros, arange, tile, ones, inf
  import pyspark.ml.linalg
  from pyspark.serializers import CPickleSerializer
  from pyspark.mllib.linalg import Vector, SparseVector, DenseVector, VectorUDT, _convert_to_vector, DenseMatrix, SparseMatrix, Vectors, Matrices, MatrixUDT
  from pyspark.mllib.linalg.distributed import RowMatrix, IndexedRowMatrix, IndexedRow
  from pyspark.mllib.regression import LabeledPoint
  from pyspark.sql import Row
  from pyspark.testing.mllibutils import MLlibTestCase
  from pyspark.testing.utils import have_scipy
label_desc: Use image node_id 4 for calling the SciPyTests obj's underlying member method code with example usage: obj.test_squared_distance() without return types