code: def compute_P2(prb_feats, gal_feats, gal_labels, la=3.0):
      X = gal_feats
      neg_vector = {}
      u_labels = np.unique(gal_labels[:, 1])
      P = {}
      for label in u_labels:
          curX = gal_feats[gal_labels[:, 1] == label, :]
          neg_vector[label] = np.mean(curX, axis=0)
          P[label] = np.linalg.inv(
              curX.T.dot(curX) + curX.shape[0] * la * np.eye(X.shape[1])
          )
      return P, neg_vector
  
imports: import os
  import re
  import cv2
  import gc
  import numpy
  import pandas
  from tqdm import tqdm
  import warnings
label_desc: Use image node_id 4 for calling a global function with example usage: compute_P2(prb_feats, gal_feats, gal_labels, la) and returns: P,  neg_vector