Replace frequency.
486156
protected function replaceFrequency()
    {
        $this->stub = \str_replace('DummyFrequency', \rtrim($this->options['frequency'], '()'), $this->stub);

        return $this;
    }
817341
def ensure_frequencies(self, frequencies):
        """"""
        if not frequencies:
            return {}
        if not isinstance(frequencies, dict):
            raise ValueError("frequencies should be dict")
        frequencies = {
            host: Frequency.ensure_frequency(frequencies[host]) for host in frequencies
        }
        return frequencies
143655
def change_octave(self, diff):
        """"""
        self.octave += diff
        if self.octave < 0:
            self.octave = 0
856093
def sub(self, replace, string, count=0):
      
      return self.re.sub(replace, string, count)
181309
function replaceAt(items, item, index) {
  var copy = items.slice();
  copy.splice(index, 1, item);
  return copy;
}
1081927
def replace(self, child, replacement):
        """"""
        for i in range(len(self.chunks)):
            if self.chunks[i] == child:
                self.chunks[i] = replacement
580488
def replace(self, key, val, time=0, min_compress_len=0):
        '''
        '''
        return self._set("replace", key, val, time, min_compress_len)
360839
def replace_each(text, items, count=None, strip=False):
    '''
    
    '''
    for a,b in items:
        text = replace(text, a, b, count=count, strip=strip)
    return text
340137
public void replace(V oldValue, V newValue) {
		if (values.contains(oldValue)) {
			int index = values.indexOf(oldValue);
			values.remove(oldValue);
			values.add(index, newValue);
			
			if (oldValue instanceof JsonEntity) {
				((JsonEntity)oldValue).removePropertyChangeListener(propListener);
			}
			
			if (newValue instanceof JsonEntity) {
				((JsonEntity)newValue).removePropertyChangeListener(propListener);
			}
			
			firePropertyChange("#" + index, oldValue, newValue);
		}
	}
1076920
def set_frequency(self, host, sem=None, interval=None):
        """"""
        # single sem or global sem
        sem = sem or self.sem
        interval = self.interval if interval is None else interval
        frequency = Frequency(sem, interval, host)
        frequencies = {host: frequency}
        self.update_frequency(frequencies)
        return frequency
59786
def repeat(self, repeat):
        """"""
        shuffle = self.shuffle
        self.play_mode = PLAY_MODE_BY_MEANING[(shuffle, repeat)]
64673
public void replaceWithNewInstances(Collection<SSTableReader> toReplace, Collection<SSTableReader> replaceWith)
    {
        replaceReaders(toReplace, replaceWith, true);
    }
686550
def _replace(self, data, replacements):
        
        for find, repl in replacements:
            data = data.replace(find, repl)
        return data
1093001
function datePlusFrequency(date, frequency) {
        var minutes;

        date = date || new Date();  // default is today
        frequency = frequency || 'hourly';  // default is hourly

        switch (frequency) {
            case 'none':
                minutes = 525949;  // set far in future
                break;
            case 'instant':
                minutes = 1;
                break;
            case 'hourly':
                minutes = 60;
                break;
            case 'daily':
                minutes = 1440;
                break;
            case 'weekly':
                minutes = 10080;
                break;
            default:
                minutes = 0;
        }

        return new Date(date.getTime() + (minutes * 60000));
    }
623001
def frequency(self):
        
        freqOptions = ("YEARLY", "MONTHLY", "WEEKLY", "DAILY")
        if self.rule._freq < len(freqOptions):
            return freqOptions[self.rule._freq]
        else:
            return "unsupported_frequency_{}".format(self.rule._freq)
724917
function replaceString(content, search, replace) {
        var index = 0;

        do {
          index = content.indexOf(search, index);

          if (index !== -1) {
            content = content.substring(0, index) + replace + content.substr(index + search.length);
            index += replace.length - search.length + 1;
          }
        } while (index !== -1);

        return content;
      }
541474
def replace_command(command, broken, matched):
    """"""
    new_cmds = get_close_matches(broken, matched, cutoff=0.1)
    return [replace_argument(command.script, broken, new_cmd.strip())
            for new_cmd in new_cmds]