code: def _psdn(timeseries, method_func, *args, **kwargs):
      
      # unpack tuple of timeseries for cross spectrum
      try:
          timeseries, other = timeseries
      # or just calculate PSD
      except ValueError:
          return method_func(timeseries, kwargs.pop('nfft'), *args, **kwargs)
      else:
          return method_func(timeseries, other, kwargs.pop('nfft'),
                             *args, **kwargs)
docs: Generate a PSD using a method function with FFT arguments in samples
  
      All arguments are presumed to be in sample counts, not physical units
  
      Parameters
      ----------
      timeseries : `~gwpy.timeseries.TimeSeries`, `tuple`
          the data to process, or a 2-tuple of series to correlate
  
      method_func : `callable`
          the function that will be called to perform the signal processing
  
      *args, **kwargs
          other arguments to pass to ``method_func`` when calling