code: def export_curves_rlzs(self, aids, key):
          
          if 'loss_curves-stats' in self.dstore:  # classical_risk
              if self.R == 1:
                  data = self.dstore['loss_curves-stats'][aids]  # shape (A, 1)
              else:
                  data = self.dstore['loss_curves-rlzs'][aids]  # shape (A, R)
              if key.startswith('rlz-'):
                  rlzi = int(key[4:])
                  return {key: data[:, rlzi]}
              # else key == 'rlzs', returns all data
              return {'rlz-%03d' % rlzi: data[:, rlzi] for rlzi in range(self.R)}
  
          # otherwise event_based
          curves = self.dstore['curves-rlzs'][aids]  # shape (A, R, P)
          if key.startswith('rlz-'):
              rlzi = int(key[4:])
              return {'rlz-%03d' % rlzi: curves[:, rlzi]}
          else:  # key is 'rlzs', return a dictionary will all realizations
              # this may be disabled in the future unless an asset is specified
              dic = {}
              for rlzi in range(self.R):
                  dic['rlz-%03d' % rlzi] = curves[:, rlzi]
              return dic
docs: :returns: a dictionary key -> record of dtype loss_curve_dt