def RestoreFixtureFromCache(self):
    if RunTestsInit.fixture_cache is None:
      # Make a data store snapshot.
      db = data_store.DB.subjects
      data_store.DB.subjects = {}

      self.BuildFixture()
      (RunTestsInit.fixture_cache,
       data_store.DB.subjects) = (data_store.DB.subjects, db)

    # Restore the fixture from the cache
    data_store.DB.subjects.update(copy.deepcopy(RunTestsInit.fixture_cache))
Restores test fixture (by building it or using a cached version).
dataset/ETHPy150Open google/grr/grr/gui/runtests.py/RunTestsInit.RestoreFixtureFromCache