code: def test_serialize_deserialize_group():
      with tmpfile() as fn:
          create_test_dataset(fn)
          with netCDF4.Dataset(fn, mode="r") as f:
              for path in ["group", "group/group1"]:
                  g = f[path]
                  h = deserialize(*serialize(g))
                  assert isinstance(h, netCDF4.Group)
                  assert h.name == g.name
                  assert list(g.groups) == list(h.groups)
                  assert list(g.variables) == list(h.variables)
  
              vars = [
                  f.variables["x"],
                  f["group"].variables["y"],
                  f["group/group1"].variables["z"],
              ]
  
              for x in vars:
                  y = deserialize(*serialize(x))
                  assert isinstance(y, netCDF4.Variable)
                  assert y.dimensions == ("x",)
                  assert x.dtype == y.dtype
                  assert (x[:] == y[:]).all()
  
file_path: distributed/distributed/protocol/tests/test_netcdf4.py
imports: from __future__ import annotations
  import pytest
  from dask.utils import tmpfile
  from distributed.protocol import deserialize, serialize
  import dask.array
  from distributed.utils_test import gen_cluster
label_desc: Use image node_id 4 for calling a global function with example usage: test_serialize_deserialize_group() without return types