Sets data from reactor config
765009
def set_data_from_reactor_config(self):
        
        reactor_config_override = self.user_params.reactor_config_override.value
        reactor_config_map = self.user_params.reactor_config_map.value
        data = None

        if reactor_config_override:
            data = reactor_config_override
        elif reactor_config_map:
            config_map = self.osbs_api.get_config_map(reactor_config_map)
            data = config_map.get_data_by_key('config.yaml')

        if not data:
            if self.user_params.flatpak.value:
                raise OsbsValidationException("flatpak_base_image must be provided")
            else:
                return

        source_registry_key = 'source_registry'
        registry_organization_key = 'registries_organization'
        req_secrets_key = 'required_secrets'
        token_secrets_key = 'worker_token_secrets'
        flatpak_key = 'flatpak'
        flatpak_base_image_key = 'base_image'

        if source_registry_key in data:
            self.source_registry = data[source_registry_key]
        if registry_organization_key in data:
            self.organization = data[registry_organization_key]

        if self.user_params.flatpak.value:
            flatpack_base_image = data.get(flatpak_key, {}).get(flatpak_base_image_key, None)
            if flatpack_base_image:
                self.base_image = flatpack_base_image
                self.user_params.base_image.value = flatpack_base_image
            else:
                raise OsbsValidationException("flatpak_base_image must be provided")

        required_secrets = data.get(req_secrets_key, [])
        token_secrets = data.get(token_secrets_key, [])
        self._set_required_secrets(required_secrets, token_secrets)
415608
def in_reactor(f):
    """"""
    def wrap(*args, **kwargs):
        from twisted.internet import reactor, defer
        result = []

        def _async():
            d = defer.maybeDeferred(f, *args, **kwargs)

            @d.addErrback
            def eb(f):
                f.printTraceback()

            @d.addBoth
            def do_stop(r):
                result.append(r)
                reactor.stop()
        reactor.callWhenRunning(_async)
        reactor.run()
        return result[0]
    wrap.__doc__ = f.__doc__
    wrap.__name__ = f.__name__
    wrap._orig = f  # for tests
    return wrap
806160
def _accept(self):
        
        logger.warning("Reactor " + self._name + " is starting")
        while self.running:
            try:
                self._completeTask()
            except:
                logger.exception("Unexpected exception during request processing")
        logger.warning("Reactor " + self._name + " is terminating")
706971
private void setAtomTypeData() throws Exception {

        key = "data" + sid;
        List data = new Vector();

        String sradius = st.nextToken();
        String swell = st.nextToken();
        String sapol = st.nextToken();
        String sNeff = st.nextToken();
        //st.nextToken();
        String sDA = st.nextToken();
        String sq0 = st.nextToken();
        String spbci = st.nextToken();
        String sfcadj = st.nextToken();

        stvdW.nextToken();
        stvdW.nextToken();
        String sA = stvdW.nextToken();
        String sG = stvdW.nextToken();

        try {
            double well = new Double(swell).doubleValue();
            double apol = new Double(sapol).doubleValue();
            double Neff = new Double(sNeff).doubleValue();
            double fcadj = new Double(sfcadj).doubleValue();
            //double pbci = new Double(spbci).doubleValue();
            double a = new Double(sA).doubleValue();
            double g = new Double(sG).doubleValue();

            data.add(new Double(well));
            data.add(new Double(apol));
            data.add(new Double(Neff));
            data.add(new String(sDA));
            data.add(new Double(fcadj));
            data.add(new Double(spbci));
            data.add(new Double(a));
            data.add(new Double(g));

        } catch (NumberFormatException nfe) {
            throw new IOException("Data: Malformed Number due to:" + nfe);
        }

        LOG.debug("data : well,apol,Neff,sDA,fcadj,spbci,a,g " + data);
        parameterSet.put(key, data);

        key = "vdw" + sid;
        data = new Vector();
        try {
            double radius = new Double(sradius).doubleValue();
            data.add(new Double(radius));

        } catch (NumberFormatException nfe2) {
            LOG.debug("vdwError: Malformed Number due to:" + nfe2);
        }
        parameterSet.put(key, data);

        key = "charge" + sid;
        data = new Vector();
        try {
            double q0 = new Double(sq0).doubleValue();
            data.add(new Double(q0));
        } catch (NumberFormatException nfe3) {
            System.err.println("Charge: Malformed Number due to:" + nfe3);
        }
        parameterSet.put(key, data);
    }
