code: def write(self, pkt):
          
          if not self.header_present:
              self._write_header(pkt)
          if isinstance(pkt, BasePacket):
            self._write_packet(pkt)
          else:
              for p in pkt:
                  self._write_packet(p)
docs: accepts a either a single packet or a list of packets
          to be written to the dumpfile