code: def test_base(self):
      stats = self.sc.parallelize([1.0, 2.0, 3.0, 4.0]).stats()
      self.assertEqual(stats.count(), 4)
      self.assertEqual(stats.max(), 4.0)
      self.assertEqual(stats.mean(), 2.5)
      self.assertEqual(stats.min(), 1.0)
      self.assertAlmostEqual(stats.stdev(), 1.118033988749895)
      self.assertAlmostEqual(stats.sampleStdev(), 1.2909944487358056)
      self.assertEqual(stats.sum(), 10.0)
      self.assertAlmostEqual(stats.variance(), 1.25)
      self.assertAlmostEqual(stats.sampleVariance(), 1.6666666666666667)
  
file_path: spark/python/pyspark/tests/test_statcounter.py
imports: import math
  from pyspark.statcounter import StatCounter
  from pyspark.testing.utils import ReusedPySparkTestCase
label_desc: Use image node_id 1 for calling the StatCounterTests obj's underlying member method code with example usage: obj.test_base() without return types