code: def _normalize_overlap(overlap, window, nfft, samp, method='welch'):
      
      if method == 'bartlett':
          return 0
      if overlap is None and isinstance(window, string_types):
          return recommended_overlap(window, nfft)
      if overlap is None:
          return 0
      return seconds_to_samples(overlap, samp)
docs: Normalise an overlap in physical units to a number of samples
  
      Parameters
      ----------
      overlap : `float`, `Quantity`, `None`
          the overlap in some physical unit (seconds)
  
      window : `str`
          the name of the window function that will be used, only used
          if `overlap=None` is given
  
      nfft : `int`
          the number of samples that will be used in the fast Fourier
          transform
  
      samp : `Quantity`
          the sampling rate (Hz) of the data that will be transformed
  
      method : `str`
          the name of the averaging method, default: `'welch'`, only
          used to return `0` for `'bartlett'` averaging
  
      Returns
      -------
      noverlap : `int`
          the number of samples to be be used for the overlap