code: def test_datetime_and_timedelta_converter():
      arr = np.array(
          [np.datetime64("2005-02-25"), np.datetime64("2006-02-25")],
          dtype=np.datetime64,
      )
      convertor = pandas_renderer.datetime_and_timedelta_converter(
          arr.dtype
      )
      assert np.array_equal(
          [1109289600000000000, 1140825600000000000], convertor(arr)
      )
  
      arr = np.array(
          [np.datetime64("2009-01-01") - np.datetime64("2008-01-01")],
          dtype=np.timedelta64,
      )
      convertor = pandas_renderer.datetime_and_timedelta_converter(
          arr.dtype
      )
      assert np.array_equal([31622400000000000], convertor(arr))
  
file_path: mlflow/tests/recipes/cards/test_pandas_renderer.py
imports: import numpy
  import pandas
  import pytest
  from google.protobuf import text_format
  from mlflow.exceptions import MlflowException
  from mlflow.protos import facet_feature_statistics_pb2
  from mlflow.recipes.cards import pandas_renderer
label_desc: Use image node_id 3 for calling a global function with example usage: test_datetime_and_timedelta_converter() without return types