code: def get_data_features_for_k_means(cfg: AttrDict):
      """
      Sample the extract features from disk by reading through the
      extracted feature shards and return a sub-set
      """
      return ExtractedFeaturesLoader.sample_features(
          input_dir=cfg.CLUSTERFIT.FEATURES.PATH,
          split=cfg.CLUSTERFIT.FEATURES.DATA_PARTITION.lower(),
          layer=cfg.CLUSTERFIT.FEATURES.LAYER_NAME,
          num_samples=cfg.CLUSTERFIT.DATA_LIMIT,
          seed=cfg.CLUSTERFIT.DATA_LIMIT_SAMPLING.SEED,
          flatten_features=True,
      )
  
imports: import logging
  import os
  import sys
  from argparse import Namespace
  from typing import Any, List, Optional
  import numpy
  import torch
  from iopath.common.file_io import g_pathmgr
  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, setup_path_manager
  from vissl.utils.extract_features_utils import ExtractedFeaturesLoader
  from vissl.utils.hydra_config import compose_hydra_configuration, convert_to_attrdict
  from vissl.utils.io import save_file
  from vissl.utils.logger import setup_logging, shutdown_logging
  from vissl.utils.misc import is_faiss_available, set_seeds
  from vissl.utils.pca import PCA
label_desc: Use image node_id 1 for calling a global function with example usage: get_data_features_for_k_means(cfg) and returns: ExtractedFeaturesLoader