code: def get_data_features_and_images(cfg: AttrDict):
      output_dir = get_checkpoint_folder(cfg)
      split = cfg.RANKING.FEATURES.DATA_PARTITION
      logging.info("Merging features...")
      # merge the features across all nodes/gpus into one
      feature_data = merge_features(
          output_dir, split.lower(), cfg.RANKING.FEATURES.LAYER_NAME
      )
  
      logging.info("Getting the image paths...")
      # get the list of image Ids
      dataset = build_dataset(cfg=cfg, split=split)
      feature_image_paths = dataset.get_image_paths()
      # due to multi-modality, we get image_paths as a nested list, one for each
      # dataset. Check it's a list and extract images.
      assert (
          type(feature_image_paths) == list
      ), "Image paths must be a list"
      assert (
          len(feature_image_paths) == 1
      ), "Multi-modality not supported yet!"
      return feature_data, feature_image_paths[0]
  
imports: import logging
  import sys
  from argparse import Namespace
  from typing import Any, List
  import numpy
  from hydra.experimental import compose, initialize_config_module
  from sklearn.decomposition import PCA
  from vissl.config import AttrDict
  from vissl.data import build_dataset
  from vissl.hooks import default_hook_generator
  from vissl.utils.checkpoint import get_checkpoint_folder
  from vissl.utils.distributed_launcher import launch_distributed
  from vissl.utils.env import set_env_vars
  from vissl.utils.hydra_config import convert_to_attrdict, is_hydra_available
  from vissl.utils.io import save_file
  from vissl.utils.logger import setup_logging, shutdown_logging
  from vissl.utils.misc import is_faiss_available, merge_features, set_seeds
label_desc: Use image node_id 1 for calling a global function with example usage: get_data_features_and_images(cfg) and returns: feature_data,  feature_image_paths