# Buggy code
def available_composite_ids(self, available_datasets=None):
    """Get names of compositors that can be generated from the available
    datasets.

    :return: generator of available compositor's names
    """
    if available_datasets is None:
        available_datasets = self.available_dataset_ids(composites=False)
    else:
        if not all(isinstance(ds_id, DatasetID) for ds_id in available_datasets):
            raise ValueError("'available_datasets' must all be DatasetID objects")

    all_comps = self.all_composite_ids()
    # recreate the dependency tree so it doesn't interfere with the user's
    # wishlist
    comps, mods = self.cpl.load_compositors(self.info["sensor"])
    dep_tree = DependencyTree(self.readers, comps, mods)
    unknowns = dep_tree.find_dependencies(set(available_datasets + all_comps))
    available_comps = set(x.name for x in dep_tree.trunk())
    # get rid of modified composites that are in the trunk
    return sorted(available_comps & set(all_comps))


# Traceback (AttributeError)
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF.
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save.
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save.
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-24-58ece08c15f3> in <module>()
----> 1 lcl.save_datasets(writer='cf', filename='/tmp/foo.nc')

/home/lahtinep/Software/pytroll/packages/satpy/satpy/scene.pyc in save_datasets(self, writer, datasets, **kwargs)
632             datasets = self.datasets.values()
633         writer = self.get_writer(writer, **kwargs)
--> 634         writer.save_datasets(datasets, **kwargs)
635
636     def get_writer(self, writer="geotiff", **kwargs):

/home/lahtinep/Software/pytroll/packages/satpy/satpy/writers/cf_writer.pyc in save_datasets(self, datasets, filename, **kwargs)
176                     coords = [line_coord, pixel_coord]
177
--> 178                 domain = cf.Domain(dim=coords,
179                                    aux=aux,
180                                    ref=grid_mapping)

AttributeError: 'module' object has no attribute 'Domain'

# Fixed code
def available_composite_ids(self, available_datasets=None):
    """Get names of compositors that can be generated from the available
    datasets.

    :return: generator of available compositor's names
    """
    if available_datasets is None:
        available_datasets = self.available_dataset_ids(composites=False)
    else:
        if not all(isinstance(ds_id, DatasetID) for ds_id in available_datasets):
            raise ValueError("'available_datasets' must all be DatasetID objects")

    all_comps = self.all_composite_ids()
    # recreate the dependency tree so it doesn't interfere with the user's
    # wishlist
    comps, mods = self.cpl.load_compositors(self.attrs["sensor"])
    dep_tree = DependencyTree(self.readers, comps, mods)
    unknowns = dep_tree.find_dependencies(set(available_datasets + all_comps))
    available_comps = set(x.name for x in dep_tree.trunk())
    # get rid of modified composites that are in the trunk
    return sorted(available_comps & set(all_comps))