Polls the data server to find the current frame number.

    Throws an exceotion if it cannot determine it.
779690
def getFrameNumber(g):
    
    if not g.cpars['hcam_server_on']:
        raise DriverError('getRunNumber error: servers are not active')
    url = g.cpars['hipercam_server'] + 'status/DET.FRAM2.NO'
    response = urllib.request.urlopen(url, timeout=2)
    rs = ReadServer(response.read(), status_msg=False)
    try:
        msg = rs.msg
    except:
        raise DriverError('getFrameNumber error: no message found')
    try:
        frame_no = int(msg.split()[1])
    except:
        raise DriverError('getFrameNumber error: invalid msg ' + msg)
    return frame_no
611091
def read_frame_nowait(self) -> Optional[DataFrame]:
        
        try:
            frame = self._data_frames.get_nowait()
        except asyncio.QueueEmpty:
            if self.closed:
                raise StreamConsumedError(self.id)
            return None
        self._data_frames.task_done()
        if frame is None:
            raise StreamConsumedError(self.id)
        return frame
661209
private void verifyFrameOpcode(WebSocketFrame frame) throws WebSocketException
    {
        switch (frame.getOpcode())
        {
            case CONTINUATION:
            case TEXT:
            case BINARY:
            case CLOSE:
            case PING:
            case PONG:
                // Known opcode
                return;

            default:
                break;
        }

        // If extended use of web socket frames is allowed.
        if (mWebSocket.isExtended())
        {
            // Allow the unknown opcode.
            return;
        }

        // A frame has an unknown opcode.
        throw new WebSocketException(
            WebSocketError.UNKNOWN_OPCODE,
            "A frame has an unknown opcode: 0x" + Integer.toHexString(frame.getOpcode()));
    }
836781
def check(frame) -> None:
        
        # The first parameter is called `frame` rather than `self`,
        # but it's the instance of class to which this method is bound.

        if frame.rsv1 or frame.rsv2 or frame.rsv3:
            raise WebSocketProtocolError("Reserved bits must be 0")

        if frame.opcode in DATA_OPCODES:
            return
        elif frame.opcode in CTRL_OPCODES:
            if len(frame.data) > 125:
                raise WebSocketProtocolError("Control frame too long")
            if not frame.fin:
                raise WebSocketProtocolError("Fragmented control frame")
        else:
            raise WebSocketProtocolError(f"Invalid opcode: {frame.opcode}")
395369
private void nextFrame(long delta) {
		if (stopped) {
			return;
		}
		if (frames.size() == 0) {
			return;
		}
		
		nextChange -= delta;
		
		while (nextChange < 0 && (!stopped)) {
			if (currentFrame == stopAt) {
				stopped = true;
				break;
			}
			if ((currentFrame == frames.size() - 1) && (!loop) && (!pingPong)) {
	            stopped = true; 
				break;
			}
			currentFrame = (currentFrame + direction) % frames.size();
			
			if (pingPong) {
				if (currentFrame <= 0) {
					currentFrame = 0;
					direction = 1;   
					if (!loop) {            
                        stopped = true;            
                        break;     
                    }       
				}
				else if (currentFrame >= frames.size()-1) {
					currentFrame = frames.size()-1;
					direction = -1;
				}
			}
			int realDuration = (int) (((Frame) frames.get(currentFrame)).duration / speed);
			nextChange = nextChange + realDuration;
		}
	}
584244
float getLinearCurrentKeyframeProgress() {
    if (isDiscrete) {
      return 0f;
    }

    Keyframe<K> keyframe = getCurrentKeyframe();
    if (keyframe.isStatic()) {
      return 0f;
    }
    float progressIntoFrame = progress - keyframe.getStartProgress();
    float keyframeProgress = keyframe.getEndProgress() - keyframe.getStartProgress();
    return progressIntoFrame / keyframeProgress;
  }
1068184
function(){
    this.frameIndex++;
    if (this.frameIndex >= this.rightCropPosition) {
      this.frameIndex = this.frameIndex % (this.rightCropPosition || 1);

      if ((this.frameIndex < this.leftCropPosition)) {
        this.frameIndex = this.leftCropPosition;
      }
    }else{
      this.frameIndex--;
    }
  }
