<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def terminate_all(wait=False):
 """ Terminate all processes. :param wait: Wait for each to terminate :type wait: bool :return: :rtype: """

        for instance in Process.instances:
            if instance.is_running():
                instance.terminate(wait)