docs: def det_curve(self, cost_miss=100, cost_fa=1, prior_target=0.01,
                    return_latency=False):
          """DET curve
  
          Parameters
          ----------
          cost_miss : float, optional
              Cost of missed detections. Defaults to 100.
          cost_fa : float, optional
              Cost of false alarms. Defaults to 1.
          prior_target : float, optional
              Target trial prior. Defaults to 0.5.
          return_latency : bool, optional
              Set to True to return latency.
              Has no effect when latencies are given at initialization time.
  
          Returns
          -------
          thresholds : numpy array
              Detection thresholds
          fpr : numpy array
              False alarm rate
          fnr : numpy array
              False rejection rate
          eer : float
              Equal error rate
          cdet : numpy array
              Cdet cost function
          speaker_latency : numpy array
          absolute_latency : numpy array
              Speaker and absolute latency when return_latency is set to True.
          """
  
          if self.latencies is None:
  
              y_true = np.array([trial['target'] for _, trial in self])
              scores = np.array([trial['score'] for _, trial in self])
              fpr, fnr, thresholds, eer =  det_curve(y_true, scores, distances=False)
              fpr, fnr, thresholds = fpr[::-1], fnr[::-1], thresholds[::-1]
              cdet = cost_miss * fnr * prior_target + \
                     cost_fa * fpr * (1. - prior_target)
  
              if return_latency:
                  # needed to align the thresholds used in the DET curve
                  # with (self.)thresholds used to compute latencies.
                  indices = np.searchsorted(thresholds, self.thresholds, side='left')
  
                  thresholds = np.take(thresholds, indices, mode='clip')
                  fpr = np.take(fpr, indices, mode='clip')
                  fnr = np.take(fnr, indices, mode='clip')
                  cdet = np.take(cdet, indices, mode='clip')
                  return thresholds, fpr, fnr, eer, cdet, \
                         self.speaker_latency, self.absolute_latency
  
              else:
                  return thresholds, fpr, fnr, eer, cdet
  
          else:
  
              y_true = np.array([trial['target'] for _, trial in self])
              spk_scores = np.array([trial['spk_score'] for _, trial in self])
              abs_scores = np.array([trial['abs_score'] for _, trial in self])
  
              result = {}
              for key, scores in {'speaker': spk_scores,
                                  'absolute': abs_scores}.items():
  
                  result[key] = {}
  
                  for i, latency in enumerate(self.latencies):
                      fpr, fnr, theta, eer =  det_curve(y_true, scores[:, i],
                                                        distances=False)
                      fpr, fnr, theta = fpr[::-1], fnr[::-1], theta[::-1]
                      cdet = cost_miss * fnr * prior_target + \
                             cost_fa * fpr * (1. - prior_target)
                      result[key][latency] = theta, fpr, fnr, eer, cdet
  
              return result