def list_datasets(group, prefix="", res=None):
    """Return a list of all datasets under the specified group"""
    if res is None:
        res = []
    # Loop over objects in the group
    for (name,obj) in group.iteritems():
        if hasattr(obj, "shape"):
            # Dataset, so record name
            res.append(str(prefix+"/"+name))
        if hasattr(obj, "keys"):
            # Group, so recursively examine it
            list_datasets(obj, str(prefix+"/"+name), res)
    return res