def _get_resampler(self, obj, kind=None):
self._set_grouper(obj)<EOL>ax = self.ax<EOL>if isinstance(ax, DatetimeIndex):<EOL><INDENT>return DatetimeIndexResampler(obj,<EOL>groupby=self,<EOL>kind=kind,<EOL>axis=self.axis)<EOL><DEDENT>elif isinstance(ax, PeriodIndex) or kind == '<STR_LIT>':<EOL><INDENT>return PeriodIndexResampler(obj,<EOL>groupby=self,<EOL>kind=kind,<EOL>axis=self.axis)<EOL><DEDENT>elif isinstance(ax, TimedeltaIndex):<EOL><INDENT>return TimedeltaIndexResampler(obj,<EOL>groupby=self,<EOL>axis=self.axis)<EOL><DEDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % type(ax).__name__)<EOL>
Return my resampler or raise if we have an invalid axis.

Parameters
----------
obj : input object
kind : string, optional
    'period','timestamp','timedelta' are valid

Returns
-------
a Resampler

Raises
------
TypeError if incompatible axis