def get_obj_map_key(obj, class_map):
    """Resolve the key (or label) of an object via a key-class map."""
    for k, v in class_map.items():
        if isinstance(obj, v):
            return k
    return obj