code: def test_check_memory(tmp_path):
      # Test if _check_memory returns a memory object with the location equal to
      # input path
  
      mem_none = Memory(location=None)
      mem_temp = Memory(location=str(tmp_path))
  
      for mem in [None, mem_none]:
          memory = cache_mixin._check_memory(mem, verbose=False)
          assert memory, Memory
          assert memory.location == mem_none.location
  
      for mem in [str(tmp_path), mem_temp]:
          memory = cache_mixin._check_memory(mem, verbose=False)
          assert memory.location == mem_temp.location
          assert memory, Memory
  
file_path: nilearn/nilearn/_utils/tests/test_cache_mixin.py
imports: import os
  import shutil
  from pathlib import Path
  import pytest
  from joblib import Memory
  import nilearn
  from nilearn._utils import CacheMixin, cache_mixin
label_desc: Use image node_id 3 for calling a global function with example usage: test_check_memory(tmp_path) without return types