408180
def configure_polonium(polonium_configuration_object)
      {
        'selenium_server_host'      => :selenium_server_address,
        'selenium_server_port'      => :selenium_server_port,
        'browser'                   => :selenium_browser_key,
        'external_app_server_host'  => :application_address,
        'external_app_server_port'  => :application_port
      }.each do |polonium_configuration_method, our_accessor|
        polonium_configuration_object.send("#{polonium_configuration_method}=", self.send(our_accessor).to_s)
      end
    end
156246
def set(self, key, data):
        '''
        
        '''
        if isinstance(data, dict):
            self._volatile_data[key] = {k: v for (k, v) in data.items()}
        else:
            self._volatile_data[key] = data
668972
def set_params(self, data):
        
        bytes_io = BytesIO(data)

        assert struct.unpack('<I', bytes_io.read(4))[0] == resPQ.constructor

        self.nonce = bytes_io.read(16)
        self.server_nonce = bytes_io.read(16)

        self.pq = deserialize_string(bytes_io)

        assert struct.unpack('<I', bytes_io.read(4))[0] == 0x1cb5c415  # long vector
        count = struct.unpack('<l', bytes_io.read(4))[0]
        for _ in range(count):
            self.server_public_key_fingerprints.append(struct.unpack('<q', bytes_io.read(8))[0])
510443
def config_set(name, value, host=None, port=None, db=None, password=None):
    '''
    
    '''
    server = _connect(host, port, db, password)
    return server.config_set(name, value)
598423
async def async_set_config(self, data):
        
        field = self.deconz_id + '/config'
        await self._async_set_state_callback(field, data)
1229942
def _common_setup(self):
        
        self._started = True
        self._reactor = self._reactorFactory()
        self._registry = ResultRegistry()
        # We want to unblock EventualResult regardless of how the reactor is
        # run, so we always register this:
        self._reactor.addSystemEventTrigger(
            "before", "shutdown", self._registry.stop)
1358340
def config(self, config):
        """"""
        for section, data in config.items():
            for variable, value in data.items():
                self.set_value(section, variable, value)
901556
def reactor
      Disclosure.configuration.reactor_classes.select do |rc|
        rc.name == self.reactor_class
      end.first
    end
861494
function setData (moduleName, data) {
    // get module - throws error if not defined
    var module = getModule(moduleName)
    // set data
    module.meta.data = data
    // return module
    return ImmutableCore
}
283661
def setNNIManagerIp(experiment_config, port, config_file_name):
    ''''''
    if experiment_config.get('nniManagerIp') is None:
        return True, None
    ip_config_dict = dict()
    ip_config_dict['nni_manager_ip'] = { 'nniManagerIp' : experiment_config['nniManagerIp'] }
    response = rest_put(cluster_metadata_url(port), json.dumps(ip_config_dict), REST_TIME_OUT)
    err_message = None
    if not response or not response.status_code == 200:
        if response is not None:
            err_message = response.text
            _, stderr_full_path = get_log_path(config_file_name)
            with open(stderr_full_path, 'a+') as fout:
                fout.write(json.dumps(json.loads(err_message), indent=4, sort_keys=True, separators=(',', ':')))
        return False, err_message
    return True, None
1289274
def set_data(new_data, mode)
      raise ArgumentError, "Data can't be set unless mode is :command or :merge" unless %i[command merge].include? mode
      raise ArgumentError, 'Data must be a hash when in merge mode' if mode == :merge && !new_data.is_a?(Hash)

      validate_rows new_data if mode == :command

      @data = new_data.dup
    end
908109
async def viewreaction(self, ctx, *, reactor : str):
        """"""
        data = self.config.get(ctx.message.server.id, {})
        keyword = data.get(reactor, {})

        if not keyword:
            await self.bot.responses.failure(message="Reaction '{}' was not found.".format(reactor))
            return

        response = data.get(reactor, {}).get("response", "")
        reacts = data.get(reactor, {}).get("reaction", [])

        for i, r in enumerate(reacts):
            if ":" in r:
                reacts[i] = "<:" + r + ">"

        reacts = " ".join(reacts) if reacts else "-"
        response = response if response else "-"

        string = "Here's what I say to '{reactor}': {response}\n"\
                 "I'll react to this message how I react to '{reactor}'.".format(reactor=reactor,response=response)

        await self.bot.responses.full(sections=[{"name": "Response", "value": response},
                                                {"name": "Reactions", "value": reacts, "inline": False}])
784222
def set_data(self, data=None, **kwargs):
        '''
        
        '''
        if data is None:
            data = self.get_data(**kwargs)
        setattr(self, '_data', data)
        self.history += self.queue
        self.queue = []