code: def test_deprecated_params_message_can_be_customized():
      class Foo:
          @deprecated_params(
              dict(
                  Foo=("foo", "Foo custom message"),
                  Baz=(None, "Baz custom message"),
              )
          )
          def __init__(self, foo=1, bar=2):
              self.foo = foo
              self.bar = bar
  
      with warnings.catch_warnings(record=True) as w:
          warnings.simplefilter("always")
          f = Foo(Foo=5, Baz=17)
          assert f.foo == 5
          assert f.bar == 2
          assert len(w) == 2
          assert str(w[0].message) == "Foo custom message"
          assert str(w[1].message) == "Baz custom message"
  
file_path: h2o-3/h2o-py/tests/testdir_utils/pyunit_deprecations.py
imports: import os
  import re
  import sys
  import warnings
  from h2o.utils.metaclass import deprecated_params, deprecated_property, deprecated_fn, fullname
  from tests import pyunit_utils
label_desc: Use image node_id 3 for calling a global function with example usage: test_deprecated_params_message_can_be_customized() without return types