Updates the scheduled Sampling sampler and the Sampling Date with the
        values provided in the request. If neither Sampling sampler nor Sampling
        Date are present in the request, returns False
430529
def set_sampling_info(self, sample):
        
        if sample.getScheduledSamplingSampler() and sample.getSamplingDate():
            return True
        sampler = self.get_form_value("getScheduledSamplingSampler", sample,
                                      sample.getScheduledSamplingSampler())
        sampled = self.get_form_value("getSamplingDate",
                                      sample.getSamplingDate())
        if not all([sampler, sampled]):
            return False
        sample.setScheduledSamplingSampler(sampler)
        sample.setSamplingDate(DateTime(sampled))
        return True
1295508
public void setSamples(java.util.Collection<Sample> samples) {
        if (samples == null) {
            this.samples = null;
            return;
        }

        this.samples = new java.util.ArrayList<Sample>(samples);
    }
348861
def setSample(self, sample):
        """"""
        if not isinstance(sample, RDD):
            raise TypeError("samples should be a RDD, received %s" % type(sample))
        self._sample = sample
317119
public void update(long aRequestCount, long aMaxTime, long aBytesReceived, long aBytesSent, long aProcessingTime, long aErrorCount) {
        requestCount.setValueAsLong(aRequestCount);
        maxTime.setValueAsLong(aMaxTime);
        bytesReceived.setValueAsLong(aBytesReceived);
        bytesSent.setValueAsLong(aBytesSent);
        processingTime.setValueAsLong(aProcessingTime);
        errorCount.setValueAsLong(aErrorCount);
    }
446415
def update_experiment(self, id, key, value):
        ''''''
        if id not in self.experiments:
            return False
        self.experiments[id][key] = value
        self.write_file()
        return True
607939
def update(self, **kwargs):
        
        if not self.object_id:
            return False

        url = self.build_url(
            self._endpoints.get('item').format(id=self.object_id))

        data = {self._cc(key): value for key, value in kwargs.items() if
                key in {'name',
                        'description'}}  # convert keys to protocol casing
        if not data:
            return False

        response = self.con.patch(url, data=data)
        if not response:
            return False

        new_data = response.json()

        for key in data:
            value = new_data.get(key, None)
            if value:
                setattr(self, self.protocol.to_api_case(key), value)

        return True
259428
def _set_sampling_priority(self, value):
        

        # Ignore debug spans trying to re-enable debug.
        if self.is_debug() and value:
            return False

        try:
            value_num = int(value)
        except ValueError:
            return False
        if value_num == 0:
            self.context.flags &= ~(SAMPLED_FLAG | DEBUG_FLAG)
            return False
        if self.tracer.is_debug_allowed(self.operation_name):
            self.context.flags |= SAMPLED_FLAG | DEBUG_FLAG
            return True
        return False
1208616
def change_sample(self, old_samp_name, new_samp_name, new_site_name=None,
                      new_er_data=None, new_pmag_data=None, replace_data=False):
        
        sample = self.find_by_name(old_samp_name, self.samples)
        if not sample:
            print('-W- {} is not a currently existing sample, so it cannot be updated'.format(old_samp_name))
            return False
        if new_site_name:
            new_site = self.find_by_name(new_site_name, self.sites)
            if not new_site:
                print("""-W- {} is not a currently existing site.
Adding site named: {}""".format(new_site_name, new_site_name))#sample.site or '*empty*', sample)
                new_site = self.add_site(new_site_name)
        else:
            new_site = None
        sample.change_sample(new_samp_name, new_site, new_er_data, new_pmag_data, replace_data)
        return sample
64342
def update(self, value):
    """"""
    super(UniformSample, self).update(value)

    self.count += 1
    c = self.count
    if c < len(self.sample):
      self.sample[c-1] = value
    else:
      r = random.randint(0, c)
      if r < len(self.sample):
        self.sample[r] = value
594374
def save(self):
        
        super(Samples, self).save()
        if self.metadata is not None:
            self.metadata.save()
952045
def _UpdateRequestsAndScheduleFPRs(self, responses, cursor=None):
    """"""

    request_keys = set(
        (r.client_id, r.flow_id, r.request_id) for r in responses)
    flow_keys = set((r.client_id, r.flow_id) for r in responses)

    response_counts = self._ReadFlowResponseCounts(request_keys, cursor)

    next_requests = self._ReadAndLockNextRequestsToProcess(flow_keys, cursor)

    completed_requests = self._ReadLockAndUpdateCompletedRequests(
        request_keys, response_counts, cursor)

    if not completed_requests:
      return completed_requests

    fprs_to_write = []
    for request_key, r in iteritems(completed_requests):
      client_id, flow_id, request_id = request_key
      if next_requests[(client_id, flow_id)] == request_id:
        fprs_to_write.append(
            rdf_flows.FlowProcessingRequest(
                client_id=r.client_id,
                flow_id=r.flow_id,
                delivery_time=r.start_time))

    if fprs_to_write:
      self._WriteFlowProcessingRequests(fprs_to_write, cursor)

    return completed_requests
723391
def _update_simulation_start_cards(self):
        
        if self.simulation_start is not None:
            self._update_card("START_DATE", self.simulation_start.strftime("%Y %m %d"))
            self._update_card("START_TIME", self.simulation_start.strftime("%H %M"))
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
495777
def _update_estimate_and_sampler(self, ell, ell_hat, weight, extra_info,
                                     **kwargs):
        """"""
        self._TP += ell_hat * ell * weight
        self._FP += ell_hat * (1 - ell) * weight
        self._FN += (1 - ell_hat) * ell * weight
        self._TN += (1 - ell_hat) * (1 - ell) * weight

        self._estimate[self.t_] = \
                self._F_measure(self.alpha, self._TP, self._FP, self._FN)
980625
def update(self, values):
        
        response = self.session.patch(self.build_url(''), data={'values': values})
        if not response:
            return False
        data = response.json()
        self.values = data.get('values', self.values)
        return True
1056626
def update_request(self, request: HttpRequest):
        

        request.axes_attempt_time = now()
        request.axes_ip_address = get_client_ip_address(request)
        request.axes_user_agent = get_client_user_agent(request)
        request.axes_path_info = get_client_path_info(request)
        request.axes_http_accept = get_client_http_accept(request)
745952
public void setSampledRequests(java.util.Collection<SampledHTTPRequest> sampledRequests) {
        if (sampledRequests == null) {
            this.sampledRequests = null;
            return;
        }

        this.sampledRequests = new java.util.ArrayList<SampledHTTPRequest>(sampledRequests);
    }