def _box_func(self): return lambda x: Period._from_ordinal(ordinal=x, freq=self.freq)
def func(x): if isinstance(x, Period) or x is NaT: return x else: return Period._from_ordinal(ordinal=x, freq=self.freq)
def _box_func(self, x) -> Period | NaTType: return Period._from_ordinal(ordinal=x, freq=self.freq)
def _box_func(self, x) -> Union[Period, NaTType]: return Period._from_ordinal(ordinal=x, freq=self.freq)