code: def get_next_run(self):
  		
  
  		if self.is_finished:
  			return(None)
  		
  		for k,v in self.data.items():
  			if v.status == 'QUEUED':
  				assert v.budget == self.budgets[self.stage], 'Configuration budget does not align with current stage!'
  				v.status = 'RUNNING'
  				self.num_running += 1
  				return(k, v.config, v.budget)
  
  		# check if there are still slots to fill in the current stage and return that
  		if (self.actual_num_configs[self.stage] < self.num_configs[self.stage]):
  			self.add_configuration()
  			return(self.get_next_run())
  
  		if self.num_running == 0:
  			# at this point a stage is completed
  			self.process_results()
  			return(self.get_next_run())
  
  		return(None)
docs: function to return the next configuration and budget to run.
  
  		This function is called from HB_master, don't call this from
  		your script.
  
  		It returns None if this run of SH is finished or there are
  		pending jobs that need to finish to progress to the next stage.
  
  		If there are empty slots to be filled in the current SH stage
  		(which never happens in the original SH version), a new
  		configuration will be sampled and scheduled to run next.