def METHOD_NAME(tracks, dets, track_indices, detection_indices):
    features = np.array([dets[i].feat for i in detection_indices])
    targets = np.array([tracks[i].id for i in track_indices])
    cost_matrix = self.metric.distance(features, targets)
    cost_matrix = linear_assignment.gate_cost_matrix(
        cost_matrix,
        tracks,
        dets,
        track_indices,
        detection_indices,
        self.mc_lambda,
    )
    return cost_matrix