code: def _img_3d_rand(affine=_affine_eye()):
      """Return random 3D Nifti1Image in MNI space.
  
      Mostly used for set up in other fixtures in other testing modules.
      """
      data = _rng().random(_shape_3d_default())
      return Nifti1Image(data, affine)
  
imports: import warnings
  import nibabel
  import numpy
  import pytest
  from nibabel import Nifti1Image
  from nilearn import image
  from nilearn.datasets.tests._testing import request_mocker
  from nilearn.datasets.tests._testing import temp_nilearn_data_dir
  from nilearn.experimental.surface.tests.conftest import make_mini_img, mini_img, mini_mesh
label_desc: Use image node_id 19 for calling a global function with example usage: _img_3d_rand(affine) and returns: Nifti1Image