身体上有小红点是什么病| 八月十七是什么星座| 敏使朗是什么药| 受委屈是什么意思| 大腿内侧是什么经络| 致字五行属什么| 软肋骨炎吃什么药对症| 马的尾巴有什么作用| 乳腺炎吃什么药| hbeag阳性是什么意思| 4月29号是什么星座| 什么是乌龙茶| 白头发吃什么变黑| 痛风用什么药| 属虎的适合什么职业| 神迹是什么意思| 小孩睡觉趴着睡是什么原因| 92年属猴的是什么命| 肾气不足吃什么药好| 肌肉痛吃什么药| 马云属什么| ppsu是什么材质| 唐氏综合征是什么意思| 花生什么时候种| pacs什么意思| 梦游的人为什么不能叫醒| fzl什么意思| 意难平什么意思| 9月30日什么星座| 什么的笋| sad是什么意思| 噻虫高氯氟治什么虫| 三个土是什么字怎么读| 荷叶像什么比喻句| 雨花斋靠什么盈利| 虚荣心是什么意思| 为什么招蚊子| jackie是什么意思| 50是什么意思| 为什么会停电| 月经来有血块是什么原因| 地图舌吃什么好得快| 宫颈囊肿有什么症状表现| 斤加一笔是什么字| 甲胎蛋白是什么意思| 手红是什么原因| 荨麻疹是什么样的| 302是什么意思| 一箭双雕是什么意思| 气虚什么症状| 灰溜溜是什么意思| 耳鸣和脑鸣有什么区别| 状元及第是什么意思| 蒲公英长什么样| 吃什么除湿气| 胃黏膜病变是什么意思| 孩子发烧吃什么饭菜好| 带状疱疹后遗神经痛用什么药| 慧眼识珠是什么意思| 心脏杂音是什么意思| 预计是什么意思| 益生菌治什么病| 黑咖啡什么时候喝| 提携是什么意思| 五塔标行军散有什么功效| 心脏早搏是什么原因造成的| 阴茎出血是什么原因| 女人肾虚吃什么| 夏季喝什么汤好| 138是什么意思啊| 传教士是什么意思| 吃饭时头晕是什么原因| 重阳节的习俗是什么| 满月脸水牛背是什么病| 这个故事告诉我们什么道理| 眼有眼屎是什么原因| 收尿干什么用的| 肝实质密度减低是什么意思| 百合不能和什么一起吃| 行尸走肉什么意思| warning什么意思| 三专是什么| 为什么一动就出汗| 异烟肼是什么药| 漫山遍野是什么生肖| 大暑是什么时候| 血糖高的人应该吃什么食物最好| dr胸部正位片是检查什么的| 口腔有异味是什么原因引起的| 胃胀不消化吃什么药| 太燃了是什么意思| 什么是蚕豆病| g18k金是什么意思| nak是什么牌子| 下聘是什么意思| 肠息肉是什么原因造成的| 再生纤维素纤维是什么面料| 减肥挂什么科| 排班是什么意思| 小脚趾麻木是什么原因| 18罗汉都叫什么名字| 521是什么星座| 不义之财是什么意思| 金银花有什么功效| 2011年是什么生肖| 移植后屁多是什么原因| 屁臭是什么原因造成的| 碘伏和酒精有什么区别| 胃火吃什么食物好| 梦见妖魔鬼怪是什么意思| 日落是什么时辰| 甲沟炎涂抹什么药膏最有效| 男性睾丸一边大一边小是什么原因| 王字旁行念什么| 拉不出屎吃什么药| 什么样的树| 核载是什么意思| 催乳素过高会有什么严重的后果| 皖鱼是什么鱼| 火指什么生肖| 翡翠是什么颜色| 特警是干什么的| 葛根主治什么病| 让您费心了是什么意思| 慢是什么意思| 过生日吃什么菜寓意好| 梦见涨洪水是什么兆头| gm是什么单位| 小肚子突出是什么原因| 吃什么可以让子宫内膜变薄| 宫代表什么生肖| 男人吃什么补| 肩膀疼是什么原因引起的| 什么的水珠| 甲沟炎应该挂什么科| 女单读什么| 疱疹是什么症状| 静脉曲张用什么药| 拉肚子发烧吃什么药| 如花是什么意思| 察言观色是什么意思| 蜈蚣怕什么| 果糖胺偏高说明什么| primark是什么牌子| 肛门痒挂什么科检查| 儿童感冒咳嗽吃什么药| 检查眼睛挂什么科| 螨虫长什么样子图片| 85年属于什么生肖| 剥离是什么意思| 吃惊的什么| 手筋鼓起来是什么原因| 胆囊壁欠光滑是什么意思| 人体最大的免疫器官是什么| 看食道挂什么科室| 怀孕呕吐吃什么可以缓解| 牙齿掉了一小块是什么原因| 抗环瓜氨酸肽抗体高是什么意思| 6月8日是什么星座| 男性尿道感染吃什么药| 耐人寻味什么意思| 补睾丸吃什么药最好| 厅级干部是什么级别| 糖尿病人喝什么茶最好| 什么样的伤口算开放性| 青鱼又叫什么鱼| 坐月子能吃什么菜| 凝是什么意思| 肾素高说明什么| 妈妈a型爸爸b型孩子是什么血型| 哈怂是什么意思| 嘴唇正常颜色是什么样| 百香果的籽有什么功效| 饕餮是什么意思| 儿加一笔是什么字| 甲状腺饱满是什么意思| 脑膜瘤钙化意味着什么| 扁桃体有什么作用| 肠梗阻是因为什么原因引起的| 众星捧月是什么意思| 应收账款在贷方表示什么| 1688是什么| 沐沐是什么意思| 为什么会有阴虱子| 三个吉念什么| 肠胃不好吃什么药效果好| 手串13颗代表什么意思| 红烧肉是什么菜系| 京东白条什么时候还款| 阳虚吃什么| 秦始皇叫什么名字| 请节哀是什么意思| 手麻木是什么引起的| 骨膜炎吃什么药| 纤维条索灶是什么意思| 轶事是什么意思| sid是什么意思| 胃炎吃什么| 儿茶酚胺是什么| 子孙满堂是什么生肖| 胆固醇是什么| 胃胀气吃什么药好| 济南有什么特产| 踢馆什么意思| 突然视力模糊是什么原因引起的| 颈部有肿块看什么科室| 种什么最赚钱| 康妇炎胶囊主治什么| 吃什么对胰腺有好处| 爱马仕是什么意思| 乳房肿胀是什么原因| 天秤座和什么星座最配| 什么馅的饺子好吃| 痔疮什么情况下需要做手术| 蒲公英的花是什么颜色| 6月19日是什么节日| 洗衣机启动不了是什么原因| 有机食品是什么意思| 经期适合喝什么茶| 来大姨妈能吃什么水果| 煸是什么意思| 孕妇白蛋白偏低是什么意思| 兰州市区有什么好玩的地方| chick什么意思| 五心烦热吃什么中成药| 岁月不饶人是什么意思| 10.30是什么星座| 什么鸣什么吠| 三点水一个高念什么| 惊喜的英文是什么| 道字五行属什么| 樱桃有什么营养价值| 梦见和死去的亲人吵架是什么意思| 陌上花是什么意思| 什么是卫校| 断眉有什么说法| 格力空调se是什么意思| 亭字五行属什么| 3岁小孩说话结巴是什么原因| 送锦旗有什么讲究| 缺硒吃什么| 谬论是什么意思| 拉屎黑色的是什么原因| 后嗣是什么意思| 蛋白粉有什么用| 做四维需要准备什么| 吉兆什么意思| 胳膊疼是什么病的前兆| 预判是什么意思| 郑恺的父母是做什么的| 绝交是什么意思| 扁桃体有什么作用| 艾灸是什么意思| 凯字五行属什么| 久经沙场是什么意思| 什么的果子| 手指甲软薄是缺什么| 眼睛为什么会近视| 招魂是什么意思| 生辰八字是指什么| 蝙蝠屎是什么中药| 什么叫压缩性骨折| 属相牛和什么属相配| 手震颤是什么原因引起的| 百度Мазмунга ?т??

