code: def test_ticket_1720():
      io = BytesIO()
  
      items = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
  
      with netcdf_file(io, "w") as f:
          f.history = "Created for a test"
          f.createDimension("float_var", 10)
          float_var = f.createVariable("float_var", "f", ("float_var",))
          float_var[:] = items
          float_var.units = "metres"
          f.flush()
          contents = io.getvalue()
  
      io = BytesIO(contents)
      with netcdf_file(io, "r") as f:
          assert f.history == b"Created for a test"
          float_var = f.variables["float_var"]
          assert float_var.units == b"metres"
          assert float_var.shape == (10,)
          assert np.allclose(float_var[:], items)
  
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 10 for calling a global function with example usage: test_ticket_1720() without return types