code: def test_inactive_cache(tmpdir, isolated_parso_cache):
      parser_cache.clear()
      test_subjects = "abcdef"
      for path in test_subjects:
          parse(
              "somecode",
              cache=True,
              path=os.path.join(str(tmpdir), path),
          )
      raw_cache_path = os.path.join(isolated_parso_cache, _VERSION_TAG)
      assert os.path.exists(raw_cache_path)
      paths = os.listdir(raw_cache_path)
      a_while_ago = time.time() - _CACHED_FILE_MAXIMUM_SURVIVAL
      old_paths = set()
      for path in paths[
          : len(test_subjects) // 2
      ]:  # make certain number of paths old
          os.utime(
              os.path.join(raw_cache_path, path),
              (a_while_ago, a_while_ago),
          )
          old_paths.add(path)
      # nothing should be cleared while the lock is on
      assert os.path.exists(_get_cache_clear_lock().path)
      _remove_cache_and_update_lock()  # it shouldn't clear anything
      assert len(os.listdir(raw_cache_path)) == len(test_subjects)
      assert old_paths.issubset(os.listdir(raw_cache_path))
  
      os.utime(_get_cache_clear_lock().path, (a_while_ago, a_while_ago))
      _remove_cache_and_update_lock()
      assert len(os.listdir(raw_cache_path)) == len(test_subjects) // 2
      assert not old_paths.intersection(os.listdir(raw_cache_path))
  
imports: import os
  import os.path
  import pytest
  import time
  from parso.cache import _CACHED_FILE_MAXIMUM_SURVIVAL, _VERSION_TAG, _get_cache_clear_lock, _get_hashed_path, _load_from_file_system, _NodeCacheItem, _remove_cache_and_update_lock, _save_to_file_system, load_module, parser_cache, try_to_save_module
  from parso._compatibility import is_pypy, PermissionError
  from parso import load_grammar
  from parso import cache
  from parso import file_io
  from parso import parse
label_desc: Use image node_id 7 for calling a global function with example usage: test_inactive_cache(tmpdir, isolated_parso_cache) without return types