<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wait_for_vacancy(self, processor_type):
 """Waits for a particular processor type to have the capacity to handle additional transactions or until is_cancelled is True. Args: processor_type (ProcessorType):
 The family, and version of the transaction processor. Returns: Processor """


        with self._condition:
            self._condition.wait_for(lambda: (
                self._processor_available(processor_type)
                or self._cancelled_event.is_set()))
            if self._cancelled_event.is_set():
                raise WaitCancelledException()
            processor = self[processor_type].next_processor()
            return processor