def handle_unlicensed_operations(news, belittle, pre_committal, reactivate): for operation in unlicensed_operations: if not operation['pre_committal']: reactivate(operation); else: news.append(belittle(operation['name']) + " has decided to obtain the necessary licenses!")