def __setstate__(self, state):
if isinstance(state, dict):<EOL><INDENT>super().__setstate__(state)<EOL><DEDENT>elif isinstance(state, tuple):<EOL><INDENT>if len(state) == <NUM_LIT:2>:<EOL><INDENT>nd_state, own_state = state<EOL>data = np.empty(nd_state[<NUM_LIT:1>], dtype=nd_state[<NUM_LIT:2>])<EOL>np.ndarray.__setstate__(data, nd_state)<EOL>freq = Period._maybe_convert_freq(own_state[<NUM_LIT:1>])<EOL><DEDENT>else:  <EOL><INDENT>data = np.empty(state)<EOL>np.ndarray.__setstate__(self, state)<EOL>freq = None  <EOL><DEDENT>data = PeriodArray(data, freq=freq)<EOL>self._data = data<EOL><DEDENT>else:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>
Necessary for making this object picklable