code: def test_convert_positional_args_invalid_positional_args() -> None:
      previous_positional_arg_names: List[str] = ["a", "b"]
      decorator_converter = convert_positional_args(
          previous_positional_arg_names=previous_positional_arg_names
      )
      assert callable(decorator_converter)
  
      decorated_func = decorator_converter(_sample_func)
      with pytest.warns(FutureWarning):
          with pytest.raises(TypeError) as record:
              decorated_func(1, 2, 3)  # type: ignore
          assert (
              str(record.value)
              == "_sample_func() takes 2 positional arguments but 3 were given."
          )
  
          with pytest.raises(TypeError) as record:
              decorated_func(1, 3, b=2)  # type: ignore
          assert (
              str(record.value)
              == "_sample_func() got multiple values for arguments {'b'}."
          )
  
file_path: optuna/tests/test_convert_positional_args.py
imports: import re
  from typing import List
  import pytest
  from optuna._convert_positional_args import convert_positional_args
label_desc: Use image node_id 7 for calling a global function with example usage: test_convert_positional_args_invalid_positional_args() without return types