code: def get_all_triplets_indices(labels, ref_labels=None):
      matches, diffs = get_matches_and_diffs(labels, ref_labels)
      triplets = matches.unsqueeze(2) * diffs.unsqueeze(1)
      return torch.where(triplets)
  
imports: import math
  import numpy
  import torch
  from .None import common_functions
label_desc: Use image node_id 9 for calling a global function with example usage: get_all_triplets_indices(labels, ref_labels) and returns: torch