def get_util(nodes):
    """ Return a tuple of cpu and memory percent values.
    """
    all_metrics = {'total_cpus_alloc': 0, 'total_cpus_idle': 0,
        'total_cpus_down': 0, 'total_cpus_config': 0, 'total_memory_alloc':
        0, 'total_memory_idle': 0, 'total_memory_down': 0,
        'total_memory_config': 0, 'total_nodes_mixed': 0,
        'total_nodes_alloc': 0, 'total_nodes_idle': 0, 'total_nodes_down': 
        0, 'total_nodes_config': 0}
    for node in nodes:
        nodeinfo = nodes.get(node)
        state = nodeinfo.get('state').upper()
        cpus_alloc = nodeinfo.get('alloc_cpus')
        cpus_total = nodeinfo.get('cpus')
        memory_alloc = nodeinfo.get('alloc_mem')
        memory_real = nodeinfo.get('real_memory')
        all_metrics['total_nodes_config'] += 1
        all_metrics['total_cpus_config'] += cpus_total
        all_metrics['total_memory_config'] += memory_real
        if 'DOWN' in state or 'DRAIN' in state:
            all_metrics['total_nodes_down'] += 1
            all_metrics['total_cpus_down'] += cpus_total
            all_metrics['total_memory_down'] += memory_real
        else:
            all_metrics['total_cpus_alloc'] += cpus_alloc
            all_metrics['total_cpus_idle'] += cpus_total - cpus_alloc
            all_metrics['total_memory_alloc'] += memory_alloc
            all_metrics['total_memory_idle'] += memory_real - memory_alloc
            if 'ALLOCATED' in state:
                all_metrics['total_nodes_alloc'] += 1
            elif 'MIXED' in state:
                all_metrics['total_nodes_mixed'] += 1
            elif 'IDLE' in state:
                all_metrics['total_nodes_idle'] += 1
    return all_metrics
