def _get_insert_freq(self, loc: int, item):
    '\n        Find the `freq` for self.insert(loc, item).\n        '
    value = self._data._validate_scalar(item)
    item = self._data._box_func(value)
    freq = None
    if (self.freq is not None):
        if self.size:
            if (item is NaT):
                pass
            elif (((loc == 0) or (loc == (- len(self)))) and ((item + self.freq) == self[0])):
                freq = self.freq
            elif ((loc == len(self)) and ((item - self.freq) == self[(- 1)])):
                freq = self.freq
        elif isinstance(self.freq, Tick):
            freq = self.freq
        elif self.freq.is_on_offset(item):
            freq = self.freq
    return freq
Find the `freq` for self.insert(loc, item).
def _get_insert_freq(self, loc: int, item):
    '\n        \n        '
    value = self._data._validate_scalar(item)
    item = self._data._box_func(value)
    freq = None
    if (self.freq is not None):
        if self.size:
            if (item is NaT):
                pass
            elif (((loc == 0) or (loc == (- len(self)))) and ((item + self.freq) == self[0])):
                freq = self.freq
            elif ((loc == len(self)) and ((item - self.freq) == self[(- 1)])):
                freq = self.freq
        elif isinstance(self.freq, Tick):
            freq = self.freq
        elif self.freq.is_on_offset(item):
            freq = self.freq
    return freq