code: def test_high_level_non_parametric_inference_with_paths(tmp_path):
      shapes = (SHAPE,)
      mask, FUNCFILE, _ = write_fake_fmri_data_and_design(
          shapes, file_path=tmp_path
      )
      FUNCFILE = FUNCFILE[0]
      df_input = pd.DataFrame(
          {
              "subject_label": [f"sub-{i}" for i in range(4)],
              "effects_map_path": [FUNCFILE] * 4,
              "map_name": [FUNCFILE] * 4,
          }
      )
      func_img = load(FUNCFILE)
      Y = [func_img] * 4
      X = pd.DataFrame([[1]] * 4, columns=["intercept"])
      c1 = np.eye(len(X.columns))[0]
      neg_log_pvals_imgs = [
          non_parametric_inference(
              second_level_input,
              design_matrix=X,
              second_level_contrast=c1,
              first_level_contrast=FUNCFILE,
              mask=mask,
              n_perm=N_PERM,
              verbose=1,
          )
          for second_level_input in [Y, df_input]
      ]
  
      assert all(
          isinstance(img, Nifti1Image) for img in neg_log_pvals_imgs
      )
      for img in neg_log_pvals_imgs:
          assert_array_equal(img.affine, load(mask).affine)
  
      neg_log_pvals_list = [get_data(i) for i in neg_log_pvals_imgs]
      for neg_log_pvals in neg_log_pvals_list:
          assert np.all(neg_log_pvals <= -np.log10(1.0 / (N_PERM + 1)))
          assert np.all(neg_log_pvals >= 0)
  
imports: import os
  from pathlib import Path
  import numpy
  import pandas
  import pytest
  from nibabel import Nifti1Image, load
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from scipy import stats
  from nilearn._utils import testing
  from nilearn._utils.data_gen import generate_fake_fmri_data_and_design, write_fake_bold_img, write_fake_fmri_data_and_design
  from nilearn.glm.first_level import FirstLevelModel, run_glm
  from nilearn.glm.second_level import SecondLevelModel, non_parametric_inference
  from nilearn.glm.second_level.second_level import _check_confounds, _check_design_matrix, _check_effect_maps, _check_first_level_contrast, _check_input_as_first_level_model, _check_output_type, _check_second_level_input, _infer_effect_maps, _process_second_level_input_as_dataframe, _process_second_level_input_as_firstlevelmodels, _sort_input_dataframe
  from nilearn.image import concat_imgs, get_data, new_img_like, smooth_img
  from nilearn.maskers import NiftiMasker
label_desc: Use image node_id 24 for calling a global function with example usage: test_high_level_non_parametric_inference_with_paths(tmp_path) without return types