Set command mappings according to rTorrent version.
977623
def _set_mappings(self):
        
        try:
            self._versions = (self.system.client_version(), self.system.library_version(),)
            self._version_info = tuple(int(i) for i in self._versions[0].split('.'))
            self._use_deprecated = self._version_info < (0, 8, 7)

            # Merge mappings for this version
            self._mapping = self._mapping.copy()
            for key, val in sorted(i for i in vars(config).items() if i[0].startswith("xmlrpc_")):
                map_version = tuple(int(i) for i in key.split('_')[1:])
                if map_version <= self._version_info:
                    if config.debug:
                        self.LOG.debug("MAPPING for %r added: %r" % (map_version, val))
                    self._mapping.update(val)
            self._fix_mappings()
        except ERRORS as exc:
            raise error.LoggableError("Can't connect to %s (%s)" % (self._url, exc))

        return self._versions, self._version_info
789526
async def SetTools(self, agent_tools):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='Upgrader',
                   request='SetTools',
                   version=1,
                   params=_params)
        _params['agent-tools'] = agent_tools
        reply = await self.rpc(msg)
        return reply
877130
private function setMagicConstants(): void
  {
    $real_path = realpath($this->sourceFilename);

    $this->replace['__FILE__']    = "'".MetaDataLayer::realEscapeString($real_path)."'";
    $this->replace['__ROUTINE__'] = "'".$this->routineName."'";
    $this->replace['__DIR__']     = "'".MetaDataLayer::realEscapeString(dirname($real_path))."'";
  }
462937
protected function setOptionsForLastCommand() {
    if (isset($this->commands)) {
      $numberOfCommands = count($this->commands);
      $correspondingCommand = $numberOfCommands - 1;
      $this->options[$correspondingCommand] = $this->arguments;
      $this->arguments = '';
    }
    elseif (isset($this->arguments) && !empty($this->arguments)) {
      throw new TaskException($this, "A drush command must be added to the stack before setting arguments: {$this->arguments}");
    }
  }
873957
def set_op_version(version):
    '''
    
    '''

    cmd = 'volume set all cluster.op-version {0}'.format(version)
    root = _gluster_xml(cmd)

    if not _gluster_ok(root):
        return False, root.find('opErrstr').text

    return root.find('output').text
67688
def UpdateDNS(self, domain, environment):
        """"""
        self.dns_set_conf(domain, self.dns.config,
                          environment, self.dns.token)
1109192
def set_version(version):
    

    with open(FILENAME) as pythonfile:
        content = pythonfile.read()

    output = re.sub(RE_VERSION, r"\1'{}'".format(version), content)

    if content == output:
        error('failed updating {}'.format(FILENAME))

    with open(FILENAME, 'w') as pythonfile:
        pythonfile.write(output)
749769
def set_options(self, options):
        
        # COMMAND LINE OPTIONS
        self.wipe = options.get("wipe")
        self.test_run = options.get("test_run")
        self.quiet = options.get("test_run")
        self.container_name = options.get("container")
        self.verbosity = int(options.get("verbosity"))
        self.syncmedia = options.get("syncmedia")
        self.syncstatic = options.get("syncstatic")
        if self.test_run:
            self.verbosity = 2
        cli_includes = options.get("includes")
        cli_excludes = options.get("excludes")

        # CUMULUS CONNECTION AND SETTINGS FROM SETTINGS.PY
        if self.syncmedia and self.syncstatic:
            raise CommandError("options --media and --static are mutually exclusive")
        if not self.container_name:
            if self.syncmedia:
                self.container_name = CUMULUS["CONTAINER"]
            elif self.syncstatic:
                self.container_name = CUMULUS["STATIC_CONTAINER"]
            else:
                raise CommandError("must select one of the required options, either --media or --static")
        settings_includes = CUMULUS["INCLUDE_LIST"]
        settings_excludes = CUMULUS["EXCLUDE_LIST"]

        # PATH SETTINGS
        if self.syncmedia:
            self.file_root = os.path.abspath(settings.MEDIA_ROOT)
            self.file_url = settings.MEDIA_URL
        elif self.syncstatic:
            self.file_root = os.path.abspath(settings.STATIC_ROOT)
            self.file_url = settings.STATIC_URL
        if not self.file_root.endswith("/"):
            self.file_root = self.file_root + "/"
        if self.file_url.startswith("/"):
            self.file_url = self.file_url[1:]

        # SYNCSTATIC VARS
        # combine includes and excludes from the cli and django settings file
        self.includes = list(set(cli_includes + settings_includes))
        self.excludes = list(set(cli_excludes + settings_excludes))
        # transform glob patterns to regular expressions
        self.local_filenames = []
        self.create_count = 0
        self.upload_count = 0
        self.update_count = 0
        self.skip_count = 0
        self.delete_count = 0
