code: def test_datetime_bin(conv):
      data = [np.datetime64("2012-12-13"), np.datetime64("2012-12-15")]
      bin_data = ["2012-12-12", "2012-12-14", "2012-12-16"]
  
      expected = Series(
          IntervalIndex(
              [
                  Interval(
                      Timestamp(bin_data[0]), Timestamp(bin_data[1])
                  ),
                  Interval(
                      Timestamp(bin_data[1]), Timestamp(bin_data[2])
                  ),
              ]
          )
      ).astype(CategoricalDtype(ordered=True))
  
      bins = [conv(v) for v in bin_data]
      result = Series(cut(data, bins=bins))
      tm.assert_series_equal(result, expected)
  
imports: import numpy
  import pytest
  import pandas
  from pandas import Categorical, DataFrame, DatetimeIndex, Index, Interval, IntervalIndex, Series, TimedeltaIndex, Timestamp, cut, date_range, interval_range, isna, qcut, timedelta_range, to_datetime
  import pandas._testing
  from pandas.api.types import CategoricalDtype
  import pandas.core.reshape.tile
label_desc: Use image node_id 30 for calling a global function with example usage: test_datetime_bin(conv) without return types