code: def load_features(feature_dir: str, layer_name: str):
      train_out = ExtractedFeaturesLoader.load_features(
          feature_dir, "train", layer_name, flatten_features=True
      )
      train_features, train_labels = (
          train_out["features"],
          train_out["targets"],
      )
      test_out = ExtractedFeaturesLoader.load_features(
          feature_dir, "test", layer_name, flatten_features=True
      )
      test_features, test_labels = (
          test_out["features"],
          test_out["targets"],
      )
      return train_features, train_labels, test_features, test_labels
  
imports: import logging
  import os
  import numpy
  from vissl.config import AttrDict
  from vissl.hooks import default_hook_generator
  from vissl.models.model_helpers import get_trunk_output_feature_names
  from vissl.utils.checkpoint import get_checkpoint_folder
  from vissl.utils.distributed_launcher import create_submitit_executor, launch_distributed
  from vissl.utils.env import set_env_vars
  from vissl.utils.extract_features_utils import ExtractedFeaturesLoader
  from vissl.utils.hydra_config import print_cfg
  from vissl.utils.logger import setup_logging, shutdown_logging
  from vissl.utils.svm_utils.svm_trainer import SVMTrainer
label_desc: Use image node_id 1 for calling a global function with example usage: load_features(feature_dir, layer_name) and returns: train_features,  train_labels,  test_features,  test_labels