Replace current providers with given ones
163615
def set_providers(self, *providers):
        """"""
        if self.providers:
            self.clear()
        for provider in providers:
            self.add(provider)
781355
def Replace(self, **kw):
        
        try:
            kwbd = kw['BUILDERS']
        except KeyError:
            pass
        else:
            kwbd = BuilderDict(kwbd,self)
            del kw['BUILDERS']
            self.__setitem__('BUILDERS', kwbd)
        kw = copy_non_reserved_keywords(kw)
        self._update(semi_deepcopy(kw))
        self.scanner_map_delete(kw)
760665
void updateProviders(ConsumerConfig config, List<Instance> instances) {
        if (LOGGER.isInfoEnabled(config.getAppName())) {
            LOGGER.infoWithApp(config.getAppName(),
                "Receive update provider: serviceName={}, size={}, data={}", config.getInterfaceId(), instances.size(),
                instances);
        }
        List<ProviderInfoListener> providerInfoListeners = providerListenerMap.get(config);
        if (CommonUtils.isNotEmpty(providerInfoListeners)) {
            List<ProviderInfo> providerInfos = NacosRegistryHelper.convertInstancesToProviders(instances);
            List<ProviderInfo> matchProviders = RegistryUtils.matchProviderInfos(config, providerInfos);

            for (ProviderInfoListener providerInfoListener : providerInfoListeners) {
                providerInfoListener
                    .updateAllProviders(Collections.singletonList(new ProviderGroup().addAll(matchProviders)));
            }
        }
    }
735283
def replace_cas(key, value, cas, ttl=nil, options=nil)
      ttl ||= @options[:expires_in].to_i
      perform(:replace, key, value, ttl, cas, options)
    end
1296944
public B setProviderNames(List<String> providers) {
        Objects.requireNonNull(providers);
        return set(AbstractQuery.KEY_QUERY_PROVIDERS, providers);
    }
836168
def _use_provider_states(
        provider_state_fixtures_with_params: List[Tuple[ProviderStateFixture, Dict]]
) -> Generator:
    """"""
    with contextlib.ExitStack() as stack:
        for provider_state_fixture, params in provider_state_fixtures_with_params:
            stack.enter_context(provider_state_fixture(**params))

        yield
815915
function (key, func) {
				if (needs[key]) {
					provide(nucleus, key, func);
				} else if (!providers[key]) {
					providers[key] = func;
				}
				return me;
			}
1141660
def add_providers(self, *providers: Type[BaseProvider]) -> None:
        
        for provider in providers:
            self.add_provider(provider)
278239
def substitute(ctx, text, old_text, new_text, instance_num=-1):
    
    text = conversions.to_string(text, ctx)
    old_text = conversions.to_string(old_text, ctx)
    new_text = conversions.to_string(new_text, ctx)

    if instance_num < 0:
        return text.replace(old_text, new_text)
    else:
        splits = text.split(old_text)
        output = splits[0]
        instance = 1
        for split in splits[1:]:
            sep = new_text if instance == instance_num else old_text
            output += sep + split
            instance += 1
        return output
470038
def _replace_services_in_args(self, args):
        
        _check_type('args', args, list)

        new_args = []
        for arg in args:
            if isinstance(arg, list):
                new_args.append(self._replace_services_in_args(arg))
            elif isinstance(arg, dict):
                new_args.append(self._replace_services_in_kwargs(arg))
            elif isinstance(arg, string_types):
                new_args.append(self._replace_service(arg))
            else:
                new_args.append(arg)
        return new_args
347342
def replace(self):
        

        replacement = self._tw.tasks.filter(' '.join(self._uuids))
        self.__class__ = replacement.__class__
        self.__dict__ = replacement.__dict__
1159511
def replace_all_calls(mod, orig, repl):
    
    rc = ReplaceCalls(orig, repl)
    rc.visit(mod)
    return rc.calls
122518
def load_replace_candidate(self, filename=None, config=None):
        """"""
        self.config_replace = True
        self._load_candidate(filename, config, True)
288438
def add_replacer(self, replacer):
        
        """
        self._pat = None
        self._pats.extend(replacer._pats)
        self._funs.extend(replacer._funs)
1104691
def replace_source(self, source, name, modules, prefix):
        
        needs_windll = False

        def _func_replacer(match, modules, windll):
            matched = match.group(0)
            if matched in self.BLACKLIST:
                return matched
            module = self.database.query_func_module(matched)
            if module:
                try:
                    modules[module[0]] += [module[1]]
                except KeyError:
                    modules[module[0]] = [module[1]]
                if windll:
                    return '{}->{}.{}'.format(windll, *module)
                return '{}->{}'.format(*module)
            return matched

        replacer = partial(
            _func_replacer, modules=modules, windll='windll')
        replaced = re.sub(r'[_\w][_\w\d]*(?=\s*\()',
                          replacer, source)

        if source != replaced:
            needs_windll = True

        str_table = {}

        def _string_replacer(match):
            matched = match.group()[1:-1]
            try:
                number = str_table[matched]
            except KeyError:
                number = len(str_table) + 1
                str_table.update({matched: number})
            return '{}{}'.format(prefix, number)

        replaced = re.sub(r'".+?"', _string_replacer, replaced)
        strings, relocs = self.build_strings(str_table, prefix)
        strings = ''.join(strings).strip()
        windll32 = reloc_var('windll', 'reloc_delta', True,
                             'windll_t')
        if needs_windll:
            relocs += [windll32]
        if strings:
            strings = '\n' + strings
            if not needs_windll:
                relocs += [windll32]
                needs_windll = True
        windll64 = ''
        if needs_windll:
            windll64 = '{0} *{1} = &_{1};\n'.format('windll_t',
                                                    'windll')
        relocs = reloc_both(''.join(relocs), windll64)
        if name in ['main']:
            replaced = '\ninit();' + replaced
        return strings + relocs + replaced
1059492
def replace(self, replacements):
        

        for old_var, new_var in replacements.items():
            old_var_id = id(old_var)
            if old_var_id in self._object_mapping:
                # FIXME: we need to check if old_var still exists in the storage
                old_so = self._object_mapping[old_var_id]  # type: StoredObject
                self._store(old_so.start, new_var, old_so.size, overwrite=True)

        return self
1367066
function replace(subject, pattern, replacement, options = []) {
  const opt_global = proplists.get_value(Symbol.for('global'), options);

  let regex;
  if (opt_global !== Symbol.for('undefined')) {
    regex = new RegExp(pattern, 'g');
  } else {
    regex = new RegExp(pattern, '');
  }

  return subject.replace(regex, replacement);
}