code: def data_size_expectation_builder(data, nan_null_param=False):
      if nan_null_param and np.isnan(data).any():
          return pytest.raises((ValueError,))
  
      if len(data.shape) == 2 and data.size == 0:
          return pytest.raises((ValueError, IndexError))
      else:
          return does_not_raise()
  
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 1 for calling a global function with example usage: data_size_expectation_builder(data, nan_null_param) and returns: pytest, pytest, does_not_raise