code: def test_series_median(dtype, num_na):
      np.random.seed(0)
      arr = np.random.random(100)
      if np.issubdtype(dtype, np.integer):
          arr *= 100
      mask = np.arange(100) >= num_na
  
      arr = arr.astype(dtype)
      sr = cudf.Series(arr)
      sr[~mask] = None
      arr2 = arr[mask]
      ps = pd.Series(arr2, dtype=dtype)
  
      actual = sr.median(skipna=True)
      desired = ps.median(skipna=True)
  
      np.testing.assert_approx_equal(actual, desired)
  
      # only for float until integer null supported convert to pandas in cudf
      # eg. pd.Int64Dtype
      if np.issubdtype(dtype, np.floating):
          ps = sr.to_pandas()
          actual = sr.median(skipna=False)
          desired = ps.median(skipna=False)
          np.testing.assert_approx_equal(actual, desired)
  
imports: from concurrent.futures import ThreadPoolExecutor
  import cupy
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf.datasets import randomdata
  from cudf.testing._utils import _create_cudf_series_float64_default, _create_pandas_series_float64_default, assert_eq, assert_exceptions_equal, expect_warning_if
label_desc: Use image node_id 15 for calling a global function with example usage: test_series_median(dtype, num_na) without return types