code: def load_packets(self, packet_count=0, timeout=None):
          
          initial_packet_amount = len(self._packets)
  
          def keep_packet(pkt):
              self._packets.append(pkt)
  
              if packet_count != 0 and len(self._packets) - initial_packet_amount >= packet_count:
                  raise StopCapture()
  
          try:
              self.apply_on_packets(keep_packet, timeout=timeout)
              self.loaded = True
          except concurrent.futures.TimeoutError:
              pass
docs: Reads the packets from the source (cap, interface, etc.) and adds it to the internal list.
          If 0 as the packet_count is given, reads forever
  
          :param packet_count: The amount of packets to add to the packet list (0 to read forever)
          :param timeout: If given, automatically stops after a given amount of time.