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