code: def test_tensorflow_linear(ray_start_4_cpus, num_workers):
      """Also tests air Keras callback."""
      epochs = 3
  
      def train_func(config):
          result = tensorflow_linear_train_func(config)
          assert len(result) == epochs
          assert result[-1]["loss"] < result[0]["loss"]
  
      train_loop_config = {
          "lr": 1e-3,
          "batch_size": 32,
          "epochs": epochs,
      }
      scaling_config = ScalingConfig(num_workers=num_workers)
      dataset = ray.data.read_csv(
          "s3://anonymous@air-example-data/regression.csv"
      )
      preprocessor = Concatenator(
          exclude=["", "y"], output_column_name="x"
      )
      dataset = preprocessor.transform(dataset)
  
      trainer = TensorflowTrainer(
          train_loop_per_worker=train_func,
          train_loop_config=train_loop_config,
          scaling_config=scaling_config,
          datasets={TRAIN_DATASET_KEY: dataset},
      )
      result = trainer.fit()
      assert result.checkpoint
  
file_path: ray/python/ray/train/tests/test_tensorflow_trainer.py
imports: import os
  import tempfile
  import pytest
  import ray
  from ray import train
  from ray.data.preprocessors import Concatenator
  from ray.train import ScalingConfig
  from ray.train.constants import TRAIN_DATASET_KEY
  from ray.train.examples.tf.tensorflow_regression_example import train_func
  from ray.train.tensorflow import TensorflowCheckpoint, TensorflowTrainer
label_desc: Use image node_id 3 for calling a global function with example usage: test_tensorflow_linear(ray_start_4_cpus, num_workers) without return types