code: def test_datetime_likes_nan(klass):
      dtype = klass.__name__ + "[ns]"
      arr = np.array([1, 2, np.nan])
  
      exp = np.array([1, 2, klass("NaT")], dtype)
      res = maybe_downcast_to_dtype(arr, dtype)
      tm.assert_numpy_array_equal(res, exp)
  
file_path: pandas/pandas/tests/dtypes/cast/test_downcast.py
imports: import decimal
  import numpy
  import pytest
  from pandas.core.dtypes.cast import maybe_downcast_to_dtype
  from pandas import Series, Timedelta
  import pandas._testing
label_desc: Use image node_id 6 for calling a global function with example usage: test_datetime_likes_nan(klass) without return types