code: def _new_DatetimeIndex(cls, d):
      """
      This is called upon unpickling, rather than the default which doesn't
      have arguments and breaks __new__
      """
      if "data" in d and not isinstance(d["data"], DatetimeIndex):
          # Avoid need to verify integrity by calling simple_new directly
          data = d.pop("data")
          if not isinstance(data, DatetimeArray):
              # For backward compat with older pickles, we may need to construct
              #  a DatetimeArray to adapt to the newer _simple_new signature
              tz = d.pop("tz")
              freq = d.pop("freq")
              dta = DatetimeArray._simple_new(
                  data, dtype=tz_to_dtype(tz), freq=freq
              )
          else:
              dta = data
              for key in ["tz", "freq"]:
                  # These are already stored in our DatetimeArray; if they are
                  #  also in the pickle and don't match, we have a problem.
                  if key in d:
                      assert d[key] == getattr(dta, key)
                      d.pop(key)
          result = cls._simple_new(dta, **d)
      else:
          with warnings.catch_warnings():
              # TODO: If we knew what was going in to **d, we might be able to
              #  go through _simple_new instead
              warnings.simplefilter("ignore")
              result = cls.__new__(cls, **d)
  
      return result
  
imports: from __future__ import annotations
  import datetime
  import operator
  from typing import TYPE_CHECKING
  import warnings
  import numpy
  import pytz
  from pandas._libs import NaT, Period, Timestamp, index, lib
  from pandas._libs.tslibs import Resolution, Tick, Timedelta, periods_per_day, timezones, to_offset
  from pandas._libs.tslibs.offsets import prefix_mapping
  from pandas.util._decorators import cache_readonly, doc
  from pandas.util._exceptions import find_stack_level
  from pandas.core.dtypes.common import is_scalar
  from pandas.core.dtypes.dtypes import DatetimeTZDtype
  from pandas.core.dtypes.generic import ABCSeries
  from pandas.core.dtypes.missing import is_valid_na_for_dtype
  from pandas.core.arrays.datetimes import DatetimeArray, tz_to_dtype
  import pandas.core.common
  from pandas.core.indexes.base import Index, maybe_extract_name
  from pandas.core.indexes.datetimelike import DatetimeTimedeltaMixin
  from pandas.core.indexes.extension import inherit_names
  from pandas.core.tools.times import to_time
  from pandas._libs.tslibs.dtypes import OFFSET_TO_PERIOD_FREQSTR
label_desc: Use image node_id 1 for calling a global function with example usage: _new_DatetimeIndex(cls, d) and returns: result