docs: def get_rlzs_by_gsim(self, trt_or_grp_id, sm_id=None):
          """
          :param trt_or_grp_id: a tectonic region type or a source group ID
          :param sm_id: source model ordinal (or None)
          :returns: a dictionary gsim -> rlzs
          """
          if isinstance(trt_or_grp_id, (int, U16, U32)):  # grp_id
              trt = self.csm_info.trt_by_grp[trt_or_grp_id]
              sm_id = self.csm_info.get_sm_by_grp()[trt_or_grp_id]
          else:  # assume TRT string
              trt = trt_or_grp_id
          acc = collections.defaultdict(list)
          if sm_id is None:  # full dictionary
              for rlz, gsim_by_trt in zip(self.realizations, self.gsim_by_trt):
                  acc[gsim_by_trt[trt]].append(rlz.ordinal)
          else:  # dictionary for the selected source model
              for rlz in self.rlzs_by_smodel[sm_id]:
                  gsim_by_trt = self.gsim_by_trt[rlz.ordinal]
                  try:  # if there is a single TRT
                      [gsim] = gsim_by_trt.values()
                  except ValueError:  # there is more than 1 TRT
                      gsim = gsim_by_trt[trt]
                  acc[gsim].append(rlz.ordinal)
          return {gsim: numpy.array(acc[gsim], dtype=U16)
                  for gsim in sorted(acc)}