code: def test_deprecated_property():
      class Foo(object):  # required to get it working on Py2
          def __init__(self, bar=1):
              self._bar = bar
  
          @property
          def bar(self):
              return self._bar
  
          @bar.setter
          def bar(self, v):
              self._bar = v
  
          Bar = deprecated_property("Bar", replaced_by=bar)
          Baz = deprecated_property("Baz")
          Biz = deprecated_property("Biz", message="Biz custom message")
  
      assert Foo.Bar.__doc__ == "[Deprecated] Use ``bar`` instead"
      assert (
          Foo.Baz.__doc__
          == "[Deprecated] The property was removed and will be ignored."
      )
      assert Foo.Biz.__doc__ == "Biz custom message"
  
      with warnings.catch_warnings(record=True) as w:
          warnings.simplefilter("always")
          f = Foo(bar=5)
          assert f.bar == 5
          assert f.Bar == 5  # 1st warning
          assert f.Baz is None  # 2nd warning
          assert f.Biz is None  # 3rd warning
          f.Bar = 7  # 4th warning
          assert f.bar == 7
          f.Baz = "useless"  # 5th warning
          assert f.Baz is None  # 6th warning
  
          assert len(w) == 6
          assert (
              str(w[0].message)
              == "``Bar`` is deprecated, please use ``bar`` instead."
          )
          assert (
              str(w[1].message)
              == "``Baz`` is deprecated and will be ignored."
          )
          assert str(w[2].message) == "Biz custom message"
          assert str(w[3].message) == str(w[0].message)
          assert str(w[4].message) == str(w[1].message)
          assert str(w[5].message) == str(w[1].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 5 for calling a global function with example usage: test_deprecated_property() and returns: self