class_docstr: Immutable ndarray-like of datetime64 data.
  
  Represented internally as int64, and which can be boxed to Timestamp objects
  that are subclasses of datetime and carry metadata.
  
  .. versionchanged:: 2.0.0
      The various numeric date/time attributes (:attr:`~DatetimeIndex.day`,
      :attr:`~DatetimeIndex.month`, :attr:`~DatetimeIndex.year` etc.) now have dtype
      ``int32``. Previously they had dtype ``int64``.
  
  Parameters
  ----------
  data : array-like (1-dimensional)
      Datetime-like data to construct index with.
  freq : str or pandas offset object, optional
      One of pandas date offset strings or corresponding objects. The string
      'infer' can be passed in order to set the frequency of the index as the
      inferred frequency upon creation.
  tz : pytz.timezone or dateutil.tz.tzfile or datetime.tzinfo or str
      Set the Timezone of the data.
  normalize : bool, default False
      Normalize start/end dates to midnight before generating date range.
  
      .. deprecated:: 2.1.0
  
  closed : {'left', 'right'}, optional
      Set whether to include `start` and `end` that are on the
      boundary. The default includes boundary points on either end.
  
      .. deprecated:: 2.1.0
  
  ambiguous : 'infer', bool-ndarray, 'NaT', default 'raise'
      When clocks moved backward due to DST, ambiguous times may arise.
      For example in Central European Time (UTC+01), when going from 03:00
      DST to 02:00 non-DST, 02:30:00 local time occurs both at 00:30:00 UTC
      and at 01:30:00 UTC. In such a situation, the `ambiguous` parameter
      dictates how ambiguous times should be handled.
  
      - 'infer' will attempt to infer fall dst-transition hours based on
        order
      - bool-ndarray where True signifies a DST time, False signifies a
        non-DST time (note that this flag is only applicable for ambiguous
        times)
      - 'NaT' will return NaT where there are ambiguous times
      - 'raise' will raise an AmbiguousTimeError if there are ambiguous times.
  dayfirst : bool, default False
      If True, parse dates in `data` with the day first order.
  yearfirst : bool, default False
      If True parse dates in `data` with the year first order.
  dtype : numpy.dtype or DatetimeTZDtype or str, default None
      Note that the only NumPy dtype allowed is `datetime64[ns]`.
  copy : bool, default False
      Make a copy of input ndarray.
  name : label, default None
      Name to be stored in the index.
  
  Attributes
  ----------
  year
  month
  day
  hour
  minute
  second
  microsecond
  nanosecond
  date
  time
  timetz
  dayofyear
  day_of_year
  dayofweek
  day_of_week
  weekday
  quarter
  tz
  freq
  freqstr
  is_month_start
  is_month_end
  is_quarter_start
  is_quarter_end
  is_year_start
  is_year_end
  is_leap_year
  inferred_freq
  
  Methods
  -------
  normalize
  strftime
  snap
  tz_convert
  tz_localize
  round
  floor
  ceil
  to_period
  to_pydatetime
  to_series
  to_frame
  month_name
  day_name
  mean
  std
  
  See Also
  --------
  Index : The base pandas Index type.
  TimedeltaIndex : Index of timedelta64 data.
  PeriodIndex : Index of Period data.
  to_datetime : Convert argument to datetime.
  date_range : Create a fixed-frequency DatetimeIndex.
  
  Notes
  -----
  To learn more about the frequency strings, please see `this link
  <https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases>`__.
  
  Examples
  --------
  >>> idx = pd.DatetimeIndex(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"])
  >>> idx
  DatetimeIndex(['2020-01-01 10:00:00+00:00', '2020-02-01 11:00:00+00:00'],
  dtype='datetime64[ns, UTC]', freq=None)
class_docstr_tok: ["Immutable","ndarray-like","of","datetime64","data",".","Represented","internally","as","int64",",","and","which","can","be","boxed","to","Timestamp","objects","that","are","subclasses","of","datetime","and","carry","metadata",".","..","versionchanged",":",":","2.0.0","The","various","numeric","date\/time","attributes","(",":","attr",":","`","~DatetimeIndex.day","`",",",":","attr",":","`","~DatetimeIndex.month","`",",",":","attr",":","`","~DatetimeIndex.year","`","etc",".",")","now","have","dtype","``","int32","``",".","Previously","they","had","dtype","``","int64","``",".","Parameters","--","--","--","--","--","data",":","array-like","(","1-dimensional",")","Datetime-like","data","to","construct","index","with",".","freq",":","str","or","pandas","offset","object",",","optional","One","of","pandas","date","offset","strings","or","corresponding","objects",".","The","string","'infer","'","can","be","passed","in","order","to","set","the","frequency","of","the","index","as","the","inferred","frequency","upon","creation",".","tz",":","pytz.timezone","or","dateutil.tz.tzfile","or","datetime.tzinfo","or","str","Set","the","Timezone","of","the","data",".","normalize",":","bool",",","default","False","Normalize","start\/end","dates","to","midnight","before","generating","date","range",".","..","deprecated",":",":","2.1.0","closed",":","{","'left","'",",","'right","'","}",",","optional","Set","whether","to","include","`","start","`","and","`","end","`","that","are","on","the","boundary",".","The","default","includes","boundary","points","on","either","end",".","..","deprecated",":",":","2.1.0","ambiguous",":","'infer","'",",","bool-ndarray",",","'NaT","'",",","default","'raise'","When","clocks","moved","backward","due","to","DST",",","ambiguous","times","may","arise",".","For","example","in","Central","European","Time","(","UTC+01",")",",","when","going","from","03:00","DST","to","02:00","non-DST",",","02:30:00","local","time","occurs","both","at","00:30:00","UTC","and","at","01:30:00","UTC",".","In","such","a","situation",",","the","`","ambiguous","`","parameter","dictates","how","ambiguous","times","should","be","handled",".","-","'infer","'","will","attempt","to","infer","fall","dst-transition","hours","based","on","order","-","bool-ndarray","where","True","signifies","a","DST","time",",","False","signifies","a","non-DST","time","(","note","that","this","flag","is","only","applicable","for","ambiguous","times",")","-","'NaT","'","will","return","NaT","where","there","are","ambiguous","times","-","'raise","'","will","raise","an","AmbiguousTimeError","if","there","are","ambiguous","times",".","dayfirst",":","bool",",","default","False","If","True",",","parse","dates","in","`","data","`","with","the","day","first","order",".","yearfirst",":","bool",",","default","False","If","True","parse","dates","in","`","data","`","with","the","year","first","order",".","dtype",":","numpy.dtype","or","DatetimeTZDtype","or","str",",","default","None","Note","that","the","only","NumPy","dtype","allowed","is","`","datetime64","[","ns","]","`",".","copy",":","bool",",","default","False","Make","a","copy","of","input","ndarray",".","name",":","label",",","default","None","Name","to","be","stored","in","the","index",".","Attributes","--","--","--","--","--","year","month","day","hour","minute","second","microsecond","nanosecond","date","time","timetz","dayofyear","day_of_year","dayofweek","day_of_week","weekday","quarter","tz","freq","freqstr","is_month_start","is_month_end","is_quarter_start","is_quarter_end","is_year_start","is_year_end","is_leap_year","inferred_freq","Methods","--","--","--","-","normalize","strftime","snap","tz_convert","tz_localize","round","floor","ceil","to_period","to_pydatetime","to_series","to_frame","month_name","day_name","mean","std","See","Also","--","--","--","--","Index",":","The","base","pandas","Index","type",".","TimedeltaIndex",":","Index","of","timedelta64","data",".","PeriodIndex",":","Index","of","Period","data",".","to_datetime",":","Convert","argument","to","datetime",".","date_range",":","Create","a","fixed-frequency","DatetimeIndex",".","Notes","--","--","-","To","learn","more","about","the","frequency","strings",",","please","see","`","this","link","<","https",":","\/\/pandas.pydata.org\/pandas-docs\/stable\/user_guide\/timeseries.html","#","offset-aliases",">","`","__",".","Examples","--","--","--","--",">",">",">","idx","=","pd.DatetimeIndex","(","[","``","1\/1\/2020","10:00:00+00:00","''",",","``","2\/1\/2020","11:00:00+00:00","''","]",")",">",">",">","idx","DatetimeIndex","(","[","'2020-01-01","10:00:00+00:00","'",",","'2020-02-01","11:00:00+00:00","'","]",",","dtype='datetime64","[","ns",",","UTC","]","'",",","freq=None",")"]
docstr: Get integer location for requested label
  
  Returns
  -------
  loc : int
code: def get_loc(self, key):
      """
      Get integer location for requested label
  
      Returns
      -------
      loc : int
      """
      self._check_indexing_error(key)
  
      orig_key = key
      if is_valid_na_for_dtype(key, self.dtype):
          key = NaT
  
      if isinstance(key, self._data._recognized_scalars):
          # needed to localize naive datetimes
          self._disallow_mismatched_indexing(key)
          key = Timestamp(key)
  
      elif isinstance(key, str):
          try:
              parsed, reso = self._parse_with_reso(key)
          except (ValueError, pytz.NonExistentTimeError) as err:
              raise KeyError(key) from err
          self._disallow_mismatched_indexing(parsed)
  
          if self._can_partial_date_slice(reso):
              try:
                  return self._partial_date_slice(reso, parsed)
              except KeyError as err:
                  raise KeyError(key) from err
  
          key = parsed
  
      elif isinstance(key, dt.timedelta):
          # GH#20464
          raise TypeError(
              f"Cannot index {type(self).__name__} with {type(key).__name__}"
          )
  
      elif isinstance(key, dt.time):
          return self.indexer_at_time(key)
  
      else:
          # unrecognized type
          raise KeyError(key)
  
      try:
          return Index.get_loc(self, key)
      except KeyError as err:
          raise KeyError(orig_key) from err
  
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 20 for calling the DatetimeIndex obj's underlying member method code with example usage: obj.get_loc(key) and returns: Index, self, self