code: def compute(self, gsim, num_events, seed=None):
          
          try:  # read the seed from self.rupture.serial
              seed = seed or self.rupture.serial
          except AttributeError:
              pass
          if seed is not None:
              numpy.random.seed(seed)
          result = numpy.zeros((len(self.imts), len(self.sids), num_events), F32)
          sig = numpy.zeros((len(self.imts), num_events), F32)
          eps = numpy.zeros((len(self.imts), num_events), F32)
          for imti, imt in enumerate(self.imts):
              if isinstance(gsim, MultiGMPE):
                  gs = gsim[str(imt)]  # MultiGMPE
              else:
                  gs = gsim  # regular GMPE
              try:
                  result[imti], sig[imti], eps[imti] = self._compute(
                      None, gs, num_events, imt)
              except Exception as exc:
                  raise exc.__class__(
                      '%s for %s, %s, srcidx=%s' % (exc, gs, imt, self.srcidx)
                  ).with_traceback(exc.__traceback__)
          return result, sig, eps
docs: :param gsim: a GSIM instance
          :param num_events: the number of seismic events
          :param seed: a random seed or None
          :returns:
              a 32 bit array of shape (num_imts, num_sites, num_events) and
              two arrays with shape (num_imts, num_events): sig for stddev_inter
              and eps for the random part