code: def generate_window(length, window=None, dtype='float64'):
      
      from ...utils.lal import (find_typed_function, to_lal_type_str)
  
      if window is None:
          window = ('kaiser', 24)
  
      # generate key for caching window
      laltype = to_lal_type_str(dtype)
      key = (length, str(window), laltype)
  
      # find existing window
      try:
          return LAL_WINDOWS[key]
      # or create one
      except KeyError:
          # parse window as name and arguments, e.g. ('kaiser', 24)
          if isinstance(window, (list, tuple)):
              window, beta = window
          else:
              beta = 0
          window = canonical_name(window)
          # create window
          create = find_typed_function(dtype, 'CreateNamed', 'Window')
          LAL_WINDOWS[key] = create(window, beta, length)
          return LAL_WINDOWS[key]
docs: Generate a time-domain window for use in a LAL FFT
  
      Parameters
      ----------
      length : `int`
          length of window in samples.
  
      window : `str`, `tuple`
          name of window to generate, default: ``('kaiser', 24)``. Give
          `str` for simple windows, or tuple of ``(name, *args)`` for
           complicated windows
  
      dtype : :class:`numpy.dtype`
          numeric type of window, default `numpy.dtype(numpy.float64)`
  
      Returns
      -------
      `window` : `REAL8Window` or similar
          time-domain window to use for FFT