code: def test_implicit_conversion():
      from pybind11_tests import ClassWithUnscopedEnum
  
      assert (
          str(ClassWithUnscopedEnum.EMode.EFirstMode)
          == "EMode.EFirstMode"
      )
      assert str(ClassWithUnscopedEnum.EFirstMode) == "EMode.EFirstMode"
  
      f = ClassWithUnscopedEnum.test_function
      first = ClassWithUnscopedEnum.EFirstMode
      second = ClassWithUnscopedEnum.ESecondMode
  
      assert f(first) == 1
  
      assert f(first) == f(first)
      assert not f(first) != f(first)
  
      assert f(first) != f(second)
      assert not f(first) == f(second)
  
      assert f(first) == int(f(first))
      assert not f(first) != int(f(first))
  
      assert f(first) != int(f(second))
      assert not f(first) == int(f(second))
  
      # noinspection PyDictCreation
      x = {f(first): 1, f(second): 2}
      x[f(first)] = 3
      x[f(second)] = 4
      # Hashing test
      assert str(x) == "{EMode.EFirstMode: 3, EMode.ESecondMode: 4}"
  
imports: import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_implicit_conversion() without return types