Build generator of delays to wait between each call

        :param string config_name: configuration name
505129
def ha_get_delay_policy(self, config_name):
        
        config = self.ha_get_config(config_name)
        delay_policy_conf = config.delay_config
        delay_policy_conf = copy.deepcopy(delay_policy_conf)
        delay_policy_conf.update(delay=config.delay)
        return self._retry_delays_class.get(
            config.delay_policy,
            **delay_policy_conf
        )
1222364
def wait_for_term():
    

    class Waiter:

        def __init__(self):
            self.sleeping = True
            import signal #@Reimport
            self.oldhandler = signal.signal(signal.SIGTERM,
                                            self._SIGTERMHandler)

        def _SIGTERMHandler(self, number, frame):
            self.sleeping = False

        def sleep(self):
            while self.sleeping:
                time.sleep(0.1)

    waiter = Waiter()
    waiter.sleep()
927804
def configuration(name, type)
      default_settings = default_settings_for_type(type)
      configurations = configurations_of_type(type)

      build_configuration = if name.nil?
                              configurations.first
                            else
                              configurations.detect do |c|
                                c.name == name.to_s
                              end
                            end

      if build_configuration.nil?

        name = type.to_s.capitalize if name.nil?

        build_configuration = Configuration.new(name) do |b|
          b.type = type
          b.settings.merge!(default_settings)

          yield(b) if block_given?
        end

        @configurations ||= []
        @configurations << build_configuration
      end

      build_configuration
    end
1328226
def work_wait(self):
        

        if len(self.queues_with_notify) > 0:
            # https://github.com/antirez/redis/issues/874
            connections.redis.blpop(*(self.queues_with_notify + [max(1, int(self.config["max_latency"]))]))
        else:
            gevent.sleep(self.config["max_latency"])
1030317
def _wait_for_machine_finish(self, name):
        
        # TODO: rewrite it using probes module in utils
        for foo in range(constants.DEFAULT_RETRYTIMEOUT):
            time.sleep(constants.DEFAULT_SLEEP)
            out = run_cmd(
                ["machinectl", "--no-pager", "status", name],
                ignore_status=True, return_output=True)
            if out != 0:
                return True
        raise ConuException(
            "Unable to stop machine %s within %d" %
            (name, constants.DEFAULT_RETRYTIMEOUT))
1368354
def on_config(self, config):
        ""
        #print("Here is the config:", config)

        # fetch variables from YAML file:
        self._variables = config.get(YAML_SUBSET)

        # add variables and functions from the module:
        module_reader.load_variables(self._variables, config)

        print("Variables:", self.variables)
388856
def activate_conf_set(self, set_name):
        '''

        '''
        with self._mutex:
            if not set_name in self.conf_sets:
                raise exceptions.NoSuchConfSetError(set_name)
            self._conf.activate_configuration_set(set_name)
458593
def get_build_configuration_by_name(name):
    
    response = utils.checked_api_call(pnc_api.build_configs, 'get_all', q='name==' + name).content
    if not response:
        return None
    return response[0]
545956
private function get_config( $config_name ) {
		// Check that we have our config_name defined in our config
		if ( isset( $this->config[ $config_name ] ) !== true ) {
			throw new \Exception(
				'No "' . $config_name . '" config set. I don\'t know what to load!'
			);
		}
		else {
			// If its set, just hand it over
			return $this->config[ $config_name ];
		}
	}
18452
private static void waitUntilFinished(FluoConfiguration config) {
    try (Environment env = new Environment(config)) {
      List<TableRange> ranges = getRanges(env);

      outer: while (true) {
        long ts1 = env.getSharedResources().getOracleClient().getStamp().getTxTimestamp();
        for (TableRange range : ranges) {
          boolean sawNotifications = waitTillNoNotifications(env, range);
          if (sawNotifications) {
            ranges = getRanges(env);
            // This range had notifications. Processing those notifications may have created
            // notifications in previously scanned ranges, so start over.
            continue outer;
          }
        }
        long ts2 = env.getSharedResources().getOracleClient().getStamp().getTxTimestamp();

        // Check to ensure the Oracle issued no timestamps during the scan for notifications.
        if (ts2 - ts1 == 1) {
          break;
        }
      }
    } catch (Exception e) {
      log.error("An exception was thrown -", e);
      System.exit(-1);
    }
  }
245232
def _execute_config_show(self, show_command, delay_factor=.1):
        
        rpc_command = '<CLI><Configuration>{show_command}</Configuration></CLI>'.format(
            show_command=escape_xml(show_command)
        )
        response = self._execute_rpc(rpc_command, delay_factor=delay_factor)
        raw_response = response.xpath('.//CLI/Configuration')[0].text
        return raw_response.strip() if raw_response else ''
347615
def _wait_new_conf(self):
        
        with self.app.conf_lock:
            logger.debug("My Arbiter wants me to wait for a new configuration.")
            # Clear can occur while setting up a new conf and lead to error.
            self.app.schedulers.clear()
            self.app.cur_conf = {}
674062
public void init(String name, Map<String,Object> config) {
        this.name = name;
        this.config = config;
        this.run = true;
        this.stopped = false;
    }
1210266
def method_missing(name, *args, **config, &block)
      if respond_to_missing?(name)
        config[:type] = name
        on(*args, config, &block)
      else
        super
      end
    end
1072084
def cluster_set_config_epoch(self, config_epoch):
        """"""
        fut = self.execute(b'CLUSTER', b'SET-CONFIG-EPOCH', config_epoch)
        return wait_ok(fut)
248852
public static void await(String name) throws InterruptedException {
    try (LockResource r = new LockResource(sLock)) {
      while (!sTimers.containsKey(name)) {
        sCondition.await();
      }
    }
  }
712857
def delay(fn, opts, task, *args, **kwargs):
    
    if opts["stddev"] <= 0:
        t = opts["t"]
    elif opts["pdf"] == "gauss":
        t = random.gauss(opts["t"], opts["stddev"])
    elif opts["pdf"] == "uniform":
        t = random.uniform(opts["t"], opts["stddev"])
    else:
        raise ValueError("unknown delay decorator pdf '{}'".format(opts["pdf"]))

    time.sleep(t)

    return fn(task, *args, **kwargs)