def _center_window(self, result, window):
if self.axis > result.ndim - <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>offset = _offset(window, True)<EOL>if offset > <NUM_LIT:0>:<EOL><INDENT>if isinstance(result, (ABCSeries, ABCDataFrame)):<EOL><INDENT>result = result.slice_shift(-offset, axis=self.axis)<EOL><DEDENT>else:<EOL><INDENT>lead_indexer = [slice(None)] * result.ndim<EOL>lead_indexer[self.axis] = slice(offset, None)<EOL>result = np.copy(result[tuple(lead_indexer)])<EOL><DEDENT><DEDENT>return result<EOL>
Center the result in the window.