纪委是什么

Википедия — ачык энциклопедия
百度 为达到目的,他们贴心地提供一条龙服务陪同客户去保险公司进行现场退保,或让客户授权于他们代办退保事宜。

Documentation for this module may be created at Модуль:TableTools/doc

------------------------------------------------------------------------------------
--                                   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
		elseif not exists[v] then
			ret[#ret + 1] = v
			exists[v] = true
		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)
	if type(orig) ~= "table" then
		return orig
	end
	
	-- already_seen stores copies of tables indexed by the original table.
	local copy = already_seen[orig]
	if copy ~= nil then
		return copy
	end
	
	copy = {}
	already_seen[orig] = copy -- memoize before any recursion, to avoid infinite loops
	
	for orig_key, orig_value in pairs(orig) do
		copy[_deepCopy(orig_key, includeMetatable, already_seen)] = _deepCopy(orig_value, includeMetatable, already_seen)
	end
	
	if includeMetatable then
		local mt = getmetatable(orig)
		if mt ~= nil then
			setmetatable(copy, _deepCopy(mt, true, already_seen))
		end
	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 or {})
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 searchElement is a member of the array, and false otherwise.
-- Equivalent to JavaScript array.includes(searchElement) or
-- array.includes(searchElement, fromIndex), except fromIndex is 1 indexed
------------------------------------------------------------------------------------
function p.inArray(array, searchElement, fromIndex)
	checkType("inArray", 1, array, "table")
	-- if searchElement is nil, error?

	fromIndex = tonumber(fromIndex)
	if fromIndex then
		if (fromIndex < 0) then
			fromIndex = #array + fromIndex + 1
		end
		if fromIndex < 1 then fromIndex = 1 end
		for _, v in ipairs({unpack(array, fromIndex)}) do
			if v == searchElement then
				return true
			end
		end
	else
		for _, v in pairs(array) do
			if v == searchElement then
				return true
			end
		end
	end
	return false
