Update the audio length property,
        according to the length of the current audio data
        and audio sample rate.

        This function fails silently if one of the two is ``None``.
978283
def _update_length(self):
        
        if (self.audio_sample_rate is not None) and (self.__samples is not None):
            # NOTE computing TimeValue (... / ...) yields wrong results,
            #      see issue #168
            #      self.audio_length = TimeValue(self.__samples_length / self.audio_sample_rate)
            self.audio_length = TimeValue(self.__samples_length) / TimeValue(self.audio_sample_rate)
1303442
def _update(self, data: TransDict, *args, **kwargs):
        

        for l in self.listeners:
            l(data, *args, **kwargs)
236542
def set(self, key, value, key_length=0):
        
        if key_length < 1:
            key_length = len(key)
        if self.k:
            self._update(key, value)
        return self.set_method(self, key, key_length, value)
134156
def calculate_size(name, expected, updated):
    
    data_size = 0
    data_size += calculate_size_str(name)
    data_size += LONG_SIZE_IN_BYTES
    data_size += LONG_SIZE_IN_BYTES
    return data_size
1023493
public synchronized void updateLength(long length) {
    if (mLength == Constants.UNKNOWN_SIZE) {
      mLength = length;
    } else if (mLength != length) {
      LOG.warn("Attempting to update block length ({}) to a different length ({}).", mLength,
          length);
    }
  }
537076
function() {
    var self = this;

    // Loop through all active sounds and update their progress bar.
    for (var i=0; i<self.sounds.length; i++) {
      var id = parseInt(self.sounds[i].id, 10);
      var offset = self._sprite[self.sounds[i].dataset.sprite][0];
      var seek = (self.sound.seek(id) || 0) - (offset / 1000);
      self.sounds[i].style.width = (((seek / self.sound.duration(id)) * 100) || 0) + '%';
    }

    requestAnimationFrame(self.step.bind(self));
  }
678557
function changeSample() {
    document.getElementById('play').disabled = true;
    document.getElementById('stop').disabled = true;
    soundUrl = document.getElementById("sample_no").value;
    if (typeof sound != 'undefined' && sound.isPlaying) {
        sound.stop(0);
        sound.isPlaying = false;
    }
    loadSample(soundUrl, assignSample2SoundBuffer);
}
671999
def _update_noise(self, peak_num):
        
        i = self.peak_inds_i[peak_num]
        self.noise_amp_recent = (0.875*self.noise_amp_recent
                                 + 0.125*self.sig_i[i])
        return
798326
protected void updateLength() {
		if (getBlockSets().size() == 0) {
			throw new IndexOutOfBoundsException(
					"Empty MultipleAlignment: blockSets size == 0.");
		} // Otherwise try to calculate it from the BlockSet information
		else {
			length = 0;
			for (BlockSet blockSet : blockSets)
				length += blockSet.length();
		}
	}
797337
def set(self, value, samples=0):
        '''
        
        '''
        if self.params.length > self.pos and samples > 0:
            l = min(samples, self.params.length-self.pos)
            self.data[self.pos:self.pos+l] = np.full(l, value, dtype=np.float)
            self.pos += l
        self.latest = value
        return self
623323
void updateContentSize(long frameLength, boolean last) {
        if(contentLengthRemaining != -1) {
            contentLengthRemaining -= frameLength;
            if(contentLengthRemaining < 0) {
                UndertowLogger.REQUEST_IO_LOGGER.debugf("Closing stream %s on %s as data length exceeds content size", streamId, getFramedChannel());
                getFramedChannel().sendRstStream(streamId, Http2Channel.ERROR_PROTOCOL_ERROR);
            } else if(last && contentLengthRemaining != 0) {
                UndertowLogger.REQUEST_IO_LOGGER.debugf("Closing stream %s on %s as data length was less than content size", streamId, getFramedChannel());
                getFramedChannel().sendRstStream(streamId, Http2Channel.ERROR_PROTOCOL_ERROR);
            }
        }
    }
