code: def data_1d(request):
      nelems = request.param[0]
      dtype = request.param[1]
      nulls = request.param[2]
      a = np.random.randint(10, size=nelems).astype(dtype)
      if (
          nulls == "some"
          and a.size != 0
          and np.issubdtype(dtype, np.floating)
      ):
          idx = np.random.choice(
              a.size, size=int(a.size * 0.2), replace=False
          )
          a[idx] = np.nan
      return a
  
imports: import itertools
  from contextlib import ExitStack
  import cupy
  import numpy
  import pytest
  from packaging import version
  import cudf
  from cudf.testing._utils import assert_eq
label_desc: Use image node_id 2 for calling a global function with example usage: data_1d(request) and returns: a