code: def test_mixed_args_and_kwargs(msg):
      from pybind11_tests import (
          mixed_plus_args,
          mixed_plus_kwargs,
          mixed_plus_args_kwargs,
          mixed_plus_args_kwargs_defaults,
      )
  
      mpa = mixed_plus_args
      mpk = mixed_plus_kwargs
      mpak = mixed_plus_args_kwargs
      mpakd = mixed_plus_args_kwargs_defaults
  
      assert mpa(1, 2.5, 4, 99.5, None) == (1, 2.5, (4, 99.5, None))
      assert mpa(1, 2.5) == (1, 2.5, ())
      with pytest.raises(TypeError) as excinfo:
          assert mpa(1)
      assert (
          msg(excinfo.value)
          == """
          mixed_plus_args(): incompatible function arguments. The following argument types are supported:
              1. (arg0: int, arg1: float, *args) -> tuple
  
          Invoked with: 1
      """
      )  # noqa: E501
      with pytest.raises(TypeError) as excinfo:
          assert mpa()
      assert (
          msg(excinfo.value)
          == """
          mixed_plus_args(): incompatible function arguments. The following argument types are supported:
              1. (arg0: int, arg1: float, *args) -> tuple
  
          Invoked with:
      """
      )  # noqa: E501
  
      assert mpk(-2, 3.5, pi=3.14159, e=2.71828) == (
          -2,
          3.5,
          {"e": 2.71828, "pi": 3.14159},
      )
      assert mpak(7, 7.7, 7.77, 7.777, 7.7777, minusseven=-7) == (
          7,
          7.7,
          (7.77, 7.777, 7.7777),
          {"minusseven": -7},
      )
      assert mpakd() == (1, 3.14159, (), {})
      assert mpakd(3) == (3, 3.14159, (), {})
      assert mpakd(j=2.71828) == (1, 2.71828, (), {})
      assert mpakd(k=42) == (1, 3.14159, (), {"k": 42})
      assert mpakd(1, 1, 2, 3, 5, 8, then=13, followedby=21) == (
          1,
          1,
          (2, 3, 5, 8),
          {"then": 13, "followedby": 21},
      )
      # Arguments specified both positionally and via kwargs is an error:
      with pytest.raises(TypeError) as excinfo:
          assert mpakd(1, i=1)
      assert (
          msg(excinfo.value)
          == """
          mixed_plus_args_kwargs_defaults(): got multiple values for argument 'i'
      """
      )
      with pytest.raises(TypeError) as excinfo:
          assert mpakd(1, 2, j=1)
      assert (
          msg(excinfo.value)
          == """
          mixed_plus_args_kwargs_defaults(): got multiple values for argument 'j'
      """
      )
  
imports: import pytest
  from pybind11_tests import kw_func0, kw_func1, kw_func2, kw_func3, kw_func4, args_function, args_kwargs_function, kw_func_udl, kw_func_udl_z, KWClass
label_desc: Use image node_id 4 for calling a global function with example usage: test_mixed_args_and_kwargs(msg) without return types