code: def _create_dataset_reader(
      dataset_creator,
      filenames,
      cycle_length=None,
      num_parallel_calls=None,
      deterministic=None,
      block_length=1,
  ):
      """
          This creates a dataset reader which reads records from multiple files and interleaves them together
      ```
      dataset = Dataset.range(1, 6)  # ==> [ 1, 2, 3, 4, 5 ]
      # NOTE: New lines indicate "block" boundaries.
      dataset = dataset.interleave(
          lambda x: Dataset.from_tensors(x).repeat(6),
          cycle_length=2, block_length=4)
      list(dataset.as_numpy_iterator())
      ```
      Results in the following output:
      [1,1,1,1,
       2,2,2,2,
       1,1,
       2,2,
       3,3,3,3,
       4,4,4,4,
       3,4,
       5,5,5,5,
       5,5,
      ]
          Args:
              dataset_creator: Initializer for AvroDatasetRecord
              filenames: A `tf.data.Dataset` iterator of filenames to read
              cycle_length: The number of files to be processed in parallel. This is used by `Dataset.Interleave`.
              We set this equal to `block_length`, so that each time n number of records are returned for each of the n
              files.
              num_parallel_calls: Number of threads spawned by the interleave call.
              deterministic: Sets whether the interleaved records are written in deterministic order. in tf.interleave this is default true
              block_length: Sets the number of output on the output tensor. Defaults to 1
          Returns:
              A dataset iterator with an interleaved list of parsed avro records.
  
      """
  
      def read_many_files(filenames):
          filenames = tf.convert_to_tensor(
              filenames, tf.string, name="filename"
          )
          return dataset_creator(filenames)
  
      if cycle_length is None:
          return filenames.flat_map(read_many_files)
  
      return filenames.interleave(
          read_many_files,
          cycle_length=cycle_length,
          num_parallel_calls=num_parallel_calls,
          block_length=block_length,
          deterministic=deterministic,
      )
  
file_path: io/tensorflow_io/python/experimental/avro_record_dataset_ops.py
imports: import tensorflow
  from tensorflow_io.python.ops import core_ops
label_desc: Use image node_id 3 for calling a global function with example usage: _create_dataset_reader(dataset_creator, filenames, cycle_length, num_parallel_calls, deterministic, block_length) and returns: filenames, dataset_creator, filenames