def _concat_index_asobject(to_concat, name=None):
from pandas import Index<EOL>from pandas.core.arrays import ExtensionArray<EOL>klasses = (ABCDatetimeIndex, ABCTimedeltaIndex, ABCPeriodIndex,<EOL>ExtensionArray)<EOL>to_concat = [x.astype(object) if isinstance(x, klasses) else x<EOL>for x in to_concat]<EOL>self = to_concat[<NUM_LIT:0>]<EOL>attribs = self._get_attributes_dict()<EOL>attribs['<STR_LIT:name>'] = name<EOL>to_concat = [x._values if isinstance(x, Index) else x<EOL>for x in to_concat]<EOL>return self._shallow_copy_with_infer(np.concatenate(to_concat), **attribs)<EOL>
concat all inputs as object. DatetimeIndex, TimedeltaIndex and
PeriodIndex are converted to object dtype before concatenation