code: def test_binary_ufunc_series_array(
      request, ufunc, has_nulls, indexed, reflect
  ):
      fname = ufunc.__name__
      request.applymarker(
          pytest.mark.xfail(
              condition=reflect and has_nulls,
              reason=(
                  "When cupy is the left operand there is no way for us to "
                  "avoid calling its binary operators, which cannot handle "
                  "cudf objects that contain nulls."
              ),
          )
      )
      # The way cudf casts nans in arrays to nulls during binops with cudf
      # objects is currently incompatible with pandas.
      request.applymarker(
          pytest.mark.xfail(
              condition=(
                  fname in {"greater", "greater_equal", "logical_and"}
                  and has_nulls
              ),
              reason=(
                  "cudf and pandas incompatible casting nans "
                  "to nulls in binops"
              ),
          )
      )
      N = 100
      # Avoid zeros in either array to skip division by 0 errors. Also limit the
      # scale to avoid issues with overflow, etc. We use ints because some
      # operations (like bitwise ops) are not defined for floats.
      args = [
          cudf.Series(
              cp.random.rand(N),
              index=cp.random.choice(range(N), N, False)
              if indexed
              else None,
          )
          for _ in range(ufunc.nin)
      ]
  
      if has_nulls:
          # Converting nullable integer cudf.Series to pandas will produce a
          # float pd.Series, so instead we replace nulls with an arbitrary
          # integer value, precompute the mask, and then reapply it afterwards.
          for arg in args:
              set_random_null_mask_inplace(arg)
  
          # Cupy doesn't support nulls, so we fill with nans before converting.
          args[1] = args[1].fillna(cp.nan)
          mask = args[0].isna().to_pandas()
  
      arg1 = args[1].to_cupy()
  
      if reflect:
          got = ufunc(arg1, args[0])
          expect = ufunc(args[1].to_numpy(), args[0].to_pandas())
      else:
          got = ufunc(args[0], arg1)
          expect = ufunc(args[0].to_pandas(), args[1].to_numpy())
  
      if ufunc.nout > 1:
          for g, e in zip(got, expect):
              if has_nulls:
                  e[mask] = np.nan
              if reflect:
                  assert (cp.asnumpy(g) == e).all()
              else:
                  assert_eq(g, e, check_exact=False)
      else:
          if has_nulls:
              expect[mask] = np.nan
          if reflect:
              assert (cp.asnumpy(got) == expect).all()
          else:
              assert_eq(got, expect, check_exact=False)
  
file_path: cudf/python/cudf/cudf/tests/test_array_ufunc.py
imports: import operator
  import warnings
  from contextlib import contextmanager
  from functools import reduce
  import cupy
  import numpy
  import pytest
  import cudf
  from cudf.core._compat import PANDAS_GE_150
  from cudf.testing._utils import assert_eq, set_random_null_mask_inplace
label_desc: Use image node_id 5 for calling a global function with example usage: test_binary_ufunc_series_array(request, ufunc, has_nulls, indexed, reflect) without return types