Sets the target niterations/nsamples for the sampler.

        One or the other must be provided, not both.
8244
def set_target(self, niterations=None, eff_nsamples=None):
        
        if niterations is None and eff_nsamples is None:
            raise ValueError("Must provide a target niterations or "
                             "eff_nsamples")
        if niterations is not None and eff_nsamples is not None:
            raise ValueError("Must provide a target niterations or "
                             "eff_nsamples, not both")
        self._target_niterations = int(niterations) \
            if niterations is not None else None
        self._target_eff_nsamples = int(eff_nsamples) \
            if eff_nsamples is not None else None
702922
def set_sampling_strategies(self, filter, strategy_and_parms):
        """"""
        result_list = yield self.list_sensors(filter=filter)
        sensor_dict = {}
        for result in result_list:
            sensor_name = result.object.normalised_name
            resource_name = result.object.parent_name
            if resource_name not in sensor_dict:
                sensor_dict[resource_name] = {}
            try:
                resource_obj = self.children[resource_name]
                yield resource_obj.set_sampling_strategy(sensor_name, strategy_and_parms)
                sensor_dict[resource_name][sensor_name] = strategy_and_parms
                self._logger.debug(
                    'Set sampling strategy on resource %s for %s'
                    % (resource_name, sensor_name))
            except Exception as exc:
                self._logger.error(
                    'Cannot set sampling strategy on resource %s for %s (%s)'
                    % (resource_name, sensor_name, exc))
                sensor_dict[resource_name][sensor_name] = None
        raise tornado.gen.Return(sensor_dict)
1315300
private void setNextSamplePosition(long position)
    {
        tryAgain: while (true)
        {
            position += minIndexInterval;
            long test = indexIntervalMatches++;
            for (int start : startPoints)
                if ((test - start) % BASE_SAMPLING_LEVEL == 0)
                    continue tryAgain;

            nextSamplePosition = position;
            return;
        }
    }
272479
public void setTargetedDeviceCapabilities(com.google.api.ads.admanager.axis.v201808.Technology[] targetedDeviceCapabilities) {
        this.targetedDeviceCapabilities = targetedDeviceCapabilities;
    }
88421
def set_parameters(self, samples: np.ndarray, window_size, data_min, data_max) -> bool:
        
        redraw_needed = False
        if self.samples_need_update:
            self.spectrogram.samples = samples
            redraw_needed = True
            self.samples_need_update = False

        if window_size != self.spectrogram.window_size:
            self.spectrogram.window_size = window_size
            redraw_needed = True

        if data_min != self.spectrogram.data_min:
            self.spectrogram.data_min = data_min
            redraw_needed = True

        if data_max != self.spectrogram.data_max:
            self.spectrogram.data_max = data_max
            redraw_needed = True

        return redraw_needed
350322
public void setTargetFilters(java.util.Map<String, java.util.List<String>> targetFilters) {
        this.targetFilters = targetFilters;
    }
881922
@Override
    public void setTargetSignificance(String value) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setTargetSignificance", value);

        if (ApiJmsConstants.TARGET_SIGNIFICANCE_PREFERRED.equals(value)
            || ApiJmsConstants.TARGET_SIGNIFICANCE_REQUIRED.equals(value)) {
            jcaManagedConnectionFactory.setTargetSignificance(value);
        }
        else {
            // This is not a legal value.
            throw (JMSException) JmsErrorUtils.newThrowable(
                                                            JMSException.class,
                                                            "INVALID_VALUE_CWSIA0261",
                                                            new Object[] { "targetSignificance", value },
                                                            tc);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setTargetSignificance");
    }
170214
public static void addSampler(Sampler sampler) {
    synchronized (samplerLock) {
      Sampler[] samplers = additionalSamplers;
      /* create a new list of samplers from the old, adding this sampler */
      if (samplers != null) {
        Sampler[] newSamplers = new Sampler[samplers.length + 1];
        System.arraycopy(samplers, 0, newSamplers, 0, samplers.length);
        newSamplers[samplers.length] = sampler;
        additionalSamplers = newSamplers;
      } else {
        Sampler[] newSamplers = new Sampler[1];
        newSamplers[0] = sampler;
        additionalSamplers = newSamplers;
      }
    }
  }
413933
def set_rf_samples(n):
    
    forest._generate_sample_indices = (lambda rs, n_samples:
        forest.check_random_state(rs).randint(0, n_samples, n))
338780
def setNonExpert(self):
        
        self._expert = False
        if self._active:
            self.enable()
        else:
            self.disable()
1090399
public void setTargetWindow(final String targetWindow) {
		String currTargWin = getTargetWindow();

		if (!Objects.equals(targetWindow, currTargWin)) {
			getOrCreateComponentModel().targetWindow = targetWindow;
		}
	}
957303
public void setSamplingTargetDocuments(java.util.Collection<SamplingTargetDocument> samplingTargetDocuments) {
        if (samplingTargetDocuments == null) {
            this.samplingTargetDocuments = null;
            return;
        }

        this.samplingTargetDocuments = new java.util.ArrayList<SamplingTargetDocument>(samplingTargetDocuments);
    }
364347
def _set_trainer(self, trainer):
        
        # trainer cannot be replaced for sparse params
        if self._stype != 'default' and self._trainer and trainer and self._trainer is not trainer:
            raise RuntimeError(
                "Failed to set the trainer for Parameter '%s' because it was already set. " \
                "More than one trainers for a %s Parameter is not supported." \
                %(self.name, self._stype))
        self._trainer = trainer
616082
private void setTargets(TrellisNode[][] trellis, double[] scaling, int[] label) {
        TrellisNode[] t0 = trellis[0];

        // Finding the normalizer for our first 'column' in the matrix
        double normalizer = 0.0;
        for (int i = 0; i < numClasses; i++) {
            normalizer += t0[i].expScores[0] * t0[i].beta;
        }

        for (int i = 0; i < numClasses; i++) {
            if (label[0] == i) {
                t0[i].target[0] = 1 - t0[i].expScores[0] * t0[i].beta / normalizer;
            } else {
                t0[i].target[0] = -t0[i].expScores[0] * t0[i].beta / normalizer;
            }
        }

        for (int t = 1; t < label.length; t++) {
            normalizer = 0.0;
            TrellisNode[] tt = trellis[t];
            TrellisNode[] tt1 = trellis[t-1];
            for (int i = 0; i < numClasses; i++) {
                normalizer += tt[i].alpha * tt[i].beta;
            }
            normalizer *= scaling[t];

            for (int i = 0; i < numClasses; i++) {
                TrellisNode tti = tt[i];
                for (int j = 0; j < numClasses; j++) {
                    if (label[t] == i && label[t - 1] == j) {
                        tti.target[j] = 1 - tti.expScores[j] * tt1[j].alpha * tti.beta / normalizer;
                    } else {
                        tti.target[j] = -tti.expScores[j] * tt1[j].alpha * tti.beta / normalizer;
                    }
                }
            }
        }
    }
720545
public void setTargetedAdUnits(com.google.api.ads.admanager.axis.v201808.AdUnitTargeting[] targetedAdUnits) {
        this.targetedAdUnits = targetedAdUnits;
    }
728223
public PointValue setTarget(float targetX, float targetY) {
        set(x, y);
        this.diffX = targetX - originX;
        this.diffY = targetY - originY;
        return this;
    }
545918
public void setTarget(final String t) {
    final GantTarget gt = new GantTarget();
    gt.setValue(t);
    targets.add(gt);
  }