<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.stiles.casa/index.php?action=history&amp;feed=atom&amp;title=Module%3ATeam_appearances_list%2Fsandbox</id>
	<title>Module:Team appearances list/sandbox - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.stiles.casa/index.php?action=history&amp;feed=atom&amp;title=Module%3ATeam_appearances_list%2Fsandbox"/>
	<link rel="alternate" type="text/html" href="https://wiki.stiles.casa/index.php?title=Module:Team_appearances_list/sandbox&amp;action=history"/>
	<updated>2026-05-07T03:31:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.2</generator>
	<entry>
		<id>https://wiki.stiles.casa/index.php?title=Module:Team_appearances_list/sandbox&amp;diff=7819&amp;oldid=prev</id>
		<title>imported&gt;GKFX: Permit direct use from wikitext</title>
		<link rel="alternate" type="text/html" href="https://wiki.stiles.casa/index.php?title=Module:Team_appearances_list/sandbox&amp;diff=7819&amp;oldid=prev"/>
		<updated>2021-10-02T14:23:30Z</updated>

		<summary type="html">&lt;p&gt;Permit direct use from wikitext&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module implements [[Template:Team appearances list]].&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local data_competitions&lt;br /&gt;
local data_old_names&lt;br /&gt;
local function load_data(frame)&lt;br /&gt;
	-- Load data module (or its sandbox) and set variables from its exported data.&lt;br /&gt;
	if not data_competitions then&lt;br /&gt;
		frame = frame or mw.getCurrentFrame()&lt;br /&gt;
		local sandbox = frame:getTitle():find(&amp;#039;sandbox&amp;#039;, 1, true) and &amp;#039;/sandbox&amp;#039; or &amp;#039;&amp;#039;&lt;br /&gt;
		local datamod = mw.loadData(&amp;#039;Module:Team appearances list/data&amp;#039; .. sandbox)&lt;br /&gt;
		data_competitions = datamod.competitions&lt;br /&gt;
		data_old_names = datamod.old_names&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function strip_to_nil(text)&lt;br /&gt;
	-- If text is a string, return its trimmed content, or nil if empty.&lt;br /&gt;
	-- Otherwise return text (which may, for example, be nil).&lt;br /&gt;
	if type(text) == &amp;#039;string&amp;#039; then&lt;br /&gt;
		text = text:match(&amp;#039;(%S.-)%s*$&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	return text&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function make_options(args)&lt;br /&gt;
	-- Return table of options from validated args or throw error.&lt;br /&gt;
	local options = {}&lt;br /&gt;
	local function valid_integer(name, min, max, is_optional)&lt;br /&gt;
		local arg = args[name]&lt;br /&gt;
		if arg == nil or arg == &amp;#039;&amp;#039; then&lt;br /&gt;
			if is_optional then&lt;br /&gt;
				return nil&lt;br /&gt;
			end&lt;br /&gt;
			error(&amp;#039;Parameter &amp;#039; .. name .. &amp;#039; is missing&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		arg = tonumber(arg)&lt;br /&gt;
		if type(arg) ~= &amp;#039;number&amp;#039; then&lt;br /&gt;
			error(&amp;#039;Parameter &amp;#039; .. name .. &amp;#039; is not a number&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		if math.floor(arg) ~= arg then&lt;br /&gt;
			error(&amp;#039;Parameter &amp;#039; .. name .. &amp;#039; is not an integer&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		if not (min &amp;lt;= arg and arg &amp;lt;= max) then&lt;br /&gt;
			error(&amp;#039;Parameter &amp;#039; .. name .. &amp;#039; is not valid&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		return arg&lt;br /&gt;
	end&lt;br /&gt;
	local function valid_text(name)&lt;br /&gt;
		local arg = args[name]&lt;br /&gt;
		if arg == nil or arg == &amp;#039;&amp;#039; then&lt;br /&gt;
			error(&amp;#039;Parameter &amp;#039; .. name .. &amp;#039; is missing&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		if type(arg) ~= &amp;#039;string&amp;#039; then&lt;br /&gt;
			error(&amp;#039;Parameter &amp;#039; .. name .. &amp;#039; is not a string&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		return arg&lt;br /&gt;
	end&lt;br /&gt;
	options.competition = valid_text(&amp;#039;competition&amp;#039;)&lt;br /&gt;
	options.team = valid_text(&amp;#039;team&amp;#039;)&lt;br /&gt;
	-- Check ROC/TPE&lt;br /&gt;
	if options.team==&amp;#039;Republic of China&amp;#039; then&lt;br /&gt;
		local pageYear = tonumber(mw.ustring.match(mw.title.getCurrentTitle().text, &amp;#039;[%d]+&amp;#039;)) -- mw.title.getCurrentTitle().text:match(&amp;#039;^%d+&amp;#039;)&lt;br /&gt;
		if pageYear and pageYear &amp;gt; 1950 and pageYear &amp;lt; 1980 then&lt;br /&gt;
			options.team = &amp;#039;Chinese Taipei&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- end of ROC/TPE check&lt;br /&gt;
	options.competitions = data_competitions[options.competition] or data_competitions[data_old_names[options.competition]]&lt;br /&gt;
	local begin_optional&lt;br /&gt;
	if options.competitions then&lt;br /&gt;
		begin_optional = true&lt;br /&gt;
	else&lt;br /&gt;
		options.interval = valid_integer(&amp;#039;interval&amp;#039;, 1, 30)&lt;br /&gt;
	end&lt;br /&gt;
	options.begin_year = valid_integer(&amp;#039;begin_year&amp;#039;, 1800, 2100, begin_optional)&lt;br /&gt;
	options.end_year = valid_integer(&amp;#039;end_year&amp;#039;, 1800, 2100, true)&lt;br /&gt;
	if options.begin_year and options.end_year then&lt;br /&gt;
		if options.begin_year &amp;gt; options.end_year then&lt;br /&gt;
			error(&amp;#039;Parameter end_year must not be before begin_year&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	options.disqualified_year = valid_integer(&amp;#039;disqualified_year&amp;#039;, 1800, 2100, true)&lt;br /&gt;
	return options&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function extract_range(text)&lt;br /&gt;
	-- Return first (if text is a single year), or first, last if a range.&lt;br /&gt;
	-- The returned values are numbers.&lt;br /&gt;
	-- Return nothing if text is invalid.&lt;br /&gt;
	local year = text:match(&amp;#039;^(%d+)$&amp;#039;)&lt;br /&gt;
	if year then&lt;br /&gt;
		if #year == 4 then&lt;br /&gt;
			return tonumber(year)&lt;br /&gt;
		end&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
	local first, dash, last = text:match(&amp;#039;^(%d+)(%D+)(%d+)$&amp;#039;)&lt;br /&gt;
	if not (first and #first == 4) then&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
	dash = strip_to_nil(dash)&lt;br /&gt;
	if not (dash == &amp;#039;-&amp;#039; or dash == &amp;#039;–&amp;#039;) then&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
	if #last ~= 4 then&lt;br /&gt;
		if #last == 2 then&lt;br /&gt;
			last = first:sub(1, 2) .. last&lt;br /&gt;
		else&lt;br /&gt;
			return&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	first = tonumber(first)&lt;br /&gt;
	last = tonumber(last)&lt;br /&gt;
	if first &amp;lt; last then&lt;br /&gt;
		return first, last&lt;br /&gt;
	elseif first == last then&lt;br /&gt;
		return first&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function competition_absences(data)&lt;br /&gt;
	-- Return two tables with absent years and absent year ranges.&lt;br /&gt;
	-- Parameter data is an array of strings from template parameters, or&lt;br /&gt;
	-- numbers or strings from built-in data.&lt;br /&gt;
	-- Parameters that are blank or not numbers or strings are ignored.&lt;br /&gt;
	local absent_years, absent_ranges = {}, {}&lt;br /&gt;
	for _, item in ipairs(data) do&lt;br /&gt;
		if type(item) == &amp;#039;number&amp;#039; then&lt;br /&gt;
			absent_years[item] = true&lt;br /&gt;
		else&lt;br /&gt;
			item = strip_to_nil(item)&lt;br /&gt;
			if type(item) == &amp;#039;string&amp;#039; then&lt;br /&gt;
				local first, last = extract_range(item)&lt;br /&gt;
				if not first then&lt;br /&gt;
					error(&amp;#039;Year &amp;#039; .. item .. &amp;#039; is not valid&amp;#039;)&lt;br /&gt;
				end&lt;br /&gt;
				if last then&lt;br /&gt;
					table.insert(absent_ranges, {first, last})&lt;br /&gt;
				else&lt;br /&gt;
					absent_years[first] = true&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return absent_years, absent_ranges&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function competition_information(args)&lt;br /&gt;
	-- Return four tables with competition and team information:&lt;br /&gt;
	-- * List of competition years that the team attended or could have attended.&lt;br /&gt;
	-- * Table of disqualified years (the team was absent, but there is an&lt;br /&gt;
	--   article regarding the absent year).&lt;br /&gt;
	-- * Table of absent years (when the team did not attend).&lt;br /&gt;
	-- * List of pairs of years (absent for each year in range, inclusive).&lt;br /&gt;
	local options = make_options(args)&lt;br /&gt;
	local absences&lt;br /&gt;
	local comp_years = {}&lt;br /&gt;
	local begin_year = options.begin_year&lt;br /&gt;
	local end_year = options.end_year&lt;br /&gt;
	local competitions = options.competitions&lt;br /&gt;
	if competitions then&lt;br /&gt;
		absences = competitions[options.team] or competitions[data_old_names[options.team]]&lt;br /&gt;
		begin_year = begin_year or (absences and absences.begin_year) or 0&lt;br /&gt;
		end_year = end_year or (absences and absences.end_year) or 9999&lt;br /&gt;
		for _, y in ipairs(competitions) do&lt;br /&gt;
			if y &amp;gt; end_year then&lt;br /&gt;
				break&lt;br /&gt;
			elseif y &amp;gt;= begin_year then&lt;br /&gt;
				table.insert(comp_years, y)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		end_year = end_year or (os.date(&amp;#039;!*t&amp;#039;).year + options.interval)&lt;br /&gt;
		for y = begin_year, end_year, options.interval do&lt;br /&gt;
			table.insert(comp_years, y)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local disqualified_years = {}&lt;br /&gt;
	if options.disqualified_year then&lt;br /&gt;
		-- Input currently only allows entry of a single disqualified year.&lt;br /&gt;
		-- However processing works for any number of such years.&lt;br /&gt;
		disqualified_years[options.disqualified_year] = true&lt;br /&gt;
	end&lt;br /&gt;
	return comp_years, disqualified_years, competition_absences(absences or args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function gameName(year, inputName)&lt;br /&gt;
	-- Modifies output of display being sent back to the hlist&lt;br /&gt;
	--  for games that have had a name change but are still considered&lt;br /&gt;
	--  the same competition.&lt;br /&gt;
	if inputName==&amp;quot;World Athletics Championships&amp;quot; or inputName==&amp;quot;World Championships in Athletics&amp;quot; then&lt;br /&gt;
		if year &amp;lt;= 2017 then&lt;br /&gt;
			return &amp;quot;World Championships in Athletics&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;quot;World Athletics Championships&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	elseif (inputName==&amp;quot;British Empire Games&amp;quot;&lt;br /&gt;
		or inputName==&amp;quot;British Empire and Commonwealth Games&amp;quot;&lt;br /&gt;
		or inputName==&amp;quot;British Commonwealth Games&amp;quot;&lt;br /&gt;
		or inputName==&amp;quot;Commonwealth Games&amp;quot;) then&lt;br /&gt;
			if year &amp;lt;= 1950 then&lt;br /&gt;
				return &amp;quot;British Empire Games&amp;quot;&lt;br /&gt;
			elseif year &amp;lt;= 1966 then&lt;br /&gt;
				return &amp;quot;British Empire and Commonwealth Games&amp;quot;&lt;br /&gt;
			elseif year &amp;lt;= 1974 then&lt;br /&gt;
				return &amp;quot;British Commonwealth Games&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				return &amp;quot;Commonwealth Games&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
	elseif inputName==&amp;quot;Southeast Asian Peninsular Games&amp;quot; or inputName==&amp;quot;Southeast Asian Games&amp;quot; then&lt;br /&gt;
		if year &amp;lt;= 1975 then&lt;br /&gt;
			return &amp;quot;Southeast Asian Peninsular Games&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;quot;Southeast Asian Games&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	elseif inputName==&amp;quot;Asian Indoor Games&amp;quot; or inputName==&amp;quot;Asian Indoor and Martial Arts Games&amp;quot; then&lt;br /&gt;
		if year &amp;lt;= 2009 then&lt;br /&gt;
			return &amp;quot;Asian Indoor Games&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;quot;Asian Indoor and Martial Arts Games&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	elseif inputName==&amp;quot;Southern Cross Games&amp;quot; or inputName==&amp;quot;South American Games&amp;quot; then&lt;br /&gt;
		if year &amp;lt;= 1982 then&lt;br /&gt;
			return &amp;quot;Southern Cross Games&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;quot;South American Games&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	elseif inputName==&amp;quot;All-Africa Games&amp;quot; or inputName==&amp;quot;African Games&amp;quot; then&lt;br /&gt;
		if year &amp;lt;= 2011 then&lt;br /&gt;
			return &amp;quot;All-Africa Games&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;quot;African Games&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return inputName&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function teamName(year, inputName, comp)&lt;br /&gt;
	-- Modifies output of display being sent back to the hlist&lt;br /&gt;
	--  for games that have had a name change but are still considered&lt;br /&gt;
	--  the same competition.&lt;br /&gt;
	if inputName==&amp;quot;Eswatini&amp;quot; or inputName==&amp;quot;Swaziland&amp;quot; then&lt;br /&gt;
		if year &amp;lt; 2018 or year == 2018 and comp == &amp;#039;Commonwealth Games&amp;#039; then&lt;br /&gt;
			return &amp;quot;Swaziland&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;quot;Eswatini&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	elseif inputName==&amp;quot;Southern Rhodesia&amp;quot; or inputName==&amp;quot;Rhodesia&amp;quot; or inputName==&amp;quot;Zimbabwe&amp;quot; then&lt;br /&gt;
			if year &amp;lt; 1980 then&lt;br /&gt;
				if (comp==&amp;quot;British Empire Games&amp;quot;&lt;br /&gt;
					or comp==&amp;quot;British Empire and Commonwealth Games&amp;quot;&lt;br /&gt;
					or comp==&amp;quot;British Commonwealth Games&amp;quot;&lt;br /&gt;
					or comp==&amp;quot;Commonwealth Games&amp;quot;) then&lt;br /&gt;
						return &amp;quot;Southern Rhodesia&amp;quot;&lt;br /&gt;
				elseif comp==&amp;quot;Summer Olympics&amp;quot; or comp==&amp;quot;Summer Paralympics&amp;quot; then&lt;br /&gt;
						return &amp;quot;Rhodesia&amp;quot;&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
				return &amp;quot;Zimbabwe&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
	elseif (inputName==&amp;quot;Republic of China&amp;quot;&lt;br /&gt;
			or inputName==&amp;quot;Formosa&amp;quot;&lt;br /&gt;
			or inputName==&amp;quot;Taiwan&amp;quot;&lt;br /&gt;
			or inputName==&amp;quot;Chinese Taipei&amp;quot;) then&lt;br /&gt;
				if year &amp;lt;= 1956 or year == 1972 or year == 1976 then&lt;br /&gt;
					return &amp;quot;Republic of China&amp;quot;&lt;br /&gt;
				elseif year==1960 then&lt;br /&gt;
					return &amp;quot;Republic of China (Formosa)&amp;quot;&lt;br /&gt;
				elseif year==1964 or year==1968 then&lt;br /&gt;
					return &amp;quot;Taiwan&amp;quot;&lt;br /&gt;
				elseif year &amp;gt; 1976 then&lt;br /&gt;
					return &amp;quot;Chinese Taipei&amp;quot;&lt;br /&gt;
				end&lt;br /&gt;
	elseif inputName==&amp;quot;Northern Rhodesia&amp;quot; or inputName==&amp;quot;Zambia&amp;quot; then&lt;br /&gt;
			if year &amp;lt;= 1964 then&lt;br /&gt;
				return &amp;quot;Northern Rhodesia&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				return &amp;quot;Zambia&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
	elseif inputName==&amp;quot;Aden&amp;quot; or inputName==&amp;quot;South Arabia&amp;quot; or inputName==&amp;quot;Federation of South Arabia&amp;quot; then&lt;br /&gt;
			if year &amp;lt; 1966 then&lt;br /&gt;
				return &amp;quot;Aden&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				return &amp;quot;South Arabia&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
	elseif inputName==&amp;quot;British Guiana&amp;quot; or inputName==&amp;quot;Guyana&amp;quot; then&lt;br /&gt;
			if year &amp;lt; 1966 then&lt;br /&gt;
				return &amp;quot;British Guiana&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				return &amp;quot;Guyana&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
	elseif inputName==&amp;quot;Tanzania&amp;quot; or inputName==&amp;quot;Tanganyika&amp;quot; then&lt;br /&gt;
			if year &amp;lt; 1966 then&lt;br /&gt;
				return &amp;quot;Tanganyika&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				return &amp;quot;Tanzania&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
	elseif inputName==&amp;quot;Ceylon&amp;quot; or inputName==&amp;quot;Sri Lanka&amp;quot; then&lt;br /&gt;
			if year &amp;lt;= 1972 then&lt;br /&gt;
				return &amp;quot;Ceylon&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				return &amp;quot;Sri Lanka&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
	elseif inputName==&amp;quot;British Honduras&amp;quot; or inputName==&amp;quot;Belize&amp;quot; then&lt;br /&gt;
			if year &amp;lt;= 1973 then&lt;br /&gt;
				return &amp;quot;British Honduras&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				return &amp;quot;Belize&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
	elseif inputName==&amp;quot;Dahomey&amp;quot; or inputName==&amp;quot;Benin&amp;quot; then&lt;br /&gt;
			if year &amp;lt;= 1975 then&lt;br /&gt;
				return &amp;quot;Dahomey&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				return &amp;quot;Benin&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
	elseif inputName==&amp;quot;Upper Volta&amp;quot; or inputName==&amp;quot;Burkina Faso&amp;quot; then&lt;br /&gt;
			if year &amp;lt;= 1983 then&lt;br /&gt;
				return &amp;quot;Upper Volta&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				return &amp;quot;Burkina Faso&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
	elseif inputName==&amp;quot;Burma&amp;quot; or inputName==&amp;quot;Myanmar&amp;quot; then&lt;br /&gt;
			if year &amp;lt; 1990 then&lt;br /&gt;
				return &amp;quot;Burma&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				return &amp;quot;Myanmar&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
	elseif inputName==&amp;quot;Germany&amp;quot; or inputName==&amp;quot;West Germany&amp;quot; then&lt;br /&gt;
		if comp == &amp;quot;Summer Paralympics&amp;quot; or comp == &amp;quot;Winter Paralympics&amp;quot; then&lt;br /&gt;
			if year &amp;lt; 1992 then&lt;br /&gt;
				return &amp;quot;West Germany&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				return &amp;quot;Germany&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	elseif inputName==&amp;quot;Democratic Republic of the Congo&amp;quot; or inputName==&amp;quot;Zaire&amp;quot; then&lt;br /&gt;
		if year &amp;gt;= 1984 and year &amp;lt;=1996 then&lt;br /&gt;
			return &amp;quot;Zaire&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;quot;Democratic Republic of the Congo&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	elseif (inputName==&amp;quot;Individual Olympic Athletes&amp;quot; &lt;br /&gt;
		or inputName==&amp;quot;Independent Olympic Athletes&amp;quot; &lt;br /&gt;
		or inputName==&amp;quot;Independent Olympic Participants&amp;quot;&lt;br /&gt;
		or inputName==&amp;quot;Olympic Athletes from Russia&amp;quot;&lt;br /&gt;
		or inputName==&amp;quot;ROC&amp;quot;) then&lt;br /&gt;
		if year == 1992 or year==2014 then&lt;br /&gt;
			return &amp;quot;Independent Olympic Participants&amp;quot;&lt;br /&gt;
		elseif year == 2000 then&lt;br /&gt;
			return &amp;quot;Individual Olympic Athletes&amp;quot;&lt;br /&gt;
		elseif year == 2012 or year==2016 then&lt;br /&gt;
			return &amp;quot;Independent Olympic Athletes&amp;quot;&lt;br /&gt;
		elseif year == 2018 then&lt;br /&gt;
			return &amp;quot;Olympic Athletes from Russia&amp;quot;&lt;br /&gt;
		elseif year == 2020 or year==2022 then&lt;br /&gt;
			return &amp;quot;Russian Olympic Committee athletes&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return inputName&lt;br /&gt;
		end&lt;br /&gt;
	elseif inputName==&amp;quot;Serbia and Montenegro&amp;quot; or inputName==&amp;quot;FR Yugoslavia&amp;quot; then&lt;br /&gt;
		if year &amp;lt; 2004 then&lt;br /&gt;
			if comp == &amp;quot;Mediterranean Games&amp;quot; then&lt;br /&gt;
				return &amp;quot;FR Yugoslavia&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				return &amp;quot;Yugoslavia&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;quot;Serbia and Montenegro&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	elseif (inputName==&amp;quot;Refugee Olympic Team&amp;quot; &lt;br /&gt;
		or inputName==&amp;quot;IOC Refugee Olympic Team&amp;quot;) then&lt;br /&gt;
		if year == 2016 then&lt;br /&gt;
			return &amp;quot;Refugee Olympic Team&amp;quot;&lt;br /&gt;
		elseif year == 2020 then&lt;br /&gt;
			return &amp;quot;IOC Refugee Olympic Team&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return inputName&lt;br /&gt;
		end&lt;br /&gt;
	elseif (inputName==&amp;quot;Independent Paralympic Participants&amp;quot; &lt;br /&gt;
		or inputName==&amp;quot;Individual Paralympic Athletes&amp;quot; &lt;br /&gt;
		or inputName==&amp;quot;Independent Paralympic Athletes&amp;quot;&lt;br /&gt;
		or inputName==&amp;quot;RPC&amp;quot;&lt;br /&gt;
		or inputName==&amp;quot;Neutral Paralympic Athletes&amp;quot;) then&lt;br /&gt;
		if year == 1992 then&lt;br /&gt;
			return &amp;quot;Independent Paralympic Participants&amp;quot;&lt;br /&gt;
		elseif year == 2000 then&lt;br /&gt;
			return &amp;quot;Individual Paralympic Athletes&amp;quot;&lt;br /&gt;
		elseif year==2016 then&lt;br /&gt;
			return &amp;quot;Independent Paralympic Athletes&amp;quot;&lt;br /&gt;
		elseif year==2018 then&lt;br /&gt;
			return &amp;quot;Neutral Paralympic Athletes&amp;quot;&lt;br /&gt;
		elseif year == 2020 or year==2022 then&lt;br /&gt;
			return &amp;quot;Russian Paralympic Committee athletes&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return inputName&lt;br /&gt;
		end&lt;br /&gt;
	elseif inputName==&amp;quot;North Macedonia&amp;quot; or inputName==&amp;quot;Macedonia&amp;quot; then&lt;br /&gt;
		if year &amp;lt; 2019 then&lt;br /&gt;
			return &amp;quot;Macedonia&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;quot;North Macedonia&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	elseif inputName==&amp;quot;Malaysia&amp;quot; or inputName==&amp;quot;Malaya&amp;quot; then&lt;br /&gt;
		if year &amp;lt; 1963 then&lt;br /&gt;
			return &amp;quot;Malaya&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;quot;Malaysia&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return inputName&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	load_data()  -- in case this function is called by another module&lt;br /&gt;
	local hlist = require(&amp;#039;Module:List&amp;#039;).horizontal&lt;br /&gt;
	local competitions, disqualified_years, absent_years, absent_ranges = competition_information(args)&lt;br /&gt;
	local current_year = os.date(&amp;#039;!*t&amp;#039;).year&lt;br /&gt;
	local function is_absent(y)&lt;br /&gt;
		if absent_years[y] then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
		for _, range in ipairs(absent_ranges) do&lt;br /&gt;
			if range[1] &amp;lt;= y and y &amp;lt;= range[2] then&lt;br /&gt;
				return true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	local appearances = {}&lt;br /&gt;
	local absent_first, absent_last&lt;br /&gt;
	for i = 1, #competitions + 1 do  -- +1 to handle any trailing absences&lt;br /&gt;
		local y = competitions[i]&lt;br /&gt;
		if y and is_absent(y) then&lt;br /&gt;
			if absent_first then&lt;br /&gt;
				absent_last = y&lt;br /&gt;
			else&lt;br /&gt;
				absent_first = y&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			if absent_first then&lt;br /&gt;
				table.insert(appearances,&lt;br /&gt;
					&amp;#039;&amp;lt;span style=&amp;quot;color:gray&amp;quot;&amp;gt;&amp;#039; ..&lt;br /&gt;
					(absent_last and (absent_first .. &amp;#039;–&amp;#039; .. absent_last) or absent_first) ..&lt;br /&gt;
					&amp;#039;&amp;lt;/span&amp;gt;&amp;#039;)&lt;br /&gt;
				absent_first, absent_last = nil, nil&lt;br /&gt;
			end&lt;br /&gt;
			if y then&lt;br /&gt;
				local display = tostring(y)&lt;br /&gt;
				if y &amp;gt; current_year then&lt;br /&gt;
					display = &amp;#039;&amp;lt;i&amp;gt;&amp;#039; .. display .. &amp;#039;&amp;lt;/i&amp;gt;&amp;#039;&lt;br /&gt;
				end&lt;br /&gt;
				if disqualified_years[y] then&lt;br /&gt;
					display = &amp;#039;&amp;lt;del&amp;gt;&amp;#039; .. display .. &amp;#039;&amp;lt;/del&amp;gt;&amp;#039;&lt;br /&gt;
				end&lt;br /&gt;
				local compName = gameName(y, args.competition)&lt;br /&gt;
				local teamOut = teamName(y, args.team, args.competition)&lt;br /&gt;
				if compName == &amp;#039;FIS Alpine World Ski Championships&amp;#039; then&lt;br /&gt;
					table.insert(appearances, string.format(&lt;br /&gt;
					&amp;#039;[[%s at the %s %d|%s]]&amp;#039;,&lt;br /&gt;
					teamOut, compName, y, display&lt;br /&gt;
					))&lt;br /&gt;
				else&lt;br /&gt;
					table.insert(appearances, string.format(&lt;br /&gt;
						&amp;#039;[[%s at the %d %s|%s]]&amp;#039;,&lt;br /&gt;
						teamOut, y, compName, display&lt;br /&gt;
					))&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return hlist(appearances)&lt;br /&gt;
end&lt;br /&gt;
				&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	load_data(frame)&lt;br /&gt;
	return p._main(frame.args[&amp;#039;team&amp;#039;] and frame.args or frame:getParent().args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;GKFX</name></author>
	</entry>
</feed>