@cache(level=<NUM_LIT:10>)<EOL>def get_window(window, Nx, fftbins=True):
if six.callable(window):<EOL><INDENT>return window(Nx)<EOL><DEDENT>elif (isinstance(window, (six.string_types, tuple)) or<EOL>np.isscalar(window)):<EOL><INDENT>return scipy.signal.get_window(window, Nx, fftbins=fftbins)<EOL><DEDENT>elif isinstance(window, (np.ndarray, list)):<EOL><INDENT>if len(window) == Nx:<EOL><INDENT>return np.asarray(window)<EOL><DEDENT>raise ParameterError('<STR_LIT>'<EOL>'<STR_LIT>'.format(len(window), Nx))<EOL><DEDENT>else:<EOL><INDENT>raise ParameterError('<STR_LIT>'.format(window))<EOL><DEDENT>
Compute a window function.

    This is a wrapper for `scipy.signal.get_window` that additionally
    supports callable or pre-computed windows.

    Parameters
    ----------
    window : string, tuple, number, callable, or list-like
        The window specification:

        - If string, it's the name of the window function (e.g., `'hann'`)
        - If tuple, it's the name of the window function and any parameters
          (e.g., `('kaiser', 4.0)`)
        - If numeric, it is treated as the beta parameter of the `'kaiser'`
          window, as in `scipy.signal.get_window`.
        - If callable, it's a function that accepts one integer argument
          (the window length)
        - If list-like, it's a pre-computed window of the correct length `Nx`

    Nx : int > 0
        The length of the window

    fftbins : bool, optional
        If True (default), create a periodic window for use with FFT
        If False, create a symmetric window for filter design applications.

    Returns
    -------
    get_window : np.ndarray
        A window of length `Nx` and type `window`

    See Also
    --------
    scipy.signal.get_window

    Notes
    -----
    This function caches at level 10.

    Raises
    ------
    ParameterError
        If `window` is supplied as a vector of length != `n_fft`,
        or is otherwise mis-specified.