Beispiel #1
0
	def test_unpackList(self):
		lists = [
			[1, 2, 3, 4],
			[1, 2, 3],
			[1, 2],
			[1]
		]
		rst = util.unpackList(lists)
		self.assertEqual(len(rst), 10)
Beispiel #2
0
def run(classify):
	def applyRule(rule):
		def mapClass(className):
			return list(map(rule, classify[className]))
		return list(map(mapClass, classify))
	return list(map(applyRule ,unpackList(rules)))