def flat_datasets(datasets):
    """
    Returns a list of all datasets in this catalog
    """
    flat_ds = []
    for ds in datasets:
        if ds.is_collection():
            flat_ds.extend(flat_datasets(ds.datasets))
        else:
            flat_ds.append(ds)
    return flat_ds