code: def tune_function(api_key_file):
      """Example for using a WandbLoggerCallback with the function API."""
      tuner = tune.Tuner(
          objective,
          tune_config=tune.TuneConfig(
              metric="loss",
              mode="min",
          ),
          run_config=air.RunConfig(
              callbacks=[
                  WandbLoggerCallback(
                      api_key_file=api_key_file, project="Wandb_example"
                  )
              ],
          ),
          param_space={
              "mean": tune.grid_search([1, 2, 3, 4, 5]),
              "sd": tune.uniform(0.2, 0.8),
          },
      )
      results = tuner.fit()
  
      return results.get_best_result().config
  
file_path: wandb/tests/functional_tests/t0_main/raytune/t2_callback.py
imports: import numpy
  from _test_support import get_wandb_api_key_file
  from ray import air, tune
  from ray.air import session
  from ray.air.callbacks.wandb import WandbLoggerCallback
label_desc: Use image node_id 2 for calling a global function with example usage: tune_function(api_key_file) and returns: results