code: def recover_closest_one_dataset(
      feature_matrix_all,
      image_paths,
      save_path,
      n_image_samples=10,
      n_closest=3,
  ):
      """
      Provide sample recoveries.
  
      Args:
          feature_matrix_all: np.ndarray [n_samples x embed_dim], full data embedding of test samples.
          image_paths:        list [n_samples], list of datapaths corresponding to <feature_matrix_all>
          save_path:          str, where to store sample image.
          n_image_samples:    Number of sample recoveries.
          n_closest:          Number of closest recoveries to show.
      Returns:
          Nothing!
      """
      image_paths = np.array([x[0] for x in image_paths])
      sample_idxs = np.random.choice(
          np.arange(len(feature_matrix_all)), n_image_samples
      )
  
      faiss_search_index = faiss.IndexFlatL2(
          feature_matrix_all.shape[-1]
      )
      faiss_search_index.add(feature_matrix_all)
      _, closest_feature_idxs = faiss_search_index.search(
          feature_matrix_all, n_closest + 1
      )
  
      sample_paths = image_paths[closest_feature_idxs][sample_idxs]
  
      f, axes = plt.subplots(n_image_samples, n_closest + 1)
      for i, (ax, plot_path) in enumerate(
          zip(axes.reshape(-1), sample_paths.reshape(-1))
      ):
          ax.imshow(np.array(Image.open(plot_path)))
          ax.set_xticks([])
          ax.set_yticks([])
          if i % (n_closest + 1):
              ax.axvline(x=0, color="g", linewidth=13)
          else:
              ax.axvline(x=0, color="r", linewidth=13)
      f.set_size_inches(10, 20)
      f.tight_layout()
      f.savefig(save_path)
      plt.close()
  
imports: import warnings
  import csv
  import datetime
  import os
  import pickle
  import faiss
  import matplotlib.pyplot
  import numpy
  import torch
  from PIL import Image
  from sklearn import metrics
  from torch import nn
  from tqdm import tqdm
  import pdb
label_desc: Use image node_id 7 for calling a global function with example usage: recover_closest_one_dataset(feature_matrix_all, image_paths, save_path, n_image_samples, n_closest) without return types