code: def _get_problem_from_common_inputs(
      bounds: List[Tuple[float, float]],
      dim_int: int,
      metric_name: str,
      infer_noise: bool,
      test_problem_class: Type[SyntheticTestFunction],
      benchmark_name: str,
      num_trials: int,
      test_problem_bounds: Optional[List[Tuple[float, float]]] = None,
  ) -> BenchmarkProblem:
      """This is a helper that deduplicates common bits of the below problems.
  
      Args:
          bounds: The parameter bounds.
          dim_int: The number of integer dimensions. First `dim_int` parameters
              are assumed to be integers.
          metric_name: The name of the metric.
          infer_noise: Whether to infer noise or assume noise-free objective.
          test_problem_class: The BoTorch test problem class.
          benchmark_name: The name of the benchmark problem.
          num_trials: The number of trials.
          test_problem_bounds: Optional bounds to evaluate the base test problem on.
              These are passed in as `bounds` while initializing the test problem.
  
      Returns:
          A mixed-integer BenchmarkProblem constructed from the given inputs.
      """
      dim = len(bounds)
      search_space = SearchSpace(
          parameters=[
              RangeParameter(
                  name=f"x{i + 1}",
                  parameter_type=ParameterType.INT
                  if i < dim_int
                  else ParameterType.FLOAT,
                  lower=bounds[i][0],
                  upper=bounds[i][1],
              )
              for i in range(dim)
          ]
      )
      optimization_config = OptimizationConfig(
          objective=Objective(
              metric=BotorchTestProblemMetric(
                  name=metric_name,
                  noise_sd=None if infer_noise else 0.0,
              ),
              minimize=True,
          )
      )
      test_problem_kwargs: Dict[str, Any] = {"dim": dim}
      if test_problem_bounds is not None:
          test_problem_kwargs["bounds"] = test_problem_bounds
      runner = BotorchTestProblemRunner(
          test_problem_class=test_problem_class,
          test_problem_kwargs=test_problem_kwargs,
          modified_bounds=bounds,
      )
      return BenchmarkProblem(
          name=benchmark_name,
          search_space=search_space,
          optimization_config=optimization_config,
          runner=runner,
          num_trials=num_trials,
          infer_noise=infer_noise,
      )
  
file_path: Ax/ax/benchmark/problems/synthetic/discretized/mixed_integer.py
imports: from typing import Any, Dict, List, Optional, Tuple, Type
  from ax.benchmark.benchmark_problem import BenchmarkProblem
  from ax.core.objective import Objective
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.parameter import ParameterType, RangeParameter
  from ax.core.search_space import SearchSpace
  from ax.metrics.botorch_test_problem import BotorchTestProblemMetric
  from ax.runners.botorch_test_problem import BotorchTestProblemRunner
  from botorch.test_functions.synthetic import Ackley, Hartmann, Rosenbrock, SyntheticTestFunction
label_desc: Use image node_id 1 for calling a global function with example usage: _get_problem_from_common_inputs(bounds, dim_int, metric_name, infer_noise, test_problem_class, benchmark_name, num_trials, test_problem_bounds) and returns: BenchmarkProblem