def to_value_map(enum):
    """Create value map from enumerated type."""
    value_map = dict(zip(tuple(enum), enum._fields))
    if -1 not in value_map:
        value_map[-1] = None
    return value_map