975068
def setBehaviorFromVersionLine(self, versionLine):
        
        v = getBehavior(self.name, versionLine.value)
        if v:
            self.setBehavior(v)
247141
def __set_ethernet_uris(self, ethernet_names, operation="add"):
        """"""
        if not isinstance(ethernet_names, list):
            ethernet_names = [ethernet_names]

        associated_enets = self.data.get('networkUris', [])
        ethernet_uris = []

        for i, enet in enumerate(ethernet_names):
            enet_exists = self._ethernet_networks.get_by_name(enet)
            if enet_exists:
                ethernet_uris.append(enet_exists.data['uri'])
            else:
                raise HPOneViewResourceNotFound("Ethernet: {} does not exist".foramt(enet))

        if operation == "remove":
            enets_to_update = sorted(list(set(associated_enets) - set(ethernet_uris)))
        elif operation == "add":
            enets_to_update = sorted(list(set(associated_enets).union(set(ethernet_uris))))
        else:
            raise ValueError("Value {} is not supported as operation. The supported values are: ['add', 'remove']")

        if set(enets_to_update) != set(associated_enets):
            updated_network = {'networkUris': enets_to_update}
            self.update(updated_network)
1124448
def set_command(value, parameter):
    
    conf = get_config_obj()

    section = "cli"
    if "." in parameter:
        section, parameter = parameter.split(".", 1)

    # ensure that the section exists
    if section not in conf:
        conf[section] = {}
    # set the value for the given parameter
    conf[section][parameter] = value

    # write to disk
    safeprint("Writing updated config to {}".format(conf.filename))
    conf.write()
770733
protected function setRouteProperties()
    {
        $this->current_route = $this->route->get();
        $this->command = $this->current_route['command'];
        $this->params = gplcart_array_trim($this->current_route['params'], true);
    }
84876
protected void setFormats(RTPFormats formats) {
		try {
			this.rtpChannel.setFormatMap(formats);
			this.rtpChannel.setOutputFormats(formats.getFormats());
		} catch (FormatNotSupportedException e) {
			// Never happens
			logger.warn("Could not set output formats", e);
		}
	}
1132173
def _make_it_so(self, command, calls, *args, **kwargs):
        
        observer = kwargs.pop('observer', False)
        args = (self._fields["hash"],) + args
        try:
            for call in calls:
                self._engine.LOG.debug("%s%s torrent #%s (%s)" % (
                    command[0].upper(), command[1:], self._fields["hash"], call))
                if call.startswith(':') or call[:2].endswith('.'):
                    namespace = self._engine._rpc
                else:
                    namespace = self._engine._rpc.d
                result = getattr(namespace, call.lstrip(':'))(*args)
                if observer:
                    observer(result)
        except xmlrpc.ERRORS as exc:
            raise error.EngineError("While %s torrent #%s: %s" % (command, self._fields["hash"], exc))
872778
def set_throttle(self, name):
        
        if name.lower() == "null":
            name = "NULL"
        if name.lower() == "none":
            name = ''

        if name not in self._engine.known_throttle_names:
            if self._engine._rpc.throttle.up.max(xmlrpc.NOHASH, name) == -1:
                if self._engine._rpc.throttle.down.max(xmlrpc.NOHASH, name) == -1:
                    raise error.UserError("Unknown throttle name '{}'".format(name))
            self._engine.known_throttle_names.add(name)

        if (name or "NONE") == self.throttle:
            self._engine.LOG.debug("Keeping throttle %r on torrent #%s" % (self.throttle, self._fields["hash"]))
            return

        active = self.is_active
        if active:
            self._engine.LOG.debug("Torrent #%s stopped for throttling" % (self._fields["hash"],))
            self.stop()
        self._make_it_so("setting throttle %r on" % (name,), ["throttle_name.set"], name)
        if active:
            self._engine.LOG.debug("Torrent #%s restarted after throttling" % (self._fields["hash"],))
            self.start()
1124478
def _set_default_versions(self, config):
        
        out = []
        for name in ["gatk", "gatk4", "picard", "mutect"]:
            v = tz.get_in(["resources", name, "version"], config)
            if not v:
                try:
                    v = programs.get_version(name, config=config)
                except KeyError:
                    v = None
            out.append(v)
        self._gatk_version, self._gatk4_version, self._picard_version, self._mutect_version = out
614571
def _set_version(self, version):
        '''
        
        '''
        if not version:
            return

        exact_version = re.sub(r'[<>=+]*', '', version)
        self._op = version.replace(exact_version, '') or None
        if self._op and self._op not in self.Z_OP:
            raise CommandExecutionError('Zypper do not supports operator "{0}".'.format(self._op))
        self.version = exact_version