code: def fixture_kinesis(request):
      """fixture_kinesis"""
      import boto3  # pylint: disable=import-outside-toplevel
  
      val = [("D" + str(i)) for i in range(10)]
      key = [("TensorFlow" + str(i)) for i in range(10)]
  
      os.environ["AWS_ACCESS_KEY_ID"] = "ACCESS_KEY"
      os.environ["AWS_SECRET_ACCESS_KEY"] = "SECRET_KEY"
      os.environ["KINESIS_USE_HTTPS"] = "0"
      os.environ["KINESIS_ENDPOINT"] = "localhost:4566"
  
      client = boto3.client(
          "kinesis",
          region_name="us-east-1",
          endpoint_url="http://localhost:4566",
      )
  
      # Setup the Kinesis with 1 shard.
      stream_name = f"kinesis_e{time.time()}e"
      client.create_stream(StreamName=stream_name, ShardCount=1)
      # Wait until stream exists, default is 10 * 18 seconds.
      client.get_waiter("stream_exists").wait(StreamName=stream_name)
      for v, k in zip(val, key):
          client.put_record(
              StreamName=stream_name, Data=v, PartitionKey=k
          )
  
      def fin():
          client.delete_stream(StreamName=stream_name)
          # Wait until stream deleted, default is 10 * 18 seconds.
          client.get_waiter("stream_not_exists").wait(
              StreamName=stream_name
          )
  
      request.addfinalizer(fin)
  
      args = stream_name
  
      def func(q):
          dataset = tfio.experimental.IODataset.from_kinesis(q)
          dataset = dataset.map(lambda e: (e.data, e.partition))
          dataset = dataset.take(10)
          return dataset
  
      expected = list(
          zip([v.encode() for v in val], [k.encode() for k in key])
      )
  
      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 12 for calling a global function with example usage: fixture_kinesis(request) and returns: args,  func,  expected, dataset