code: def test_merge_features(self) -> None:
      with in_temporary_directory() as temp_dir:
          # Save the data we need to merge back
          indices, features, targets = self.prepare_data(
              split="train",
              layer="heads",
              num_shards=4,
              feat_shape=(10, 16),
          )
  
          # Load the data and verify that it is identical
          output = ExtractedFeaturesLoader.load_features(
              input_dir=temp_dir, split="train", layer="heads"
          )
          self.assertEqual(output["features"].shape[0], 40)
          self.assertTrue(np.array_equal(output["inds"], indices))
          self.assertTrue(np.array_equal(output["targets"], targets))
          self.assertTrue(np.allclose(output["features"], features))
  
          # Sample the all data (no sampling) and check that it is identical
          output = ExtractedFeaturesLoader.sample_features(
              input_dir=temp_dir,
              split="train",
              layer="heads",
              num_samples=-1,
              seed=0,
          )
          self.assertEqual(output["features"].shape[0], 40)
          self.assertTrue(np.array_equal(output["inds"], indices))
          self.assertTrue(np.array_equal(output["targets"], targets))
          self.assertTrue(np.allclose(output["features"], features))
  
file_path: vissl/tests/test_extract_features_utils.py
imports: import os
  import unittest
  from typing import Tuple
  import numpy
  from vissl.utils.extract_features_utils import ExtractedFeaturesLoader
  from vissl.utils.io import save_file
  from vissl.utils.test_utils import in_temporary_directory
label_desc: Use image node_id 3 for calling the TestExtractFeatureUtils obj's underlying member method code with example usage: obj.test_merge_features() without return types