code: def test_dti_fields(self, tz):
      # GH#13303
      dti = date_range(
          freq="D", start=datetime(1998, 1, 1), periods=365, tz=tz
      )
      assert dti.year[0] == 1998
      assert dti.month[0] == 1
      assert dti.day[0] == 1
      assert dti.hour[0] == 0
      assert dti.minute[0] == 0
      assert dti.second[0] == 0
      assert dti.microsecond[0] == 0
      assert dti.dayofweek[0] == 3
  
      assert dti.dayofyear[0] == 1
      assert dti.dayofyear[120] == 121
  
      assert dti.isocalendar().week.iloc[0] == 1
      assert dti.isocalendar().week.iloc[120] == 18
  
      assert dti.quarter[0] == 1
      assert dti.quarter[120] == 2
  
      assert dti.days_in_month[0] == 31
      assert dti.days_in_month[90] == 30
  
      assert dti.is_month_start[0]
      assert not dti.is_month_start[1]
      assert dti.is_month_start[31]
      assert dti.is_quarter_start[0]
      assert dti.is_quarter_start[90]
      assert dti.is_year_start[0]
      assert not dti.is_year_start[364]
      assert not dti.is_month_end[0]
      assert dti.is_month_end[30]
      assert not dti.is_month_end[31]
      assert dti.is_month_end[364]
      assert not dti.is_quarter_end[0]
      assert not dti.is_quarter_end[30]
      assert dti.is_quarter_end[89]
      assert dti.is_quarter_end[364]
      assert not dti.is_year_end[0]
      assert dti.is_year_end[364]
  
      assert len(dti.year) == 365
      assert len(dti.month) == 365
      assert len(dti.day) == 365
      assert len(dti.hour) == 365
      assert len(dti.minute) == 365
      assert len(dti.second) == 365
      assert len(dti.microsecond) == 365
      assert len(dti.dayofweek) == 365
      assert len(dti.dayofyear) == 365
      assert len(dti.isocalendar()) == 365
      assert len(dti.quarter) == 365
      assert len(dti.is_month_start) == 365
      assert len(dti.is_month_end) == 365
      assert len(dti.is_quarter_start) == 365
      assert len(dti.is_quarter_end) == 365
      assert len(dti.is_year_start) == 365
      assert len(dti.is_year_end) == 365
  
      dti.name = "name"
  
      # non boolean accessors -> return Index
      for accessor in DatetimeArray._field_ops:
          res = getattr(dti, accessor)
          assert len(res) == 365
          assert isinstance(res, Index)
          assert res.name == "name"
  
      # boolean accessors -> return array
      for accessor in DatetimeArray._bool_ops:
          res = getattr(dti, accessor)
          assert len(res) == 365
          assert isinstance(res, np.ndarray)
  
      # test boolean indexing
      res = dti[dti.is_quarter_start]
      exp = dti[[0, 90, 181, 273]]
      tm.assert_index_equal(res, exp)
      res = dti[dti.is_leap_year]
      exp = DatetimeIndex([], freq="D", tz=dti.tz, name="name").as_unit(
          "ns"
      )
      tm.assert_index_equal(res, exp)
  
imports: import calendar
  from datetime import date, datetime, time
  import locale
  import unicodedata
  import numpy
  import pytest
  from pandas._libs.tslibs import timezones
  from pandas import DatetimeIndex, Index, NaT, Timestamp, date_range, offsets
  import pandas._testing
  from pandas.core.arrays import DatetimeArray
label_desc: Use image node_id 12 for calling the TestDatetimeIndexOps obj's underlying member method code with example usage: obj.test_dti_fields(tz) without return types