code: def _initialize_root_netcdf(
      filename, engine, header_attrs, to_netcdf_kwargs
  ):
      """Initialize root empty netCDF."""
      root = xr.Dataset({}, attrs=header_attrs)
      init_nc_kwargs = to_netcdf_kwargs.copy()
      init_nc_kwargs.pop(
          "encoding", None
      )  # No variables to be encoded at this point
      init_nc_kwargs.pop("unlimited_dims", None)
      written = [
          root.to_netcdf(
              filename, engine=engine, mode="w", **init_nc_kwargs
          )
      ]
      return written
  
file_path: satpy/satpy/writers/cf_writer.py
imports: import copy
  import logging
  import warnings
  import numpy
  import xarray
  from packaging.version import Version
  from satpy.cf.coords import EPOCH
  from satpy.writers import Writer
label_desc: Use image node_id 2 for calling a global function with example usage: _initialize_root_netcdf(filename, engine, header_attrs, to_netcdf_kwargs) and returns: written