code: def test_itemset_no_segfault_on_readonly():
      # Regression test for ticket #1202.
      # Open the test file in read-only mode.
      filename = pjoin(TEST_DATA_PATH, "example_1.nc")
      with netcdf_file(filename, "r") as f:
          time_var = f.variables["time"]
  
      # time_var.assignValue(42) should raise a RuntimeError--not seg. fault!
      with pytest.raises(RuntimeError):
          time_var.assignValue(42)
  
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 6 for calling a global function with example usage: test_itemset_no_segfault_on_readonly() without return types