code: def test_pulsar_invalid_arguments():
      """Test the invalid arguments when a PulsarIODataset is created
  
      The following cases are included:
      1. timeout is non-positive
      2. poll_timeout is non-positive
      3. poll_timeout is larger than timeout
      """
  
      INVALID_TIMEOUT = -123
      try:
          tfio.experimental.streaming.PulsarIODataset(
              service_url="pulsar://localhost:6650",
              topic="test",
              subscription="subscription-0",
              timeout=INVALID_TIMEOUT,
          )
      except ValueError as e:
          assert str(
              e
          ) == "Invalid timeout value: {}, must be > 0".format(
              INVALID_TIMEOUT
          )
  
      VALID_TIMEOUT = default_pulsar_timeout
      INVALID_POLL_TIMEOUT = -45
      try:
          tfio.experimental.streaming.PulsarIODataset(
              service_url="pulsar://localhost:6650",
              topic="test",
              subscription="subscription-0",
              timeout=VALID_TIMEOUT,
              poll_timeout=INVALID_POLL_TIMEOUT,
          )
      except ValueError as e:
          assert str(
              e
          ) == "Invalid poll_timeout value: {}, must be > 0".format(
              INVALID_POLL_TIMEOUT
          )
  
      LARGE_POLL_TIMEOUT = VALID_TIMEOUT + 1
      try:
          tfio.experimental.streaming.PulsarIODataset(
              service_url="pulsar://localhost:6650",
              topic="test",
              subscription="subscription-0",
              timeout=VALID_TIMEOUT,
              poll_timeout=LARGE_POLL_TIMEOUT,
          )
      except ValueError as e:
          assert str(
              e
          ) == "Invalid poll_timeout value: {}, must be <= timeout({})".format(
              LARGE_POLL_TIMEOUT, VALID_TIMEOUT
          )
  
file_path: io/tests/test_pulsar.py
imports: import sys
  import numpy
  import tensorflow
  import tensorflow_io
  import pytest
label_desc: Use image node_id 4 for calling a global function with example usage: test_pulsar_invalid_arguments() without return types