code: def test_track_in_mlflow_decorator(
      tmpdir: py.path.local, n_jobs: int
  ) -> None:
      tracking_uri = f"file:{tmpdir}"
      study_name = "my_study"
      n_trials = n_jobs * 2
  
      metric_name = "additional_metric"
      metric = 3.14
  
      mlflc = MLflowCallback(tracking_uri=tracking_uri)
  
      def _objective_func(trial: optuna.trial.Trial) -> float:
          """Objective function"""
  
          x = trial.suggest_float("x", -1.0, 1.0)
          y = trial.suggest_float("y", 20, 30, log=True)
          z = trial.suggest_categorical("z", (-1.0, 1.0))
          trial.set_user_attr("my_user_attr", "my_user_attr_value")
          mlflow.log_metric(metric_name, metric)
          return (x - 2) ** 2 + (y - 25) ** 2 + z
  
      tracked_objective = mlflc.track_in_mlflow()(_objective_func)
  
      study = optuna.create_study(study_name=study_name)
      study.optimize(
          tracked_objective,
          n_trials=n_trials,
          callbacks=[mlflc],
          n_jobs=n_jobs,
      )
  
      mlfl_client = MlflowClient(tracking_uri)
      experiments = mlfl_client.search_experiments()
      assert len(experiments) == 1
  
      experiment = experiments[0]
      assert experiment.name == study_name
      experiment_id = experiment.experiment_id
  
      runs = mlfl_client.search_runs(experiment_id)
      assert len(runs) == n_trials
  
      first_run = runs[0]
      first_run_dict = first_run.to_dictionary()
  
      assert metric_name in first_run_dict["data"]["metrics"]
      assert first_run_dict["data"]["metrics"][metric_name] == metric
  
      assert tracked_objective.__name__ == _objective_func.__name__
      assert tracked_objective.__doc__ == _objective_func.__doc__
  
imports: from typing import Callable
  from typing import List
  from typing import Optional
  from typing import Tuple
  from typing import Union
  import numpy
  import py
  import pytest
  import optuna
  from optuna._imports import try_import
  from optuna.integration.mlflow import MLflowCallback
label_desc: Use image node_id 18 for calling a global function with example usage: test_track_in_mlflow_decorator(tmpdir, n_jobs) and returns: unknown