def METHOD_NAME(self, annotations, predictions):
    if self.is_cm_computed:
        return
    if len(annotations) != len(predictions):
        raise ValueError(
            "different lengths of annotations and predictions")
    label_list_dict = {}
    for attr in self.attributes:
        label_list_dict[attr] = {
            'annotation': np.zeros_like(annotations),
            'prediction': np.zeros_like(predictions)
        }
    # Create label lists
    for i, (annotation, prediction) in enumerate(zip(annotations, predictions)):
        for attr in self.attributes:
            label_list_dict[attr]['prediction'][i] = prediction[attr].label
            if isinstance(annotation[attr].label, int):
                label_list_dict[attr]['annotation'][i] = annotation[attr].label
            elif hasattr(annotation[attr].label, '__contains__'):
                if prediction[attr].label in annotation[attr].label:
                    label_list_dict[attr]['annotation'][i] = prediction[attr].label
                else:
                    label_list_dict[attr]['annotation'][i] = annotation[attr].label[0]
    # Create confusion matrix for each attribute
    cm_dict = {}
    for attr, label_list in label_list_dict.items():
        cm_dict[attr] = self.confusion_matrix(
            label_list['annotation'], label_list['prediction']
        )
    self.cm_dict = cm_dict
    self.is_cm_computed = True