code: def test_merge_stats(self):
      stats1 = StatCounter([1.0, 2.0, 3.0, 4.0])
      stats2 = StatCounter([1.0, 2.0, 3.0, 4.0])
      stats = stats1.mergeStats(stats2)
      self.assertEqual(stats.count(), 8)
      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.1952286093343936)
      self.assertEqual(stats.sum(), 20.0)
      self.assertAlmostEqual(stats.variance(), 1.25)
      self.assertAlmostEqual(stats.sampleVariance(), 1.4285714285714286)
      execution_statements = [
          StatCounter([1.0, 2.0]).mergeStats(
              StatCounter(range(1, 301))
          ),
          StatCounter(range(1, 301)).mergeStats(
              StatCounter([1.0, 2.0])
          ),
      ]
      for stats in execution_statements:
          self.assertEqual(stats.count(), 302)
          self.assertEqual(stats.max(), 300.0)
          self.assertEqual(stats.min(), 1.0)
          self.assertAlmostEqual(stats.mean(), 149.51324503311)
          self.assertAlmostEqual(stats.variance(), 7596.302804701549)
          self.assertAlmostEqual(
              stats.sampleVariance(), 7621.539691095905
          )
  
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 4 for calling the StatCounterTests obj's underlying member method code with example usage: obj.test_merge_stats() without return types