code: def test_datetimeindex():
      idx1 = pd.DatetimeIndex(
          ["2013-04-01 9:00", "2013-04-02 9:00", "2013-04-03 9:00"] * 2,
          tz="Asia/Tokyo",
      )
      idx2 = date_range(
          "2010/01/01", periods=6, freq="ME", tz="US/Eastern"
      )
      idx = MultiIndex.from_arrays([idx1, idx2])
  
      expected1 = pd.DatetimeIndex(
          ["2013-04-01 9:00", "2013-04-02 9:00", "2013-04-03 9:00"],
          tz="Asia/Tokyo",
      )
  
      tm.assert_index_equal(idx.levels[0], expected1)
      tm.assert_index_equal(idx.levels[1], idx2)
  
      # from datetime combos
      # GH 7888
      date1 = np.datetime64("today")
      date2 = datetime.today()
      date3 = Timestamp.today()
  
      for d1, d2 in itertools.product(
          [date1, date2, date3], [date1, date2, date3]
      ):
          index = MultiIndex.from_product([[d1], [d2]])
          assert isinstance(index.levels[0], pd.DatetimeIndex)
          assert isinstance(index.levels[1], pd.DatetimeIndex)
  
      # but NOT date objects, matching Index behavior
      date4 = date.today()
      index = MultiIndex.from_product([[date4], [date2]])
      assert not isinstance(index.levels[0], pd.DatetimeIndex)
      assert isinstance(index.levels[1], pd.DatetimeIndex)
  
imports: from datetime import date, datetime
  import itertools
  import numpy
  import pytest
  from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike
  import pandas
  from pandas import Index, MultiIndex, Series, Timestamp, date_range
  import pandas._testing
label_desc: Use image node_id 45 for calling a global function with example usage: test_datetimeindex() without return types