human
I wrote the below code

    global drop, total, bytes_got, bytes_real, bytes_diff
    drop = 0
    total = 0
    bytes_got = 0
    bytes_real = 0
    bytes_diff = 0
    def cb(obj, data, sec, usec, length):
        global drop, total, bytes_got, bytes_real, bytes_diff
        (t, d) = pcapc.stats(obj.pcap)
        bytes_got += len(data)
        bytes_real += length
        nbd = (bytes_real - bytes_got)
        if (nbd != bytes_diff):
            bytes_diff = nbd
            print 'lost    bytes:', nbd
        if (t > total):
            total = (t + 500)
            print t, 'total'
        if (d > drop):
            drop = d
            print d, 'dropped'
        p = pkt.ethernet(data)
        ip = p.find('ipv4')
        if ip:
            print ip.srcip, ' DCTB ', ip.dstip, p
    print '\n'.join([('%i.    %s' % x) for x in enumerate(PCap.get_device_names())])
    if interface.startswith('#'):
        interface = int(interface[1:])
        interface = PCap.get_device_names()[interface]
    print 'Interface:', interface
    p = PCap(interface, callback=cb, filter='icmp')
    p.set_direction(True, True)
    def ping(eth='00:18:02:6e:ce:55', ip='192.168.0.1'):
        e = pkt.ethernet()
        e.src = (p.addresses['ethernet']['addr'] or '02:00:00:11:22:33')
        e.dst = EthAddr(eth)
        e.type = e.IP_TYPE
        ipp = pkt.ipv4()
        ipp.protocol = ipp.ICMP_PROTOCOL
        ipp.srcip = p.addresses['AF_INET']['addr']
        ipp.dstip = IPAddr(ip)
        icmp = pkt.icmp()
        icmp.type = pkt.ICMP.TYPE_ECHO_REQUEST
        icmp.payload = ('PingPing' * 6)
        ipp.payload = icmp
        e.payload = ipp
        p.inject(e)
    def broadcast():
        ping('ff:ff:ff:ff:ff:ff', '255.255.255.255')
    import code
    code.interact(local=locals())

What's a good function header?

Give me a Python program to print 'lost    bytes:', nbd?
assistant
#Here is Python program to print 'lost    bytes:', nbd
.

def test(interface='en1'):