code: def create_data(tf_data=False, batch_size=32):
      train_num_samples = 1000
      test_num_samples = 400
      input_feature_num = 10
      output_feature_num = 2
      past_seq_len = 10
      future_seq_len = 2
  
      def get_x_y(num_sample):
          x = np.random.randn(
              num_sample, past_seq_len, input_feature_num
          )
          y = np.random.randn(
              num_sample, future_seq_len, output_feature_num
          )
          return x, y
  
      train_data = get_x_y(train_num_samples)
      val_data = get_x_y(test_num_samples)
      test_data = get_x_y(test_num_samples)
  
      if tf_data:
          from_tensor_slices = tf.data.Dataset.from_tensor_slices
          train_data = (
              from_tensor_slices(train_data)
              .cache()
              .shuffle(train_num_samples)
              .batch(batch_size)
              .prefetch(tf.data.AUTOTUNE)
          )
          val_data = (
              from_tensor_slices(val_data)
              .batch(batch_size)
              .cache()
              .prefetch(tf.data.AUTOTUNE)
          )
          test_data = (
              from_tensor_slices(test_data)
              .batch(batch_size)
              .cache()
              .prefetch(tf.data.AUTOTUNE)
          )
      return train_data, val_data, test_data
  
imports: import pytest
  import tempfile
  import os
  from unittest import TestCase
  import numpy
  from bigdl.chronos.utils import LazyImport
  from test.bigdl.chronos import op_tf2, op_distributed, op_inference
label_desc: Use image node_id 1 for calling a global function with example usage: create_data(tf_data, batch_size) and returns: train_data,  val_data,  test_data, x,  y