code: def transform(self, fseries, norm=True, epoch=None):
          
          from ..timeseries import TimeSeries
  
          windowed = fseries[self.get_data_indices()] * self.get_window()
          # pad data, move negative frequencies to the end, and IFFT
          padded = numpy.pad(windowed, self.padding, mode='constant')
          wenergy = npfft.ifftshift(padded)
          # return a `TimeSeries`
          if epoch is None:
              epoch = fseries.epoch
          tdenergy = npfft.ifft(wenergy)
          cenergy = TimeSeries(tdenergy, x0=epoch,
                               dx=self.duration/tdenergy.size, copy=False)
          energy = type(cenergy)(
              cenergy.value.real ** 2. + cenergy.value.imag ** 2.,
              x0=cenergy.x0, dx=cenergy.dx, copy=False)
  
          if norm:
              norm = norm.lower() if isinstance(norm, string_types) else norm
              if norm in (True, 'median'):
                  narray = energy / energy.median()
              elif norm in ('mean',):
                  narray = energy / energy.mean()
              else:
                  raise ValueError("Invalid normalisation %r" % norm)
              return narray.astype("float32", casting="same_kind", copy=False)
          return energy
docs: Calculate the energy `TimeSeries` for the given fseries
  
          Parameters
          ----------
          fseries : `~gwpy.frequencyseries.FrequencySeries`
              the complex FFT of a time-series data set
  
          norm : `bool`, `str`, optional
              normalize the energy of the output by the median (if `True` or
              ``'median'``) or the ``'mean'``, if `False` the output
              is the energy (power) of the Q-tranform
  
          epoch : `~gwpy.time.LIGOTimeGPS`, `float`, optional
              the epoch of these data, only used for metadata in the output
              `TimeSeries`, and not requires if the input `fseries` has the
              epoch populated.
  
          Returns
          -------
          energy : `~gwpy.timeseries.TimeSeries`
              a `TimeSeries` of the energy from the Q-transform of
              this tile against the data.