code: def test_to_unicode():
      assert strings.to_unicode("юникод") == "юникод"
      assert strings.to_unicode("str") == "str"
      assert strings.to_unicode("строка".encode("utf-8")) == "строка"
      assert (
          strings.to_unicode("строка".encode("cp1251"), "cp1251")
          == "строка"
      )
      if six.PY2:  # __str__ should return str not bytes in Python3
          assert strings.to_unicode(Convertible()) == Convertible.text
          assert (
              strings.to_unicode(ConvertibleToUnicodeOnly())
              == Convertible.text
          )
          with pytest.raises(UnicodeDecodeError):
              strings.to_unicode(ConvertibleToStrOnly())
          with pytest.raises(UnicodeDecodeError):
              strings.to_unicode(NonConvertible())
  
imports: import pytest
  import six
  from library.python import strings
label_desc: Use image node_id 2 for calling a global function with example usage: test_to_unicode() without return types