def validate_config(config):
	try:
		validname = re.compile('[a-z][a-z0-9]+(-[a-z0-9]+)*$')
		if validname.match(config['name']) is None:
			print >> sys.stderr, 'product name must start with a letter, be all lower-case letters or numbers, with words optionally seperated by hyphens'
			sys.exit(1)
	except KeyError as e:
		print >> sys.stderr, 'tile.yml is missing mandatory property', e
		sys.exit(1)
	for package in config.get('packages', []):
		try:
			if validname.match(package['name']) is None:
				print >> sys.stderr, 'package name must start with a letter, be all lower-case letters or numbers, with words optionally seperated by hyphens'
				sys.exit(1)
		except __HOLE__ as e:
			print >> sys.stderr, 'package is missing mandatory property', e
			sys.exit(1)
	return config
dataset/ETHPy150Open cf-platform-eng/tile-generator/lib/build.py/validate_config