class_docstr: PubSubStreamGraphIODataset
docstr: PubSubStreamIODataset.
docstr_tok: ["PubSubStreamIODataset","."]
code: def __init__(
      self, subscription, endpoint=None, timeout=10000, internal=True
  ):
      """PubSubStreamIODataset."""
      with tf.name_scope("PubSubStreamIODataset"):
          assert internal
  
          metadata = []
          if endpoint is not None:
              metadata.append("endpoint=%s" % endpoint)
          metadata.append("timeout=%d" % timeout)
          resource = core_ops.io_pub_sub_readable_init(
              subscription, metadata
          )
  
          self._resource = resource
  
          dataset = tf.data.experimental.Counter()
          dataset = dataset.map(
              lambda i: core_ops.io_pub_sub_readable_read(
                  self._resource, i
              )
          )
          dataset = dataset.apply(
              tf.data.experimental.take_while(
                  lambda v: tf.greater(tf.shape(v.id)[0], 0)
              )
          )
          dataset = dataset.unbatch()
  
          self._dataset = dataset
          super().__init__(self._dataset._variant_tensor)
  
imports: import tensorflow
  from tensorflow_io.python.ops import core_ops
label_desc: Use image node_id 1 to create a new PubSubStreamIODataset object from inherited base classes: tf.data with example: obj = PubSubStreamIODataset(subscription, endpoint, timeout, internal)