def weekly_artists(xml):
	soup = BeautifulStoneSoup(xml)
	
	# Check this is the right thing
	try:
		assert soup.find("weeklyartistchart"), "weekly_artists did not get a Weekly Artist Chart"
	except __HOLE__:
		print >> sys.stderr, xml
		raise AssertionError("weekly_artists did not get a Weekly Artist Chart")
	
	# Get the artists
	for tag in soup.findAll("artist"):
		name = str(tag.find("name").string).decode("utf8")
		playtag = tag.find("playcount")
		if playtag:
			plays = long(playtag.string)
		else:
			plays = float(tag.find("weight").string)
		yield unescape(name), plays
dataset/ETHPy150Open andrewgodwin/lastgraph/lastgui/xml.py/weekly_artists