def _prep_window(self, **kwargs):
window = self._get_window()<EOL>if isinstance(window, (list, tuple, np.ndarray)):<EOL><INDENT>return com.asarray_tuplesafe(window).astype(float)<EOL><DEDENT>elif is_integer(window):<EOL><INDENT>import scipy.signal as sig<EOL>def _validate_win_type(win_type, kwargs):<EOL><INDENT>arg_map = {'<STR_LIT>': ['<STR_LIT>'],<EOL>'<STR_LIT>': ['<STR_LIT>'],<EOL>'<STR_LIT>': ['<STR_LIT>', '<STR_LIT:width>'],<EOL>'<STR_LIT>': ['<STR_LIT:width>']}<EOL>if win_type in arg_map:<EOL><INDENT>return tuple([win_type] + _pop_args(win_type,<EOL>arg_map[win_type],<EOL>kwargs))<EOL><DEDENT>return win_type<EOL><DEDENT>def _pop_args(win_type, arg_names, kwargs):<EOL><INDENT>msg = '<STR_LIT>' % win_type<EOL>all_args = []<EOL>for n in arg_names:<EOL><INDENT>if n not in kwargs:<EOL><INDENT>raise ValueError(msg % n)<EOL><DEDENT>all_args.append(kwargs.pop(n))<EOL><DEDENT>return all_args<EOL><DEDENT>win_type = _validate_win_type(self.win_type, kwargs)<EOL>return sig.get_window(win_type, window, False).astype(float)<EOL><DEDENT>
Provide validation for our window type, return the window
we have already been validated.