156315
def play_internal
      count = 0
      @playing = true

      # Default play length (ms), will be adjusted later
      @length = IDEAL_LENGTH

      self.speaking = true
      loop do
        # Starting from the tenth packet, perform length adjustment every 100 packets (2 seconds)
        should_adjust_this_packet = (count % @adjust_interval == @adjust_offset)

        # If we should adjust, start now
        @length_adjust = Time.now.nsec if should_adjust_this_packet

        break unless @playing

        # If we should skip, get some data, discard it and go to the next iteration
        if @skips.positive?
          @skips -= 1
          yield
          next
        end

        # Track packet count, sequence and time (Discord requires this)
        count += 1
        increment_packet_headers

        # Get packet data
        buf = yield

        # Stop doing anything if the stop signal was sent
        break if buf == :stop

        # Proceed to the next packet if we got nil
        next unless buf

        # Track intermediate adjustment so we can measure how much encoding contributes to the total time
        @intermediate_adjust = Time.now.nsec if should_adjust_this_packet

        # Send the packet
        @udp.send_audio(buf, @sequence, @time)

        # Set the stream time (for tracking how long we've been playing)
        @stream_time = count * @length / 1000

        if @length_override # Don't do adjustment because the user has manually specified an override value
          @length = @length_override
        elsif @length_adjust # Perform length adjustment
          # Define the time once so it doesn't get inaccurate
          now = Time.now.nsec

          # Difference between length_adjust and now in ms
          ms_diff = (now - @length_adjust) / 1_000_000.0
          if ms_diff >= 0
            @length = if @adjust_average
                        (IDEAL_LENGTH - ms_diff + @length) / 2.0
                      else
                        IDEAL_LENGTH - ms_diff
                      end

            # Track the time it took to encode
            encode_ms = (@intermediate_adjust - @length_adjust) / 1_000_000.0
            @bot.debug("Length adjustment: new length #{@length} (measured #{ms_diff}, #{(100 * encode_ms) / ms_diff}% encoding)") if @adjust_debug
          end
          @length_adjust = nil
        end

        # If paused, wait
        sleep 0.1 while @paused

        if @length.positive?
          # Wait `length` ms, then send the next packet
          sleep @length / 1000.0
        else
          Discordrb::LOGGER.warn('Audio encoding and sending together took longer than Discord expects one packet to be (20 ms)! This may be indicative of network problems.')
        end
      end

      @bot.debug('Sending five silent frames to clear out buffers')

      5.times do
        increment_packet_headers
        @udp.send_audio(Encoder::OPUS_SILENCE, @sequence, @time)

        # Length adjustments don't matter here, we can just wait 20 ms since nobody is going to hear it anyway
        sleep IDEAL_LENGTH / 1000.0
      end

      @bot.debug('Performing final cleanup after stream ended')

      # Final cleanup
      stop_playing

      # Notify any stop_playing methods running right now that we have actually stopped
      @has_stopped_playing = true
    end
847104
def _update_actions_len(self):
        """"""
        if isinstance(self.actions, ListOfActions):
            self.actions_len = self.actions.get_size()
        else:
            self.actions_len = ListOfActions(self.actions).get_size()
801970
private void updateSize()
	{
		int length = frames.getLength();

		if (head.getExtendedHeader())
		{
			length += ext_head.getSize();
		}

		head.setTagSize(length);

		if (head.getFooter())
		{
			foot.setTagSize(length);
		}
	}
849563
def length_of_associated_transcript(effect):
    
    return apply_to_transcript_if_exists(
        effect=effect,
        fn=lambda t: len(t.sequence),
        default=0)
805583
def update(self, buffer, length):
        
        return lib.zdigest_update(self._as_parameter_, buffer, length)
1230488
public synchronized void update(double sample) {
        long now = System.currentTimeMillis();

        if (lastMillis == 0) {    // first sample
            average = sample;
            lastMillis = now;
            return;
        }
        long deltaTime = now - lastMillis;
        double coeff = Math.exp(-1.0 * ((double)deltaTime / windowMillis));
        average = (1.0 - coeff) * sample + coeff * average;

        lastMillis = now;
    }