技压群雄的意思是什么| 梦见月经血是什么预兆| 白头发缺什么维生素| 五七年属什么生肖| 抽烟对女生有什么危害| 鼻烟是什么东西| 猫咪为什么害怕黄瓜| 桃胶和什么相克| 熟褐色是什么颜色| 物以类聚是什么意思| 冥冥之中是什么意思| 做梦抓到很多鱼是什么征兆| 气结是什么意思| 2月是什么星座| 狐臭是什么引起的| 榴莲不能跟什么一起吃| 拔牙之前要注意什么| 男人经常熬夜喝什么汤| 潜血阳性是什么意思| 挂面是什么面| 茭白不能和什么一起吃| 7.17什么星座| 糖尿病人吃什么主食| 重心是什么| 血压高吃什么水果| 支气管激发试验阴性是什么意思| 舒服是什么意思| 牙龈肿痛吃什么药好| 双排是什么意思| 减脂晚餐吃什么| 血小板偏高有什么危害| 大蒜泡酒治什么病| 痰核是什么意思| 没有子宫有什么影响| 星座是什么意思| 什么是肝癌| roger是什么意思| 眼睛干痒用什么眼药水比较好| a是什么| 宝宝满周岁送什么礼物| 肺部ct应该挂什么科| 放疗有什么危害| 晚上适合做什么运动| 益生菌有什么功效| 更年期失眠吃什么药调理效果好| 04属什么| 男生做爱什么感觉| 心脏神经官能症吃什么药| 高什么亮什么成语| esd是什么| 报喜鸟属于什么档次| 人黑穿什么颜色的衣服好看| 晨字属于五行属什么| lgg什么意思| 防中暑喝什么| 单抗主要治疗什么| 西瓜不可以和什么同食| 染发有什么危害| 喉咙干咳吃什么药| 维生素b3又叫什么| 心肾不交吃什么药| 孕囊形态欠规则是什么意思| 世界上最大的数是什么| 青云志是什么意思| 备孕检查挂什么科| 高血糖能吃什么| 寂寞难耐是什么意思| 怀孕了胃不舒服是什么原因| 一个月一个亏念什么| 口疮反复发作什么原因| 工装是什么| 扫墓是什么意思| 什么是韧性| 谭震林是什么军衔| 肌酸是什么东西| 解脲脲原体阳性吃什么药| 四个金读什么| 脱发是什么原因引起的| 油漆用什么能洗掉| 夜间睡觉出汗是什么原因| 莴笋什么时候种植| 陶渊明是什么先生| 肾虚有什么症状| 脚趾缝脱皮是什么原因| 补钾用什么药| 电导率低是什么意思| 空谷幽兰下一句是什么| 欧盟是什么| 脑供血不足吃什么药好得快| 女性胃火旺吃什么药| bgo是什么意思| 内痔疮吃什么药最好| 行房时硬度不够是什么原因| 金字旁的字和什么有关| 便是什么意思| 合肥有什么好吃的| 六月种什么菜| 利率是什么意思| 焗油和染发有什么区别| 甲状腺炎吃什么药好| mama是什么意思| 动物园里有什么动物| 晚上睡觉脚抽筋是什么原因| 小腿发痒是什么原因| 男人吃鸽子有什么好处| 举足轻重什么意思| 心灵鸡汤是什么意思| 流产药叫什么名字| 没意思是什么意思| 子宫内膜异位症有什么症状| 药流可以吃什么水果| 67年属什么生肖| 拔智齿后需要注意什么| 正常高压是什么意思| 小孩脸上长痣是什么原因引起的| 煲仔饭用什么米最好| 高血压喝什么茶最好| 梦见死去的朋友是什么意思| 什么叫增值税| 后人是什么意思| 桂林有什么好玩的景点| 刻舟求剑是什么生肖| 久卧伤气是什么意思| 肝内结节是什么意思啊| 霖五行属什么| 人为什么会得白血病| 渐冻症是什么病| 关节积液是什么原因造成的| 乳腺点状钙化是什么意思| 火龙果跟什么榨汁好喝| 讨吃货什么意思| 梦见下雨是什么意思| 磨牙齿是什么原因| 真露兑什么好喝| 睾丸痛吃什么消炎药| 国历是什么意思| 什么茶对胃好| 主动脉夹层是什么病| 儿童铅超标有什么症状| 皮癣用什么药膏| 眼肿是什么原因| 经期肚子疼是什么原因| praal00是什么型号| 男性长期熬夜吃什么好| 马路杀手是什么意思| 回眸一笑百媚生什么意思| 男生生理期是什么表现| 依字五行属什么| 喜欢紫色代表什么| 月球是地球的什么星| 什么是核糖核酸| 乳腺导管扩张吃什么药| 什么人容易得白血病| 孕吐反应什么时候开始| 6.21什么星座| 吃东西就打嗝是什么原因| 天上火是什么意思| philips是什么牌子| 梅毒阳性是什么意思| 牛b克拉斯什么意思| 申时左眼跳是什么预兆| g代表什么| 刺梨果有什么功效| 流氓是什么意思| 说三道四的意思是什么| 梦见杀鸡见血什么征兆| 海洋里面有什么动物| 睫毛炎有什么症状| ba是什么| 艳羡是什么意思| 反复发烧是什么原因引起的| 拉雪橇的狗是什么狗| 四月是什么生肖| 风寒吃什么药| package什么意思| 什么是蜘蛛痣图片| 头疼嗓子疼吃什么药| ic50是什么意思| 副乳是什么原因造成的| 什么是气胸| 胸有成竹什么意思| 8月15号是什么星座| 阻生齿是什么| 什么样的柳树| 妇科养荣胶囊主治什么| 什么人不能吃皮蛋| abo是什么| 香港五行属什么| 菩提树是什么树| 屋上土是什么意思| 咳血是什么原因引起的| 至加秦是什么字| 猫毛过敏吃什么药| 什么情况下做冠脉ct| 双肺纹理增多模糊是什么意思| 月黑见渔灯的见读什么| 吃苹果有什么好处| 女人为什么不会怀孕| 八月十一号是什么星座| 结婚下大雨是什么兆头| 喝藏红花有什么好处| 桂圆补什么| 月经不调是什么原因造成的| 猪肝有什么功效| 姜黄粉是什么| 七岁属什么生肖| 血液四项检查是什么| eb病毒是什么| 武则天原名叫什么| 叕什么意思| 子宫内膜增厚是什么意思| 牛头马面指什么生肖| 灰色是什么颜色调出来的| 胸贴是什么| 小便带血是什么原因女性| 6月24日是什么日子| 玻璃酸钠是什么| 瑜伽是什么| 中年男人遗精是什么原因| 吃柿子有什么好处和坏处| 白茶和绿茶有什么区别| 怕吹空调是什么原因| 肚子胀气吃什么通气| 口苦吃什么中成药| 严重贫血吃什么补的快| 高风亮节是什么意思| 中医七情指的是什么| 北京有什么| 四十年婚姻是什么婚| 黑龙江有什么特产| 梦见自己大肚子快生了是什么意思| 刚出生的宝宝要注意什么| 胰腺检查做什么检查| 为什么打哈欠会传染| 舌头上火了吃什么降火| fte是什么意思| 杨花是什么| 惊喜的英文是什么| 头晕耳鸣是什么原因引起的| 六月十六是什么星座| 牙神经挑了为什么还疼| 隐血阴性是什么意思| 锻炼是什么意思| 好好活着比什么都重要| 吹空调咳嗽是什么原因| 大堤是什么意思| 色字头上一把刀什么意思| 类风湿是什么病| 什么什么多彩| 哭笑不得是什么意思| 什么原因造成低血糖| 归元寺求什么最灵验| 沂字五行属什么| 女同什么意思| 汗毛重的女人意味着什么| 闺蜜什么意思| 脾阴虚吃什么中成药| 乌鸡炖什么好吃又有营养| 辅酶q10是什么| 夫妻少配无刑是什么意思| 没睡好头疼是什么原因| 线索细胞阳性是什么意思| 5.13是什么星座| 促销是什么意思| 百度??????? ?? ?? ????

