code: def test_read_write_files(tmp_path):
      fname = str(tmp_path / "simple.nc")
  
      with make_simple(fname, "w") as f:
          pass
      # To read the NetCDF file we just created::
      with netcdf_file(fname) as f:
          # Using mmap is the default
          assert f.use_mmap
          assert_simple_truths(f)
  
      # Now without mmap
      with netcdf_file(fname, mmap=False) as f:
          # Using mmap is the default
          assert not f.use_mmap
          assert_simple_truths(f)
  
      # To read the NetCDF file we just created, as file object, no
      # mmap.  When n * n_bytes(var_type) is not divisible by 4, this
      # raised an error in pupynere 1.0.12 and scipy rev 5893, because
      # calculated vsize was rounding up in units of 4 - see
      # https://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html
      fobj = open(fname, "rb")
      with netcdf_file(fobj) as f:
          # by default, don't use mmap for file-like
          assert not f.use_mmap
          assert_simple_truths(f)
  
file_path: nibabel/nibabel/externals/tests/test_netcdf.py
imports: import os
  from os.path import join, dirname
  from io import BytesIO
  from glob import glob
  from contextlib import contextmanager
  import numpy
  import pytest
  from ..netcdf import netcdf_file
label_desc: Use image node_id 3 for calling a global function with example usage: test_read_write_files(tmp_path) without return types