def validate_memory_quota(context):
	required = context['total_memory'] + context['max_memory']
	specified = context.get('org_quota', None)
	if specified is None:
		# We default to twice the total size
		# For most cases this is generous, but there's no harm in it
		context['org_quota'] = context['total_memory'] * 2
	elif specified < required:
		print >> sys.stderr, 'Specified org quota of', specified, 'MB is insufficient'
		print >> sys.stderr, 'Required quota is at least the total package size of', context['total_memory'], 'MB'
		print >> sys.stderr, 'Plus enough room for blue/green deployment of the largest app:', context['max_memory'], 'MB'
		print >> sys.stderr, 'For a total of:', required, 'MB'
		sys.exit(1)
dataset/ETHPy150Open cf-platform-eng/tile-generator/lib/build.py/validate_memory_quota/original