code: def test_update_random_array(
      self,
      array_size,
      distribution_mean,
      distribution_variance,
      use_weights,
  ):
      rng = np.random.default_rng(4444444)
      values = (
          rng.standard_normal(array_size)
          * np.sqrt(distribution_variance)
          + distribution_mean
      )
      weights = None
      if use_weights:
          weights = np.abs(rng.standard_normal(array_size))
      expected_mean = _weighted_mean(values, weights)
      expected_variance = _weighted_variance(values, weights)
      if weights is None:
          accumulator = variance_util.MeanVarAccumulator()
          accumulator.update(values)
      else:
          accumulator = variance_util.WeightedMeanVarAccumulator()
          accumulator.update(values, weights)
  
      # Iterate over chunks updating - array_size should be divisible by 10.
      batch_size = 10
      for idx in range(0, values.size, batch_size):
          if weights is None:
              accumulator.update(values[idx : idx + batch_size])
          else:
              accumulator.update(
                  values[idx : idx + batch_size],
                  weights[idx : idx + batch_size],
              )
      self.assertLess(
          _rel_err(accumulator.mean, expected_mean),
          _RELATIVE_ERROR_TOLERANCE,
      )
      self.assertLess(
          _rel_err(accumulator.variance, expected_variance),
          _RELATIVE_ERROR_TOLERANCE,
      )
  
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from tensorflow_data_validation.utils import variance_util
label_desc: Use image node_id 3 for calling the MeanVarAccumulatorTest obj's underlying member method code with example usage: obj.test_update_random_array(array_size, distribution_mean, distribution_variance, use_weights) without return types