code: def test_dt_accessor(df_ddf):
      df, ddf = df_ddf
  
      assert "date" in dir(ddf.dt_col.dt)
  
      # pandas loses Series.name via datetime accessor
      # see https://github.com/pydata/pandas/issues/10712
      assert_eq(
          ddf.dt_col.dt.date, df.dt_col.dt.date, check_names=False
      )
  
      warning = FutureWarning if PANDAS_GE_210 else None
      # to_pydatetime returns a numpy array in pandas, but a Series in dask
      # pandas will start returning a Series with 3.0 as well
      with pytest.warns(warning, match="will return a Series"):
          ddf_result = ddf.dt_col.dt.to_pydatetime()
      with pytest.warns(warning, match="will return a Series"):
          pd_result = pd.Series(
              df.dt_col.dt.to_pydatetime(), index=df.index, dtype=object
          )
      assert_eq(ddf_result, pd_result)
  
      assert set(ddf.dt_col.dt.date.dask) == set(
          ddf.dt_col.dt.date.dask
      )
      with pytest.warns(warning, match="will return a Series"):
          assert set(ddf.dt_col.dt.to_pydatetime().dask) == set(
              ddf.dt_col.dt.to_pydatetime().dask
          )
  
imports: from __future__ import annotations
  import contextlib
  import numpy
  import pytest
  import dask.dataframe
  from dask.dataframe._compat import PANDAS_GE_140, PANDAS_GE_210
  from dask.dataframe._pyarrow import to_pyarrow_string
  from dask.dataframe.utils import assert_eq, pyarrow_strings_enabled
label_desc: Use image node_id 5 for calling a global function with example usage: test_dt_accessor(df_ddf) without return types