code: def _create_or_validate_filenames_dataset(filenames):
      """create_or_validate_filenames_dataset"""
      if isinstance(filenames, tf.data.Dataset):
          if tf.compat.v1.data.get_output_types(filenames) != tf.string:
              raise TypeError(
                  "`filenames` must be a `tf.data.Dataset` of `tf.string` elements."
              )
          if not tf.compat.v1.data.get_output_shapes(
              filenames
          ).is_compatible_with(tf.TensorShape([])):
              raise TypeError(
                  "`filenames` must be a `tf.data.Dataset` of scalar `tf.string` "
                  "elements."
              )
      else:
          filenames = tf.convert_to_tensor(
              filenames, dtype_hint=tf.string
          )
          if filenames.dtype != tf.string:
              raise TypeError(
                  "`filenames` must be a `tf.Tensor` of dtype `tf.string` dtype."
                  " Got {}".format(filenames.dtype)
              )
          filenames = tf.reshape(filenames, [-1], name="flat_filenames")
          filenames = tf.data.Dataset.from_tensor_slices(filenames)
  
      return filenames
  
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 2 for calling a global function with example usage: _create_or_validate_filenames_dataset(filenames) and returns: filenames