code: def _scipy_raised_cosine(length, symmetric=True, a=0.5, b=0.5):
      """A simple implementation of a raised cosine window that matches SciPy.
  
      https://en.wikipedia.org/wiki/Window_function#Hann_window
      https://github.com/scipy/scipy/blob/v0.14.0/scipy/signal/windows.py#L615
  
      Args:
        length: The window length.
        symmetric: Whether to create a symmetric window.
        a: The alpha parameter of the raised cosine window.
        b: The beta parameter of the raised cosine window.
  
      Returns:
        A raised cosine window of length `length`.
      """
      if length == 1:
          return np.ones(1)
      odd = length % 2
      if not symmetric and not odd:
          length += 1
      window = a - b * np.cos(
          2.0 * np.pi * np.arange(length) / (length - 1)
      )
      if not symmetric and not odd:
          window = window[:-1]
      return window
  
imports: import functools
  import itertools
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import test_util
  from tensorflow.python.kernel_tests.signal import test_util
  from tensorflow.python.ops.signal import window_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling a global function with example usage: _scipy_raised_cosine(length, symmetric, a, b) and returns: window, np