code: def test_read_write_sio():
      eg_sio1 = BytesIO()
      with make_simple(eg_sio1, "w") as f1:
          str_val = eg_sio1.getvalue()
  
      eg_sio2 = BytesIO(str_val)
      with netcdf_file(eg_sio2) as f2:
          assert_simple_truths(f2)
  
      # Test that error is raised if attempting mmap for sio
      eg_sio3 = BytesIO(str_val)
      with pytest.raises(ValueError):
          netcdf_file(eg_sio3, "r", True)
      # Test 64-bit offset write / read
      eg_sio_64 = BytesIO()
      with make_simple(eg_sio_64, "w", version=2) as f_64:
          str_val = eg_sio_64.getvalue()
  
      eg_sio_64 = BytesIO(str_val)
      with netcdf_file(eg_sio_64) as f_64:
          assert_simple_truths(f_64)
          assert f_64.version_byte == 2
      # also when version 2 explicitly specified
      eg_sio_64 = BytesIO(str_val)
      with netcdf_file(eg_sio_64, version=2) as f_64:
          assert_simple_truths(f_64)
          assert f_64.version_byte == 2
  
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 4 for calling a global function with example usage: test_read_write_sio() without return types