class_docstr: KafkaIOTensor
docstr: Returns the specified piece of this IOTensor.
docstr_tok: ["Returns","the","specified","piece","of","this","IOTensor","."]
code: def __getitem__(self, key):
      """Returns the specified piece of this IOTensor."""
      if isinstance(key, slice):
          item, _ = core_ops.io_kafka_readable_read(
              self._resource, key.start, key.stop
          )
          return item
      item, _ = core_ops.io_kafka_readable_read(
          self._resource, key, key + 1
      )
      if tf.shape(item)[0] == 0:
          raise IndexError("index %s is out of range" % key)
      return item[0]
  
file_path: io/tensorflow_io/python/ops/kafka_io_tensor_ops.py
imports: import tensorflow
  from tensorflow_io.python.ops import core_ops
label_desc: Use image node_id 6 for calling the KafkaIOTensor obj's underlying member method code with example usage: obj.__getitem__(key) and returns: item, item