class_docstr: Immutable ndarray holding ordinal values indicating regular periods in time.
  
  Index keys are boxed to Period objects which carries the metadata (eg,
  frequency information).
  
  Parameters
  ----------
  data : array-like (1d int np.ndarray or PeriodArray), optional
      Optional period-like data to construct index with.
  copy : bool
      Make a copy of input ndarray.
  freq : str or period object, optional
      One of pandas period strings or corresponding objects.
  year : int, array, or Series, default None
  
      .. deprecated:: 2.2.0
         Use PeriodIndex.from_fields instead.
  month : int, array, or Series, default None
  
      .. deprecated:: 2.2.0
         Use PeriodIndex.from_fields instead.
  quarter : int, array, or Series, default None
  
      .. deprecated:: 2.2.0
         Use PeriodIndex.from_fields instead.
  day : int, array, or Series, default None
  
      .. deprecated:: 2.2.0
         Use PeriodIndex.from_fields instead.
  hour : int, array, or Series, default None
  
      .. deprecated:: 2.2.0
         Use PeriodIndex.from_fields instead.
  minute : int, array, or Series, default None
  
      .. deprecated:: 2.2.0
         Use PeriodIndex.from_fields instead.
  second : int, array, or Series, default None
  
      .. deprecated:: 2.2.0
         Use PeriodIndex.from_fields instead.
  dtype : str or PeriodDtype, default None
  
  Attributes
  ----------
  day
  dayofweek
  day_of_week
  dayofyear
  day_of_year
  days_in_month
  daysinmonth
  end_time
  freq
  freqstr
  hour
  is_leap_year
  minute
  month
  quarter
  qyear
  second
  start_time
  week
  weekday
  weekofyear
  year
  
  Methods
  -------
  asfreq
  strftime
  to_timestamp
  from_fields
  from_ordinals
  
  See Also
  --------
  Index : The base pandas Index type.
  Period : Represents a period of time.
  DatetimeIndex : Index with datetime64 data.
  TimedeltaIndex : Index of timedelta64 data.
  period_range : Create a fixed-frequency PeriodIndex.
  
  Examples
  --------
  >>> idx = pd.PeriodIndex.from_fields(year=[2000, 2002], quarter=[1, 3])
  >>> idx
  PeriodIndex(['2000Q1', '2002Q3'], dtype='period[Q-DEC]')
class_docstr_tok: ["Immutable","ndarray","holding","ordinal","values","indicating","regular","periods","in","time",".","Index","keys","are","boxed","to","Period","objects","which","carries","the","metadata","(","eg",",","frequency","information",")",".","Parameters","--","--","--","--","--","data",":","array-like","(","1d","int","np.ndarray","or","PeriodArray",")",",","optional","Optional","period-like","data","to","construct","index","with",".","copy",":","bool","Make","a","copy","of","input","ndarray",".","freq",":","str","or","period","object",",","optional","One","of","pandas","period","strings","or","corresponding","objects",".","year",":","int",",","array",",","or","Series",",","default","None","..","deprecated",":",":","2.2.0","Use","PeriodIndex.from_fields","instead",".","month",":","int",",","array",",","or","Series",",","default","None","..","deprecated",":",":","2.2.0","Use","PeriodIndex.from_fields","instead",".","quarter",":","int",",","array",",","or","Series",",","default","None","..","deprecated",":",":","2.2.0","Use","PeriodIndex.from_fields","instead",".","day",":","int",",","array",",","or","Series",",","default","None","..","deprecated",":",":","2.2.0","Use","PeriodIndex.from_fields","instead",".","hour",":","int",",","array",",","or","Series",",","default","None","..","deprecated",":",":","2.2.0","Use","PeriodIndex.from_fields","instead",".","minute",":","int",",","array",",","or","Series",",","default","None","..","deprecated",":",":","2.2.0","Use","PeriodIndex.from_fields","instead",".","second",":","int",",","array",",","or","Series",",","default","None","..","deprecated",":",":","2.2.0","Use","PeriodIndex.from_fields","instead",".","dtype",":","str","or","PeriodDtype",",","default","None","Attributes","--","--","--","--","--","day","dayofweek","day_of_week","dayofyear","day_of_year","days_in_month","daysinmonth","end_time","freq","freqstr","hour","is_leap_year","minute","month","quarter","qyear","second","start_time","week","weekday","weekofyear","year","Methods","--","--","--","-","asfreq","strftime","to_timestamp","from_fields","from_ordinals","See","Also","--","--","--","--","Index",":","The","base","pandas","Index","type",".","Period",":","Represents","a","period","of","time",".","DatetimeIndex",":","Index","with","datetime64","data",".","TimedeltaIndex",":","Index","of","timedelta64","data",".","period_range",":","Create","a","fixed-frequency","PeriodIndex",".","Examples","--","--","--","--",">",">",">","idx","=","pd.PeriodIndex.from_fields","(","year=","[","2000",",","2002","]",",","quarter=","[","1",",","3","]",")",">",">",">","idx","PeriodIndex","(","[","'2000Q1","'",",","'2002Q3","'","]",",","dtype='period","[","Q-DEC","]","'",")"]
code: def _convert_tolerance(self, tolerance, target):
      # Returned tolerance must be in dtype/units so that
      #  `|self._get_engine_target() - target._engine_target()| <= tolerance`
      #  is meaningful.  Since PeriodIndex returns int64 for engine_target,
      #  we may need to convert timedelta64 tolerance to int64.
      tolerance = super()._convert_tolerance(tolerance, target)
  
      if self.dtype == target.dtype:
          # convert tolerance to i8
          tolerance = self._maybe_convert_timedelta(tolerance)
  
      return tolerance
  
imports: from __future__ import annotations
  from datetime import datetime, timedelta
  from typing import TYPE_CHECKING
  import warnings
  import numpy
  from pandas._libs import index
  from pandas._libs.tslibs import BaseOffset, NaT, Period, Resolution, Tick
  from pandas._libs.tslibs.dtypes import OFFSET_TO_PERIOD_FREQSTR
  from pandas.util._decorators import cache_readonly, doc
  from pandas.util._exceptions import find_stack_level
  from pandas.core.dtypes.common import is_integer
  from pandas.core.dtypes.dtypes import PeriodDtype
  from pandas.core.dtypes.generic import ABCSeries
  from pandas.core.dtypes.missing import is_valid_na_for_dtype
  from pandas.core.arrays.period import PeriodArray, period_array, raise_on_incompatible, validate_dtype_freq
  import pandas.core.common
  import pandas.core.indexes.base
  from pandas.core.indexes.base import maybe_extract_name
  from pandas.core.indexes.datetimelike import DatetimeIndexOpsMixin
  from pandas.core.indexes.datetimes import DatetimeIndex, Index
  from pandas.core.indexes.extension import inherit_names
label_desc: Use image node_id 17 for calling the PeriodIndex obj's underlying member method code with example usage: obj._convert_tolerance(tolerance, target) and returns: tolerance