code: def test_LRU_cache4(self):
      # test if fetching the plan will reorder it to the top
      cache = config.get_plan_cache()
      assert cache.get_curr_size() == 0 <= cache.get_size()
  
      # this creates a Plan1d
      a = testing.shaped_random((10,), cupy, cupy.float32)
      cupy.fft.fft(a)
      assert cache.get_curr_size() == 1 <= cache.get_size()
  
      # this creates a PlanNd
      a = testing.shaped_random((10, 20), cupy, cupy.float32)
      cupy.fft.fftn(a)
      assert cache.get_curr_size() == 2 <= cache.get_size()
  
      # The first in the cache is the most recently used one;
      # using an iterator to access the linked list guarantees that
      # we don't alter the cache order
      iterator = iter(cache)
      assert isinstance(next(iterator)[1].plan, cufft.PlanNd)
      assert isinstance(next(iterator)[1].plan, cufft.Plan1d)
      with pytest.raises(StopIteration):
          next(iterator)
  
      # this brings Plan1d to the top
      a = testing.shaped_random((10,), cupy, cupy.float32)
      cupy.fft.fft(a)
      assert cache.get_curr_size() == 2 <= cache.get_size()
      iterator = iter(cache)
      assert isinstance(next(iterator)[1].plan, cufft.Plan1d)
      assert isinstance(next(iterator)[1].plan, cufft.PlanNd)
      with pytest.raises(StopIteration):
          next(iterator)
  
      # An LRU cache guarantees that such a silly operation never
      # raises StopIteration
      iterator = iter(cache)
      for i in range(100):
          cache[next(iterator)[0]]
  
imports: import contextlib
  import io
  import queue
  import threading
  import unittest
  import pytest
  import cupy
  from cupy import testing
  from cupy.cuda import cufft
  from cupy.cuda import device
  from cupy.cuda import runtime
  from cupy.fft import config
  from .test_fft import multi_gpu_config, _skip_multi_gpu_bug
label_desc: Use image node_id 6 for calling the TestPlanCache obj's underlying member method code with example usage: obj.test_LRU_cache4() without return types