Ensure that animation frame is requested (if an animation is needed).
762396
function updateAnimation () {
    if (!animationActive && shouldAnimate()) {
      animationStartTime = Date.now()
      lastFrameNumber = 0
      window.requestAnimationFrame(frame)
      animationActive = true
    }
  }
1288013
async def handle_frame(self, frame):
        """"""
        if not isinstance(frame, FrameSetNodeNameConfirmation):
            return False
        self.success = frame.status == SetNodeNameConfirmationStatus.OK
        return True
110931
function AnimationFrame(options) {
    if (!(this instanceof AnimationFrame)) return new AnimationFrame(options)
    options || (options = {})

    // Its a frame rate.
    if (typeof options == 'number') options = {frameRate: options}
    options.useNative != null || (options.useNative = true)
    this.options = options
    this.frameRate = options.frameRate || AnimationFrame.FRAME_RATE
    this._frameLength = 1000 / this.frameRate
    this._isCustomFrameRate = this.frameRate !== AnimationFrame.FRAME_RATE
    this._timeoutId = null
    this._callbacks = {}
    this._lastTickTime = 0
    this._tickCounter = 0
}
299166
function shouldAnimate () {
    // Don’t animate while dragging
    if (pointerIsDown) return false

    const finished = current === target && Math.abs(currentSpeed) < 0.5
    return !finished
  }
618431
def _check_frames(self, frames, fill_value):
        """"""
        if self.seekable():
            remaining_frames = self.frames - self.tell()
            if frames < 0 or (frames > remaining_frames and
                              fill_value is None):
                frames = remaining_frames
        elif frames < 0:
            raise ValueError("frames must be specified for non-seekable files")
        return frames
998797
async def handle_frame(self, frame):
        """"""
        if not isinstance(frame, FrameHouseStatusMonitorDisableConfirmation):
            return False
        self.success = True
        return True
1137658
def set_frame
      frames = @animations[@playing_animation]
      case frames
      when Range
        reset_clipping_rect
        @clip_x = @current_frame * @clip_width
      when Array
        f = frames[@current_frame]
        @clip_x      = f[:x]      || @defaults[:clip_x]
        @clip_y      = f[:y]      || @defaults[:clip_y]
        @clip_width  = f[:width]  || @defaults[:clip_width]
        @clip_height = f[:height] || @defaults[:clip_height]
        @frame_time  = f[:time]   || @defaults[:frame_time]
      end
    end
858494
function scheduleFrame(context, method) {
	method = context[method];

	return requestAnimationFrame(method.bind(context));
}
1373068
async def handle_frame(self, frame):
        """"""
        if isinstance(frame, FrameGetNodeInformationConfirmation) and frame.node_id == self.node_id:
            # We are still waiting for GetNodeInformationNotification
            return False
        if isinstance(frame, FrameGetNodeInformationNotification) and frame.node_id == self.node_id:
            self.notification_frame = frame
            self.success = True
            return True
        return False
873417
function (requested) {
    // No postMessage? Don't render – the event-stream will handle it.
    if (!window.postMessage) { return; }

    // Inform other pages event streaming render to reload
    if (requested) {
      sendReload();
      jsbin.state.hasBody = false;
    }
    getPreparedCode().then(function (source) {
      var includeJsInRealtime = jsbin.settings.includejs;

      // Tell the iframe to reload
      var visiblePanels = jsbin.panels.getVisible();
      var outputPanelOpen = visiblePanels.indexOf(jsbin.panels.panels.live) > -1;
      var consolePanelOpen = visiblePanels.indexOf(jsbin.panels.panels.console) > -1;
      if (!outputPanelOpen && !consolePanelOpen) {
        return;
      }
      // this is a flag that helps detect crashed runners
      if (jsbin.settings.includejs) {
        store.sessionStorage.setItem('runnerPending', 1);
      }

      renderer.postMessage('render', {
        source: source,
        options: {
          injectCSS: jsbin.state.hasBody && jsbin.panels.focused.id === 'css',
          requested: requested,
          debug: jsbin.settings.debug,
          includeJsInRealtime: jsbin.settings.includejs,
        },
      });

      jsbin.state.hasBody = true;

    });
  }
728614
def request_frame(self):
        """"""
        self.session_id = get_new_session_id()
        return FrameActivateSceneRequest(scene_id=self.scene_id, session_id=self.session_id)
924776
def frame(self, action):
        '''
        '''
        choices = {'on': '1',
                   'off': '0'}
        if action in choices:
            self.send(chr(27)+'if'+choices[action])
        else:
            raise RuntimeError('Invalid action for function frame, choices are on and off')
283960
private void ensureOrCancelAnimator(FloatingActionButton fab) {
        if (mFabTranslationYAnimator == null) {
            mFabTranslationYAnimator = ViewCompat.animate(fab);
            mFabTranslationYAnimator.setDuration(400);
            mFabTranslationYAnimator.setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR);
        } else {
            mFabTranslationYAnimator.cancel();
        }
    }
1191860
function _Browser_rAF()
{
	return __Scheduler_binding(function(callback)
	{
		var id = requestAnimationFrame(function() {
			callback(__Scheduler_succeed(Date.now()));
		});

		return function() {
			cancelAnimationFrame(id);
		};
	});
}
379114
def increment_frame(self):
        """"""
        if self.current_frame < len(self.images):
            self.current_frame += 1

            if self.current_frame >= len(self.images):
                # Wrap back to the beginning of the animation if should_repeat is true.
                if self.should_repeat:
                    self.current_frame = 0
                else:
                    # Clamp the current frame to the number of images we have in our list
                    self.current_frame = len(self.images) - 1

            # Set the image that is currently displaying.
            if self.current_frame < len(self.images):
                self.image = self.images[self.current_frame]
                self.image.coords = self.coords
320406
@Override
    public SipHeader ensure() {
        final Function<SipHeader, ? extends SipHeader> framer = SipParser.getFramer(this.name);
        if (framer != null) {
            return framer.apply(this);
        }
        return this;
    }
266667
protected void updateActionFrames ()
    {
        // get a reference to the action sequence so that we can obtain
        // our animation frames and configure our frames per second
        ActionSequence actseq = _charmgr.getActionSequence(_action);
        if (actseq == null) {
            String errmsg = "No such action '" + _action + "'.";
            throw new IllegalArgumentException(errmsg);
        }

        try {
            // obtain our animation frames for this action sequence
            _aframes = _charmgr.getActionFrames(_descrip, _action);

            // clear out our frames so that we recomposite on next tick
            _frames = null;

            // update the sprite render attributes
            setFrameRate(actseq.framesPerSecond);

        } catch (NoSuchComponentException nsce) {
            log.warning("Character sprite references non-existent component",
                "sprite", this, "err", nsce);

        } catch (Exception e) {
            log.warning("Failed to obtain action frames",
                "sprite", this, "descrip", _descrip, "action", _action, e);
        }
    }