code: def _process_input(self, data, events):
          
          frame = APIFrame(escaped=self._escaped)
  
          byte = self.serial.read()
  
          if byte != APIFrame.START_BYTE:
              return
  
          # Save all following bytes, if they are not empty
          if len(byte) == 1:
              frame.fill(byte)
  
          while(frame.remaining_bytes() > 0):
              byte = self.serial.read()
  
              if len(byte) == 1:
                  frame.fill(byte)
  
          try:
              # Try to parse and return result
              frame.parse()
  
              # Ignore empty frames
              if len(frame.data) == 0:
                  return
  
              if self._frame_future is not None:
                  self._frame_future.set_result(frame)
                  self._frame_future = None
              else:
                  self._frame_queue.append(frame)
          except ValueError:
              return
docs: _process_input:
  
          _process_input will be notified when there is data ready on the
          serial connection to be read.  It will read and process the data
          into an API Frame and then either resolve a frame future, or push
          the frame into the queue of frames needing to be processed