code: def test_video_io_dataset_with_dataset(video_data, io_dataset_func):
      """test_video_io_dataset_with_dataset"""
      video_path, video_value = video_data
  
      filename_dataset = tf.data.Dataset.from_tensor_slices(
          [video_path, video_path]
      )
      position_dataset = tf.data.Dataset.from_tensor_slices(
          [tf.constant(50, tf.int64), tf.constant(100, tf.int64)]
      )
  
      dataset = tf.data.Dataset.zip(
          (filename_dataset, position_dataset)
      )
  
      # Note: @tf.function is actually not needed, as tf.data.Dataset
      # will automatically wrap the `func` into a graph anyway.
      # The following is purely for explanation purposes.
      # Return: an embedded dataset (in an outer dataset) for position:position+100
      @tf.function
      def func(filename, position):
          video_dataset = io_dataset_func(filename)
          return video_dataset.skip(position).take(10)
  
      dataset = dataset.map(func)
  
      item = 0
      # Notice video_dataset in dataset:
      for video_dataset in dataset:
          position = 50 if item == 0 else 100
          i = 0
          for value in video_dataset:
              assert video_value[position + i].shape == value.shape
              i += 1
          assert i == 10
          item += 1
      assert item == 2
  
file_path: io/tests/test_video.py
imports: import os
  import sys
  import pytest
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 3 for calling a global function with example usage: test_video_io_dataset_with_dataset(video_data, io_dataset_func) and returns: video_dataset