code: def val_data_creator(a=5, b=10, size=100):
      def get_dataset(a, b, size) -> Dataset:
          items = [i / size for i in range(size)]
          dataset = ray.data.from_items(
              [{"x": x, "y": a * x + b} for x in items]
          )
          return dataset
  
      val_dataset = get_dataset(a, b, size)
      return val_dataset
  
file_path: BigDL/python/orca/test/bigdl/orca/learn/ray/ctx/test_tf2_ray_dataset.py
imports: import pytest
  from unittest import TestCase
  import ray
  from ray.data import Dataset
  import tensorflow
  from bigdl.orca.learn.tf2 import Estimator
  from bigdl.orca import init_orca_context, stop_orca_context
label_desc: Use image node_id 2 for calling a global function with example usage: val_data_creator(a, b, size) and returns: val_dataset, dataset