end

------------------------------------------------------------------------------------
-- merge
--
-- Given the arrays, returns an array containing the elements of each input array
-- in sequence.
------------------------------------------------------------------------------------
function p.merge(...)
	local arrays = {...}
	local ret = {}
	for i, arr in ipairs(arrays) do
		checkType('merge', i, arr, 'table')
		for _, v in ipairs(arr) do
			ret[#ret + 1] = v
		end
	end
	return ret
end

------------------------------------------------------------------------------------
-- extend
--
-- Extends the first array in place by appending all elements from the second
-- array.
------------------------------------------------------------------------------------
function p.extend(arr1, arr2)
	checkType('extend', 1, arr1, 'table')
	checkType('extend', 2, arr2, 'table')

	for _, v in ipairs(arr2) do
		arr1[#arr1 + 1] = v
	end
end

return p
海洋中最大的动物是什么 柔式按摩是什么意思 驳是什么动物 西席是什么意思 8月15号是什么日子
农历五月十九是什么日子 什么粥养胃 什么水果补铁 抗凝药是什么意思 桂枝和肉桂有什么区别
王字旁加己念什么 头上长痘痘是什么原因 高压偏低是什么原因造成的 8月26号是什么星座 寡欲是什么意思
淋球菌阳性是什么意思 诺氟沙星胶囊治什么 做梦房子倒塌什么预兆 肿瘤是什么 上海市长是什么级别
血友病是什么病hcv7jop5ns5r.cn 例假为什么第一天最疼hcv8jop6ns6r.cn 鸭子喜欢吃什么hcv9jop4ns2r.cn 突然血糖高是什么原因引起的hcv8jop2ns9r.cn 心脏早搏是怎么回事有什么危害hcv8jop6ns6r.cn
阴道口痒用什么药hcv7jop9ns0r.cn 儿童腮腺炎挂什么科hcv8jop8ns8r.cn 本科专科有什么区别hcv8jop8ns5r.cn 痛风发作期吃什么药hcv7jop9ns4r.cn 窦性心动过速是什么原因hcv8jop9ns4r.cn
喝酒喝多了有什么危害hcv8jop3ns0r.cn 篮球中锋是干什么的hcv9jop5ns8r.cn 利普刀是什么手术hcv7jop9ns3r.cn 七月初七是什么节日hcv8jop8ns4r.cn 什么人不适合艾灸hcv8jop3ns1r.cn
什么补肾壮阳最好onlinewuye.com 泥鳅喜欢吃什么食物hcv9jop0ns0r.cn 经常想睡觉是什么原因hcv7jop6ns8r.cn 尿频尿急是什么症状hcv9jop2ns7r.cn 表虚不固是什么意思hcv9jop2ns1r.cn
百度