nodes: 0, module; 1, function_definition; 2, function_name:get_next_of_type; 3, parameters; 4, block; 5, identifier:self; 6, identifier:processor_type; 7, expression_statement; 8, with_statement; 9, comment:"""Get the next available processor of a particular type and increment
          its occupancy counter.
  
          Args:
              processor_type (ProcessorType): The processor type associated with
                  a zmq identity.
  
          Returns:
              (Processor): Information about the transaction processor
          """; 10, with_clause; 11, block; 12, with_item; 13, if_statement; 14, try_statement; 15, expression_statement; 16, return_statement; 17, attribute; 18, comparison_operator:processor_type not in self; 19, block; 20, block; 21, except_clause; 22, call; 23, identifier:processor; 24, identifier:self; 25, identifier:_condition; 26, identifier:processor_type; 27, identifier:self; 28, expression_statement; 29, expression_statement; 30, identifier:NoProcessorVacancyError; 31, block; 32, attribute; 33, argument_list; 34, call; 35, assignment; 36, expression_statement; 37, identifier:processor; 38, identifier:inc_occupancy; 39, attribute; 40, argument_list; 41, identifier:processor; 42, call; 43, assignment; 44, identifier:self; 45, identifier:wait_for_registration; 46, identifier:processor_type; 47, attribute; 48, argument_list; 49, identifier:processor; 50, call; 51, subscript; 52, identifier:next_processor; 53, attribute; 54, argument_list; 55, identifier:self; 56, identifier:processor_type; 57, identifier:self; 58, identifier:wait_for_vacancy; 59, identifier:processor_type
code: def get_next_of_type(self, processor_type):
          """Get the next available processor of a particular type and increment
          its occupancy counter.
  
          Args:
              processor_type (ProcessorType): The processor type associated with
                  a zmq identity.
  
          Returns:
              (Processor): Information about the transaction processor
          """
          with self._condition:
              if processor_type not in self:
                  self.wait_for_registration(processor_type)
              try:
                  processor = self[processor_type].next_processor()
              except NoProcessorVacancyError:
                  processor = self.wait_for_vacancy(processor_type)
              processor.inc_occupancy()
              return processor