def __array_wrap__(self, result, context=None):
if isinstance(context, tuple) and len(context) > <NUM_LIT:0>:<EOL><INDENT>func = context[<NUM_LIT:0>]<EOL>if func is np.add:<EOL><INDENT>pass<EOL><DEDENT>elif func is np.subtract:<EOL><INDENT>name = self.name<EOL>left = context[<NUM_LIT:1>][<NUM_LIT:0>]<EOL>right = context[<NUM_LIT:1>][<NUM_LIT:1>]<EOL>if (isinstance(left, PeriodIndex) and<EOL>isinstance(right, PeriodIndex)):<EOL><INDENT>name = left.name if left.name == right.name else None<EOL>return Index(result, name=name)<EOL><DEDENT>elif isinstance(left, Period) or isinstance(right, Period):<EOL><INDENT>return Index(result, name=name)<EOL><DEDENT><DEDENT>elif isinstance(func, np.ufunc):<EOL><INDENT>if '<STR_LIT>' not in func.types:<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise ValueError(msg.format(func.__name__))<EOL><DEDENT><DEDENT><DEDENT>if is_bool_dtype(result):<EOL><INDENT>return result<EOL><DEDENT>return type(self)(result, freq=self.freq, name=self.name)<EOL>
Gets called after a ufunc. Needs additional handling as
PeriodIndex stores internal data as int dtype

Replace this to __numpy_ufunc__ in future version