def do_finalize(shutit):
	"""Runs finalize phase; run after all builds are complete and all modules
	have been stopped.
	"""
	cfg = shutit.cfg
	# Stop all the modules
	if cfg['build']['interactive'] >= 3:
		print('\nStopping all modules before finalize phase' + shutit_util.colour('32', '\n\n[Hit return to continue]\n'))
		shutit_util.util_raw_input()
	stop_all(shutit)
	# Finalize in reverse order
	shutit.log('PHASE: finalize', level=logging.DEBUG)
	if 3 >= cfg['build']['interactive']:
		print('\nNow doing finalize phase, which we do when all builds are ' + 'complete and modules are stopped' + shutit_util.colour('32', '\n\n[Hit return to continue]\n'))
		shutit_util.util_raw_input()
	# Login at least once to get the exports.
	for module_id in shutit_util.module_ids(shutit, rev=True):
		# Only finalize if it's thought to be installed.
		if shutit_util.is_installed(shutit, shutit.shutit_map[module_id]):
			shutit.login(prompt_prefix=module_id,command='bash')
			if not shutit.shutit_map[module_id].finalize(shutit):
				shutit.fail(module_id + ' failed on finalize', shutit_pexpect_child=shutit.get_shutit_pexpect_session_from_id('target_child').pexpect_child)
			shutit.logout()
dataset/ETHPy150Open ianmiell/shutit/shutit_main.py/do_finalize/swapped operands of `>=`