function Table.deepCopy(b,W)W=W or{}if W[b]then return W[b]end if type(b)=="\116\097\098\108\101"then local H={}W[b]=H for b,O in pairs(b)do H[Table.deepCopy(b,W)]=Table.deepCopy(O,W)end return setmetatable(H,Table.deepCopy(getmetatable(b),W))else return b end end

function Table.deepCopy(target, _context)
	_context = _context or  {}
	if _context[target] then
		return _context[target]
	end

	if type(target) == "table" then
		local new = {}
		_context[target] = new
		for index, value in pairs(target) do
			new[Table.deepCopy(index, _context)] = Table.deepCopy(value, _context)
		end
		return setmetatable(new, Table.deepCopy(getmetatable(target), _context))
	else
		return target
	end
end