1250615
def refresh_stack(self):
        
        self.stack, _ = self.compute_stack(self.fullstack)
        # find the current frame in the new stack
        for i, (frame, _) in enumerate(self.stack):
            if frame is self.curframe:
                self.curindex = i
                break
        else:
            self.curindex = len(self.stack)-1
            self.curframe = self.stack[-1][0]
            self.print_current_stack_entry()
475724
function Frame(values) {
  this.values = values || {};
  this.rawVersion = values.rawVersion;
  this.isRequest = (this.rawVersion & 0x80) === 0;
  this.version = this.rawVersion & 0x7F;
  this.flags = values.flags || 0;
  this.streamId = values.streamId || 0;
  this.opcode = values.opcode;
  this.isTracing = this.flags & 0x02;

  if (this.values.body instanceof Buffer) {
    this.body = this.values.body;
  } else if (typeof this.values.bodyLength === 'number') {
    this.body = new Buffer(this.values.bodyLength);
  }
}
574203
def _get_stack_frame(stacklevel):
    
    stacklevel = stacklevel + 1
    if stacklevel <= 1 or _is_internal_frame(sys._getframe(1)):
        # If frame is too small to care or if the warning originated in
        # internal code, then do not try to hide any frames.
        frame = sys._getframe(stacklevel)
    else:
        frame = sys._getframe(1)
        # Look for one frame less since the above line starts us off.
        for x in range(stacklevel-1):
            frame = _next_external_frame(frame)
            if frame is None:
                raise ValueError
    return frame
1044098
public int originalFrame() {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.entry(this, tc, "originalFrame");

    int result;
    synchronized (getMessageLockArtefact()) {

      if ((contents == null) || reallocated) {
        result = -1;
      }
      else {
        result = length;
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.exit(this, tc, "originalFrame", Integer.valueOf(result));
    return result;
  }
1175590
def frame_update_count(self):
        
        result = 1000000
        for layout in self._layouts:
            if layout.frame_update_count > 0:
                result = min(result, layout.frame_update_count)
        for effect in self._effects:
            if effect.frame_update_count > 0:
                result = min(result, effect.frame_update_count)
        return result
1209979
def show(self):
        
        self._verify_entrypoint_selected()

        if self.current_issue_instance_id != -1:
            self._show_current_issue_instance()
            return

        self._show_current_trace_frame()
276617
def get_selected_python_frame(cls):
        ''''''
        frame = cls.get_selected_frame()

        while frame:
            if frame.is_evalframeex():
                return frame
            frame = frame.older()

        # Not found:
        return None
998797
async def handle_frame(self, frame):
        """"""
        if not isinstance(frame, FrameHouseStatusMonitorDisableConfirmation):
            return False
        self.success = True
        return True
393
@SuppressWarnings("unused") // called through reflection by RequestServer
  public FramesV3 fetch(int version, FramesV3 s) {
    FramesV3 frames = doFetch(version, s);

    // Summary data is big, and not always there: null it out here.  You have to call columnSummary
    // to force computation of the summary data.
    for (FrameBaseV3 a_frame: frames.frames) {
      ((FrameV3)a_frame).clearBinsField();
    }

    return frames;
  }
575024
private int calculateWaitCyclesFromWaitTime() {

        String serverWaitTime = System.getProperty(BootstrapConstants.SERVER_START_WAIT_TIME);

        if ((serverWaitTime == null) || serverWaitTime.trim().equals("")) {
            return BootstrapConstants.MAX_POLL_ATTEMPTS;
        }

        int waitTime = 0;
        try {
            waitTime = Integer.parseInt(System.getProperty(BootstrapConstants.SERVER_START_WAIT_TIME));

            if (waitTime < 1) {
                return 1;
            }
        } catch (Throwable t) {

            return BootstrapConstants.MAX_POLL_ATTEMPTS;
        }
        int waitCycles = (int) (TimeUnit.MILLISECONDS.convert(waitTime, TimeUnit.SECONDS) / BootstrapConstants.POLL_INTERVAL_MS);

        return waitCycles;
    }