code: def recover_global_matching_second():
      """
      Match each encoded image with its original encoded image,
      but better by relying on the global permutation.
      """
      global global_matching_second, global_matching
  
      ys_fix = []
      for i in range(ys_image.shape[0]):
          ys_fix.append(ys_image[i][global_permutation])
      ys_fix = np.array(ys_fix)
  
      print(xs_image.shape)
  
      sims = []
      for i in range(0, len(xs_image), 10):
          tmp = np.mean(
              xs_image[None, :, :, :]
              * ys_fix[i : i + 10][:, None, :, :],
              axis=(2, 3),
          )
          sims.extend(tmp)
      sims = np.array(sims)
      print(sims.shape)
  
      row, col = scipy.optimize.linear_sum_assignment(-sims)
  
      print("arg", sims.argmax(1))
  
      print("Same matching frac", np.mean(col == global_matching))
      print(col)
      global_matching = col
  
imports: import collections
  import hashlib
  import time
  import multiprocessing
  import torch
  import numpy
  import torch.nn
  import scipy.stats
  import matplotlib.pyplot
  from PIL import Image
  import jax
  import jax.numpy
  import objax
  import scipy.optimize
  import numpy
  import multiprocessing
label_desc: Use image node_id 15 for calling a global function with example usage: recover_global_matching_second() without return types