code: def fixture_pubsub(request):
      """fixture_pubsub"""
      from google.cloud import (
          pubsub_v1,
      )  # pylint: disable=import-outside-toplevel
  
      channel = f"e{int(time.time())}e"
  
      os.environ["PUBSUB_EMULATOR_HOST"] = "localhost:8085"
      publisher = pubsub_v1.PublisherClient()
      topic_path = publisher.topic_path(
          "pubsub-project", "pubsub_topic_" + channel
      )
      publisher.create_topic(name=topic_path)
      # print('Topic created: {}'.format(topic))
      subscriber = pubsub_v1.SubscriberClient()
      subscription_path = subscriber.subscription_path(
          "pubsub-project", f"pubsub_subscription_{channel}"
      )
      subscription = subscriber.create_subscription(
          request={
              "name": subscription_path,
              "topic": topic_path,
              "retain_acked_messages": True,
          }
      )
      print(f"Subscription created: {subscription}")
      for n in range(0, 10):
          data_v = f"Message number {n}"
          # Data must be a bytestring
          data_v = data_v.encode("utf-8")
          # When you publish a message, the client returns a future.
          future = publisher.publish(topic_path, data=data_v)
          print(f"Published {data_v} of message ID {future.result()}.")
      print("Published messages.")
  
      def fin():
          subscription_path = subscriber.subscription_path(
              "pubsub-project", f"pubsub_subscription_{channel}"
          )
          subscriber.delete_subscription(
              request={"subscription": subscription_path}
          )
          print(f"Subscription {subscription_path} deleted.")
  
      request.addfinalizer(fin)
  
      args = (
          "projects/pubsub-project/"
          "subscriptions/pubsub_subscription_{}".format(channel)
      )
  
      def func(q):
          v = tfio.experimental.IODataset.stream().from_pubsub(
              q, endpoint="http://localhost:8085", timeout=5000
          )
          v = v.map(lambda e: e.data)
          return v
  
      expected = [f"Message number {n}".encode() for n in range(10)]
  
      return args, func, expected
  
imports: import os
  import sys
  import time
  import shutil
  import tempfile
  import numpy
  import pytest
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 7 for calling a global function with example usage: fixture_pubsub(request) and returns: args,  func,  expected, v