code: def test_storage_memory(self):
      # We want 10 projections, 20 results at least
      rbpt = RandomBinaryProjectionTree("testHash", 10, 20)
  
      # Create engine for 100 dimensional feature space
      self.engine = Engine(
          100, lshashes=[rbpt], vector_filters=[NearestFilter(20)]
      )
  
      # First insert 2000 random vectors
      for k in range(2000):
          x = numpy.random.randn(100)
          x_data = "data"
          self.engine.store_vector(x, x_data)
  
      self.memory.store_hash_configuration(rbpt)
  
      rbpt2 = RandomBinaryProjectionTree(None, None, None)
      rbpt2.apply_config(
          self.memory.load_hash_configuration("testHash")
      )
  
      self.assertEqual(rbpt.dim, rbpt2.dim)
      self.assertEqual(rbpt.hash_name, rbpt2.hash_name)
      self.assertEqual(rbpt.projection_count, rbpt2.projection_count)
  
      for i in range(rbpt.normals.shape[0]):
          for j in range(rbpt.normals.shape[1]):
              self.assertEqual(rbpt.normals[i, j], rbpt2.normals[i, j])
  
      # Now do random queries and check result set size
      for k in range(10):
          x = numpy.random.randn(100)
          keys1 = rbpt.hash_vector(x, querying=True)
          keys2 = rbpt2.hash_vector(x, querying=True)
          self.assertEqual(len(keys1), len(keys2))
          for k in range(len(keys1)):
              self.assertEqual(keys1[k], keys2[k])
  
file_path: NearPy/tests/projection_trees_tests.py
imports: import unittest
  import functools
  import numpy
  from nearpy import Engine
  from nearpy.filters import NearestFilter
  from nearpy.hashes import RandomBinaryProjectionTree
  from mockredis import MockRedis
  from nearpy.storage import MemoryStorage, RedisStorage
label_desc: Use image node_id 3 for calling the TestRandomBinaryProjectionTree obj's underlying member method code with example usage: obj.test_storage_memory() without return types