def _get_dict_from_protolongtolongmultimap(proto_map):
    """
    Convert the ProtoLongToLongMultiMap_pb2 type to a simple dict.
    """
    if len(proto_map.keys.elements) != len(proto_map.values):
        raise IndexError('array length mismatch')
    new_dict = {}
    for key, array_value in zip(proto_map.keys.elements, proto_map.values):
        value_list = []
        for value in array_value.elements:
            value_list.append(value)
        new_dict[key] = value_list
    return new_dict
