code: def wrap_pairs(X, constraints):
      a = np.array(constraints[0])
      b = np.array(constraints[1])
      c = np.array(constraints[2])
      d = np.array(constraints[3])
      constraints = np.vstack(
          (np.column_stack((a, b)), np.column_stack((c, d)))
      )
      y = np.concatenate([np.ones_like(a), -np.ones_like(c)])
      pairs = X[constraints]
      return pairs, y
  
file_path: metric-learn/metric_learn/constraints.py
imports: import numpy
  import warnings
  from sklearn.utils import check_random_state
  from sklearn.neighbors import NearestNeighbors
label_desc: Use image node_id 2 for calling a global function with example usage: wrap_pairs(X, constraints) and returns: pairs,  y