@das.register(DatasetType)
def _datasettype(var, level=0):
    (yield '{indent}Attributes {{\n'.format(indent=(level * INDENT)))
    for attr in sorted(var.attributes.keys()):
        values = var.attributes[attr]
        for line in build_attributes(attr, values, (level + 1)):
            (yield line)
    for child in var.children():
        for line in das(child, level=(level + 1)):
            (yield line)
    (yield '{indent}}}\n'.format(indent=(level * INDENT)))
@das.register(DatasetType)
def _datasettype(var, level=0):
    (yield '{indent}Attributes {{\n'.format(indent=(level * INDENT)))
    for attr in sorted(var.attributes.keys()):
        values = var.attributes[attr]
        for line in build_attributes(attr, values, (level + 1)):
            (yield line)
    for child in var.children():
        for line in das(child, level=(level + 1)):
            (yield line)
    (yield '{indent}}}\n'.format(indent=(level * INDENT)))