def node_associations(enum):
    """Returns dicts associating nodes -> names and vice versa from an enum.

    Given an enum, returns the dict of names to numbers and numbers to
    names.
    """
    node_to_name = {}
    name_to_node = {}
    for key, value in enum.__dict__.items():
        if not key.startswith('_'):
            node_to_name[value] = key
            name_to_node[key] = value
    return node_to_name, name_to_node
