class_docstr: PcapIODataset
code: def __init__(self, filename, internal=True, **kwargs):
      if not internal:
          raise ValueError(
              "PcapIODataset constructor is private; please use one "
              "of the factory methods instead (e.g., "
              "IODataset.from_pcap())"
          )
      with tf.name_scope("PcapIODataset") as scope:
          capacity = kwargs.get("capacity", 4096)
          resource = core_ops.io_pcap_readable_init(
              filename,
              container=scope,
              shared_name=f"{filename}/{uuid.uuid4().hex}",
          )
  
          dataset = tf.data.Dataset.range(0, sys.maxsize, capacity)
          dataset = dataset.map(
              lambda index: core_ops.io_pcap_readable_read(
                  resource, start=index, stop=index + capacity
              )
          )
          dataset = dataset.apply(
              tf.data.experimental.take_while(
                  lambda v: tf.greater(tf.shape(v.value)[0], 0)
              )
          )
          dataset = dataset.map(lambda v: (v.label, v.value))
          dataset = dataset.unbatch()
  
          self._capacity = capacity
          self._resource = resource
          self._dataset = dataset
          super().__init__(self._dataset._variant_tensor)
  
file_path: io/tensorflow_io/python/ops/pcap_dataset_ops.py
imports: import sys
  import uuid
  import tensorflow
  from tensorflow_io.python.ops import core_ops
label_desc: Use image node_id 1 to create a new PcapIODataset object from inherited base classes: tf.data with example: obj = PcapIODataset(filename, internal)