code: def test_mixed_types(ufunc, arg1, arg2):
      npfunc = getattr(np, ufunc)
      dafunc = getattr(da, ufunc)
  
      dask = dd.from_pandas(arg1, 3)
  
      pandas_type = arg1.__class__
      dask_type = dask.__class__
  
      # applying Dask ufunc doesn't trigger computation
      assert isinstance(dafunc(dask, arg2), dask_type)
      assert_eq(dafunc(dask, arg2), npfunc(dask, arg2))
  
      # applying NumPy ufunc is lazy
      assert isinstance(npfunc(dask, arg2), dask_type)
      assert_eq(npfunc(dask, arg2), npfunc(arg1, arg2))
  
      # applying Dask ufunc to normal Series triggers computation
      assert isinstance(dafunc(arg1, arg2), pandas_type)
      assert_eq(dafunc(arg1, arg2), npfunc(arg1, arg2))
  
      # swapping arguments
  
      # first parameter of ldexp should be array-like
      if ufunc == "ldexp":
          return
  
      # applying Dask ufunc doesn't trigger computation
      assert isinstance(dafunc(arg2, dask), dask_type)
      assert_eq(dafunc(arg2, dask), npfunc(arg2, dask))
  
      # applying NumPy ufunc is lazy
      assert isinstance(npfunc(arg2, dask), dask_type)
      assert_eq(npfunc(arg2, dask), npfunc(arg2, dask))
  
      # applying Dask ufunc to normal Series triggers computation
      assert isinstance(dafunc(arg2, arg1), pandas_type)
      assert_eq(dafunc(arg2, arg1), npfunc(arg2, arg1))
  
file_path: dask/dask/dataframe/tests/test_ufunc.py
imports: from __future__ import annotations
  import warnings
  import pytest
  import numpy
  import dask.array
  import dask.dataframe
  from dask.dataframe.utils import assert_eq
label_desc: Use image node_id 8 for calling a global function with example usage: test_mixed_types(ufunc, arg1, arg2) without return types