code: def _weighted_mean(values, weights):
      if weights is None:
          mean = np.mean(values)
      else:
          mean = np.sum(values * weights) / np.sum(weights)
      assert np.isfinite(mean)
      return mean
  
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 1 for calling a global function with example usage: _weighted_mean(values, weights) and returns: mean