code: def test_mean_variance_axis0_precision(dtype, sparse_constructor):
      # Check that there's no big loss of precision when the real variance is
      # exactly 0. (#19766)
      rng = np.random.RandomState(0)
      X = np.full(fill_value=100.0, shape=(1000, 1), dtype=dtype)
      # Add some missing records which should be ignored:
      missing_indices = rng.choice(
          np.arange(X.shape[0]), 10, replace=False
      )
      X[missing_indices, 0] = np.nan
      X = sparse_constructor(X)
  
      # Random positive weights:
      sample_weight = rng.rand(X.shape[0]).astype(dtype)
  
      _, var = mean_variance_axis(X, weights=sample_weight, axis=0)
  
      assert var < np.finfo(dtype).eps
  
imports: import numpy
  import pytest
  import scipy.sparse
  from numpy.random import RandomState
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from scipy import linalg
  from sklearn.datasets import make_classification
  from sklearn.utils._testing import assert_allclose
  from sklearn.utils.fixes import CSC_CONTAINERS, CSR_CONTAINERS, LIL_CONTAINERS
  from sklearn.utils.sparsefuncs import _implicit_column_offset, count_nonzero, csc_median_axis_0, incr_mean_variance_axis, inplace_column_scale, inplace_row_scale, inplace_swap_column, inplace_swap_row, mean_variance_axis, min_max_axis
  from sklearn.utils.sparsefuncs_fast import assign_rows_csr, csr_row_norms, inplace_csr_row_normalize_l1, inplace_csr_row_normalize_l2
label_desc: Use image node_id 2 for calling a global function with example usage: test_mean_variance_axis0_precision(dtype, sparse_constructor) without return types