def flatten(inlist, type=type, ltype=(list,tuple), maxint= sys.maxint):
	"""Flatten out a list, code developed by myself and modified by Tim Peters, then by me again :)"""
	try:
		# for every possible index
		for ind in xrange( maxint):
			# while that index currently holds a list
			while isinstance( inlist[ind], ltype):
				# expand that list into the index (and subsequent indicies)
				inlist[ind:ind+1] = list(inlist[ind])
			#ind = ind+1
	except __HOLE__:
		pass
	return inlist
dataset/ETHPy150Open correl/Transmission-XBMC/resources/lib/basictypes/latebind.py/flatten