code: def test_use_existing_or_default_experiment(
      tmpdir: py.path.local, name: Optional[str], expected: str
  ) -> None:
      if name is not None:
          tracking_uri = f"file:{tmpdir}"
          mlflow.set_tracking_uri(tracking_uri)
          mlflow.set_experiment(name)
  
      else:
          # Target directory can't exist when initializing first
          # run with default experiment at non-default uri.
          tracking_uri = f"file:{tmpdir}/foo"
          mlflow.set_tracking_uri(tracking_uri)
  
      mlflc = MLflowCallback(
          tracking_uri=tracking_uri, create_experiment=False
      )
      study = optuna.create_study()
  
      for _ in range(10):
          # Simulate multiple optimization runs under same experiment.
          study.optimize(_objective_func, n_trials=1, callbacks=[mlflc])
  
      mlfl_client = MlflowClient(tracking_uri)
      experiment = mlfl_client.search_experiments()[0]
      runs = mlfl_client.search_runs(experiment.experiment_id)
  
      assert experiment.name == expected
      assert len(runs) == 10
  
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 4 for calling a global function with example usage: test_use_existing_or_default_experiment(tmpdir, name, expected) without return types