parameters: (self, data)
docstring: Find data enclosed in START/STOP, call handle_packet
docstring_summary: Find data enclosed in START/STOP, call handle_packet
docstring_tokens: Find data enclosed in START / STOP call handle_packet
function: def data_received(self, data):
          """Find data enclosed in START/STOP, call handle_packet"""
          for byte in serial.iterbytes(data):
              if byte == self.START:
                  self.in_packet = True
              elif byte == self.STOP:
                  self.in_packet = False
                  self.handle_packet(bytes(self.packet)) # make read-only copy
                  del self.packet[:]
              elif self.in_packet:
                  self.packet.extend(byte)
              else:
                  self.handle_out_of_packet_data(byte)
function_tokens: def data_received ( self , data ) : for byte in serial . iterbytes ( data ) : if byte == self . START : self . in_packet = True elif byte == self . STOP : self . in_packet = False self . handle_packet ( bytes ( self . packet ) ) # make read-only copy del self . packet [ : ] elif self . in_packet : self . packet . extend ( byte ) else : self . handle_out_of_packet_data ( byte )