code: def test_dataset_ok():
      def f(*a):
          ray.data.range(10).show()
  
      tune.run(f, verbose=0)
  
      def g(*a):
          ctx = DataContext.get_current()
          ctx.scheduling_strategy = PlacementGroupSchedulingStrategy(
              ray.util.get_current_placement_group()
          )
          ray.data.range(10).show()
  
      with pytest.raises(TuneError):
          tune.run(g, verbose=0)
  
      tune.run(
          g,
          resources_per_trial=tune.PlacementGroupFactory(
              [{"CPU": 1}] * 2
          ),
          verbose=0,
      )
  
file_path: ray/python/ray/tune/tests/test_warnings.py
imports: import pytest
  import ray
  from ray import tune
  from ray.data.context import DataContext
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
  from ray.tune.error import TuneError
label_desc: Use image node_id 5 for calling a global function with example usage: test_dataset_ok() without return types