全国网信系统学习贯彻党的十九大精神宣讲活动走进浪潮集团

???? ????? ???????? ????????? ??
Documentation icon ??????? [?????]
百度 在浙江北部,有一个曾经破旧的小山村,短短几年时间里,就变成了富足美丽的样板村。
------------------------------------------------------------------------------------
--                                   TableTools                                   --
--                                                                                --
-- This module includes a number of functions for dealing with Lua tables.        --
-- It is a meta-module, meant to be called from other Lua modules, and should not --
-- be called directly from #invoke.                                               --
------------------------------------------------------------------------------------

local libraryUtil = require('libraryUtil')

local p = {}

-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti

------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
function p.isPositiveInteger(v)
	return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity
end

------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false if
-- not. Although it doesn't operate on tables, it is included here as it is useful
-- for determining whether a value can be a valid table key. Lua will generate an
-- error if a NaN is used as a table key.
------------------------------------------------------------------------------------
function p.isNan(v)
	return type(v) == 'number' and v ~= v
end

------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
function p.shallowClone(t)
	checkType('shallowClone', 1, t, 'table')
	local ret = {}
	for k, v in pairs(t) do
		ret[k] = v
	end
	return ret
end

------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
function p.removeDuplicates(arr)
	checkType('removeDuplicates', 1, arr, 'table')
	local isNan = p.isNan
	local ret, exists = {}, {}
	for _, v in ipairs(arr) do
		if isNan(v) then
			-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
			ret[#ret + 1] = v
		else
			if not exists[v] then
				ret[#ret + 1] = v
				exists[v] = true
			end
		end
	end
	return ret
end

------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
function p.numKeys(t)
	checkType('numKeys', 1, t, 'table')
	local isPositiveInteger = p.isPositiveInteger
	local nums = {}
	for k in pairs(t) do
		if isPositiveInteger(k) then
			nums[#nums + 1] = k
		end
	end
	table.sort(nums)
	return nums
end

------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will return
-- {1, 3, 6}.
------------------------------------------------------------------------------------
function p.affixNums(t, prefix, suffix)
	checkType('affixNums', 1, t, 'table')
	checkType('affixNums', 2, prefix, 'string', true)
	checkType('affixNums', 3, suffix, 'string', true)

	local function cleanPattern(s)
		-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
		return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
	end

	prefix = prefix or ''
	suffix = suffix or ''
	prefix = cleanPattern(prefix)
	suffix = cleanPattern(suffix)
	local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'

	local nums = {}
	for k in pairs(t) do
		if type(k) == 'string' then
			local num = mw.ustring.match(k, pattern)
			if num then
				nums[#nums + 1] = tonumber(num)
			end
		end
	end
	table.sort(nums)
	return nums
end

------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like {"foo1", "bar1", "foo2", "baz2"}, returns a table
-- of subtables in the format
-- {[1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'}}.
-- Keys that don't end with an integer are stored in a subtable named "other". The
-- compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
function p.numData(t, compress)
	checkType('numData', 1, t, 'table')
	checkType('numData', 2, compress, 'boolean', true)
	local ret = {}
	for k, v in pairs(t) do
		local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
		if num then
			num = tonumber(num)
			local subtable = ret[num] or {}
			if prefix == '' then
				-- Positional parameters match the blank string; put them at the start of the subtable instead.
				prefix = 1
			end
			subtable[prefix] = v
			ret[num] = subtable
		else
			local subtable = ret.other or {}
			subtable[k] = v
			ret.other = subtable
		end
	end
	if compress then
		local other = ret.other
		ret = p.compressSparseArray(ret)
		ret.other = other
	end
	return ret
end

------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
function p.compressSparseArray(t)
	checkType('compressSparseArray', 1, t, 'table')
	local ret = {}
	local nums = p.numKeys(t)
	for _, num in ipairs(nums) do
		ret[#ret + 1] = t[num]
	end
	return ret
end

------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
function p.sparseIpairs(t)
	checkType('sparseIpairs', 1, t, 'table')
	local nums = p.numKeys(t)
	local i = 0
	local lim = #nums
	return function ()
		i = i + 1
		if i <= lim then
			local key = nums[i]
			return key, t[key]
		else
			return nil, nil
		end
	end
end

------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
function p.size(t)
	checkType('size', 1, t, 'table')
	local i = 0
	for _ in pairs(t) do
		i = i + 1
	end
	return i
end

local function defaultKeySort(item1, item2)
	-- "number" < "string", so numbers will be sorted before strings.
	local type1, type2 = type(item1), type(item2)
	if type1 ~= type2 then
		return type1 < type2
	elseif type1 == 'table' or type1 == 'boolean' or type1 == 'function' then
		return tostring(item1) < tostring(item2)
	else
		return item1 < item2
	end
end
------------------------------------------------------------------------------------
-- keysToList
--
-- Returns an array of the keys in a table, sorted using either a default
-- comparison function or a custom keySort function.
------------------------------------------------------------------------------------
function p.keysToList(t, keySort, checked)
	if not checked then
		checkType('keysToList', 1, t, 'table')
		checkTypeMulti('keysToList', 2, keySort, {'function', 'boolean', 'nil'})
	end

	local arr = {}
	local index = 1
	for k in pairs(t) do
		arr[index] = k
		index = index + 1
	end

	if keySort ~= false then
		keySort = type(keySort) == 'function' and keySort or defaultKeySort
		table.sort(arr, keySort)
	end

	return arr
end

------------------------------------------------------------------------------------
-- sortedPairs
--
-- Iterates through a table, with the keys sorted using the keysToList function.
-- If there are only numerical keys, sparseIpairs is probably more efficient.
------------------------------------------------------------------------------------
function p.sortedPairs(t, keySort)
	checkType('sortedPairs', 1, t, 'table')
	checkType('sortedPairs', 2, keySort, 'function', true)

	local arr = p.keysToList(t, keySort, true)

	local i = 0
	return function ()
		i = i + 1
		local key = arr[i]
		if key ~= nil then
			return key, t[key]
		else
			return nil, nil
		end
	end
end

------------------------------------------------------------------------------------
-- isArray
--
-- Returns true if the given value is a table and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArray(v)
	if type(v) ~= 'table' then
		return false
	end
	local i = 0
	for _ in pairs(v) do
		i = i + 1
		if v[i] == nil then
			return false
		end
	end
	return true
end

------------------------------------------------------------------------------------
-- isArrayLike
--
-- Returns true if the given value is iterable and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArrayLike(v)
	if not pcall(pairs, v) then
		return false
	end
	local i = 0
	for _ in pairs(v) do
		i = i + 1
		if v[i] == nil then
			return false
		end
	end
	return true
end

------------------------------------------------------------------------------------
-- invert
--
-- Transposes the keys and values in an array. For example, {"a", "b", "c"} ->
-- {a = 1, b = 2, c = 3}. Duplicates are not supported (result values refer to
-- the index of the last duplicate) and NaN values are ignored.
------------------------------------------------------------------------------------
function p.invert(arr)
	checkType("invert", 1, arr, "table")
	local isNan = p.isNan
	local map = {}
	for i, v in ipairs(arr) do
		if not isNan(v) then
			map[v] = i
		end
	end

	return map
end

------------------------------------------------------------------------------------
-- listToSet
--
-- Creates a set from the array part of the table. Indexing the set by any of the
-- values of the array returns true. For example, {"a", "b", "c"} ->
-- {a = true, b = true, c = true}. NaN values are ignored as Lua considers them
-- never equal to any value (including other NaNs or even themselves).
------------------------------------------------------------------------------------
function p.listToSet(arr)
	checkType("listToSet", 1, arr, "table")
	local isNan = p.isNan
	local set = {}
	for _, v in ipairs(arr) do
		if not isNan(v) then
			set[v] = true
		end
	end

	return set
end

------------------------------------------------------------------------------------
-- deepCopy
--
-- Recursive deep copy function. Preserves identities of subtables.
------------------------------------------------------------------------------------
local function _deepCopy(orig, includeMetatable, already_seen)
	-- Stores copies of tables indexed by the original table.
	already_seen = already_seen or {}

	local copy = already_seen[orig]
	if copy ~= nil then
		return copy
	end

	if type(orig) == 'table' then
		copy = {}
		for orig_key, orig_value in pairs(orig) do
			copy[_deepCopy(orig_key, includeMetatable, already_seen)] = _deepCopy(orig_value, includeMetatable, already_seen)
		end
		already_seen[orig] = copy

		if includeMetatable then
			local mt = getmetatable(orig)
			if mt ~= nil then
				local mt_copy = _deepCopy(mt, includeMetatable, already_seen)
				setmetatable(copy, mt_copy)
				already_seen[mt] = mt_copy
			end
		end
	else -- number, string, boolean, etc
		copy = orig
	end
	return copy
end

function p.deepCopy(orig, noMetatable, already_seen)
	checkType("deepCopy", 3, already_seen, "table", true)
	return _deepCopy(orig, not noMetatable, already_seen)
end

------------------------------------------------------------------------------------
-- sparseConcat
--
-- Concatenates all values in the table that are indexed by a number, in order.
-- sparseConcat{a, nil, c, d}  =>  "acd"
-- sparseConcat{nil, b, c, d}  =>  "bcd"
------------------------------------------------------------------------------------
function p.sparseConcat(t, sep, i, j)
	local arr = {}

	local arr_i = 0
	for _, v in p.sparseIpairs(t) do
		arr_i = arr_i + 1
		arr[arr_i] = v
	end

	return table.concat(arr, sep, i, j)
end

------------------------------------------------------------------------------------
-- length
--
-- Finds the length of an array, or of a quasi-array with keys such as "data1",
-- "data2", etc., using an exponential search algorithm. It is similar to the
-- operator #, but may return a different value when there are gaps in the array
-- portion of the table. Intended to be used on data loaded with mw.loadData. For
-- other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of  the number
-- of unnamed template parameters, so use this function for frame.args.
------------------------------------------------------------------------------------
function p.length(t, prefix)
	-- requiring module inline so that [[Module:Exponential search]] which is
	-- only needed by this one function doesn't get millions of transclusions
	local expSearch = require("Module:Exponential search")
	checkType('length', 1, t, 'table')
	checkType('length', 2, prefix, 'string', true)
	return expSearch(function (i)
		local key
		if prefix then
			key = prefix .. tostring(i)
		else
			key = i
		end
		return t[key] ~= nil
	end) or 0
end

------------------------------------------------------------------------------------
-- inArray
--
-- Returns true if valueToFind is a member of the array, and false otherwise.
------------------------------------------------------------------------------------
function p.inArray(arr, valueToFind)
	checkType("inArray", 1, arr, "table")
	-- if valueToFind is nil, error?

	for _, v in ipairs(arr) do
		if v == valueToFind then
			return true
		end
	end
	return false
end

return p
威士忌什么味道 焖子是什么做的 梦见吃樱桃是什么意思 伤情鉴定需要什么材料 能屈能伸是什么生肖
拉肚子喝什么药 封神榜讲的是什么故事 口契是什么字 做核磁共振需要注意什么 什么是女人味
慢性活动性胃炎是什么意思 木耳和什么不能一起吃 维生素b2吃多了有什么副作用 酸梅汤不能和什么一起吃 阴沉木是什么木头
hope是什么意思啊 休学什么意思 促甲状腺高会导致什么 负面影响是什么意思 史铁生为什么瘫痪
全身抽筋吃什么药aiwuzhiyu.com 晚上睡觉喉咙干燥是什么原因hcv8jop7ns0r.cn 肚子腹泻是什么原因hcv9jop6ns1r.cn 男人吃什么补hcv7jop6ns2r.cn 四月十号是什么星座hcv8jop9ns7r.cn
咸肉烧什么好吃96micro.com 心悸心慌焦虑吃什么药能缓解bjhyzcsm.com 午餐肉是什么肉做的hcv9jop1ns1r.cn 虎跟什么生肖相冲hcv7jop7ns2r.cn 眼睛屈光不正是什么hcv8jop3ns2r.cn
今非昔比是什么意思hcv8jop5ns9r.cn 霍金什么病hcv9jop2ns8r.cn 韩愈字什么hcv8jop3ns6r.cn 耸是什么意思hcv8jop9ns3r.cn 什么是梅尼埃综合症liaochangning.com
风热感冒吃什么水果hcv9jop2ns5r.cn 脚上脱皮是什么原因hcv8jop8ns6r.cn 今年23岁属什么生肖hcv8jop7ns3r.cn 妇科病吃什么药hcv7jop5ns1r.cn 什么是oahcv8jop7ns0r.cn
百度