code: def get_all_pairs_indices(labels, ref_labels=None):
      """
      Given a tensor of labels, this will return 4 tensors.
      The first 2 tensors are the indices which form all positive pairs
      The second 2 tensors are the indices which form all negative pairs
      """
      matches, diffs = get_matches_and_diffs(labels, ref_labels)
      a1_idx, p_idx = torch.where(matches)
      a2_idx, n_idx = torch.where(diffs)
      return a1_idx, p_idx, a2_idx, n_idx
  
imports: import math
  import numpy
  import torch
  from .None import common_functions
label_desc: Use image node_id 4 for calling a global function with example usage: get_all_pairs_indices(labels, ref_labels) and returns: a1_idx,  p_idx,  a2_idx,  n_idx