code: def _infer_kwargs(
      previous_positional_arg_names: Sequence[str], *args: Any
  ) -> dict[str, Any]:
      inferred_kwargs = {
          arg_name: val
          for val, arg_name in zip(args, previous_positional_arg_names)
      }
      return inferred_kwargs
  
file_path: optuna/optuna/_convert_positional_args.py
imports: from __future__ import annotations
  from collections.abc import Callable
  from collections.abc import Sequence
  from functools import wraps
  from inspect import Parameter
  from inspect import signature
  from typing import Any
  from typing import TYPE_CHECKING
  from typing import TypeVar
  import warnings
label_desc: Use image node_id 2 for calling a global function with example usage: _infer_kwargs(previous_positional_arg_names) and returns: inferred_kwargs