code: def test_sum_masked(nelem):
      dtype = np.float64
      data = gen_rand(dtype, nelem)
  
      mask = utils.random_bitmask(nelem)
      bitmask = utils.expand_bits_to_bytes(mask)[:nelem]
      null_count = utils.count_zero(bitmask)
  
      sr = Series.from_masked_array(data, mask, null_count)
  
      got = sr.sum()
      res_mask = np.asarray(bitmask, dtype=np.bool_)[: data.size]
      expect = data[res_mask].sum()
  
      significant = 4 if dtype == np.float32 else 6
      np.testing.assert_approx_equal(
          expect, got, significant=significant
      )
  
imports: from decimal import Decimal
  from itertools import product
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf import Series
  from cudf.core.dtypes import Decimal32Dtype, Decimal64Dtype, Decimal128Dtype
  from cudf.testing import _utils
  from cudf.testing._utils import NUMERIC_TYPES, assert_eq, expect_warning_if, gen_rand
label_desc: Use image node_id 12 for calling a global function with example usage: test_sum_masked(nelem) without return types