code: def _get_misclassifications_group(
      self, original_preds, generated_preds, attacks_applied
  ):
      results = list(
          zip(original_preds, generated_preds, attacks_applied)
      )
      attacks_used = flatten_unique(attacks_applied)
      misclassifications_group = dict(
          [(",".join(sorted(att)), 0) for att in attacks_applied]
      )
      always_wrong_group = copy(misclassifications_group)
      never_wrong_group = copy(misclassifications_group)
      for i, res in enumerate(results):
          original, generated, applied = res[0], res[1], res[2]
          if original == 1 and generated == 0:
              misclassifications_group[",".join(sorted(applied))] += 1
          elif original == 1 and generated == 1:
              always_wrong_group[",".join(sorted(applied))] += 1
          elif original == 0 and generated == 0:
              never_wrong_group[",".join(sorted(applied))] += 1
  
      cols = sorted(attacks_used) + [
          "Caused Misclassifications",
          "Always Misclassified",
          "Never Misclassified",
      ]
      all_combos = combinations_of_len(
          attacks_used, max([len(res[2]) for res in results])
      )
      misclassifications_df_list = []
      for i, combo in enumerate(all_combos):
          row = [" "] * len(cols)
          for att in combo:
              row[cols.index(att)] = "X"
          row[-3] = misclassifications_group.get(
              ",".join(sorted(combo)), 0
          )
          row[-2] = never_wrong_group.get(",".join(sorted(combo)), 0)
          row[-1] = always_wrong_group.get(",".join(sorted(combo)), 0)
          misclassifications_df_list.append(row)
      misclassifications_df_list = sorted(
          misclassifications_df_list, key=lambda x: x[-3], reverse=True
      )
  
      cols_fancy = fancy_titles(cols)
      df = pd.DataFrame(misclassifications_df_list, columns=cols_fancy)
      return df
  
file_path: artificial-adversary/Adversary/adversary.py
imports: from copy import copy
  from functools import partial
  from random import random, seed
  import pandas
  from textblob import TextBlob
  from Adversary.attacks import *
  from Adversary.utils import *
label_desc: Use image node_id 8 for calling the Adversary obj's underlying member method code with example usage: obj._get_misclassifications_group(original_preds, generated_preds, attacks_applied) and returns: df