code: def test_bad_return_in_train_loop(ray_start_4_cpus):
      """Test to check if returns from train loop are discarded."""
  
      # Simulates what happens with eg. torch models
      class FailOnUnpickle:
          def __reduce__(self):
              raise RuntimeError("Failing")
  
      def train_loop(config):
          train.report({"loss": 1})
          return FailOnUnpickle()
  
      trainer = DataParallelTrainer(
          train_loop_per_worker=train_loop, scaling_config=scale_config
      )
  
      # No exception should happen here
      trainer.fit()
  
imports: import os
  import time
  from unittest.mock import patch
  import pytest
  import ray
  from ray import train, tune
  from ray.train import RunConfig, ScalingConfig
  from ray.train._internal.backend_executor import BackendExecutor
  from ray.train._internal.worker_group import WorkerGroup
  from ray.train.backend import Backend, BackendConfig
  from ray.train.data_parallel_trainer import DataParallelTrainer
  from ray.train.tests.util import create_dict_checkpoint, load_dict_checkpoint
  from ray.tune.callback import Callback
  from ray.tune.tune_config import TuneConfig
  from ray.tune.tuner import Tuner
label_desc: Use image node_id 10 for calling a global function with example usage: test_bad_return_in_train_loop(ray_start_4_cpus) and returns: FailOnUnpickle