class_docstr: Test whether types of Python objects are correctly inferred and that
  the right libpython.PySomeTypeObjectPtr classes are instantiated.
  
  Also test whether values are appropriately formatted (don't be too
  laborious as Lib/test/test_gdb.py already covers this extensively).
  
  Don't take care of decreffing newly allocated objects as a new
  interpreter is started for every test anyway.
class_docstr_tok: ["Test","whether","types","of","Python","objects","are","correctly","inferred","and","that","the","right","libpython.PySomeTypeObjectPtr","classes","are","instantiated",".","Also","test","whether","values","are","appropriately","formatted","(","do","n't","be","too","laborious","as","Lib\/test\/test_gdb.py","already","covers","this","extensively",")",".","Do","n't","take","care","of","decreffing","newly","allocated","objects","as","a","new","interpreter","is","started","for","every","test","anyway","."]
code: def alloc_unicodestring(self, string, gdbvar=None):
      postfix = libpython.get_inferior_unicode_postfix()
      funcname = "PyUnicode%s_DecodeUnicodeEscape" % (postfix,)
  
      data = string.encode("unicode_escape").decode("iso8859-1")
      return self.pyobject_fromcode(
          '(PyObject *) %s("%s", %d, "strict")'
          % (
              funcname,
              data.replace('"', r"\"").replace("\\", r"\\"),
              len(data),
          ),
          gdbvar=gdbvar,
      )
  
file_path: catboost/contrib/tools/cython/Cython/Debugger/Tests/test_libpython_in_gdb.py
imports: import os
  import sys
  import gdb
  from Cython.Debugger import libcython
  from Cython.Debugger import libpython
  from .None import test_libcython_in_gdb
  from .test_libcython_in_gdb import _debug, inferior_python_version
label_desc: Use image node_id 6 for calling the TestPrettyPrinters obj's underlying member method code with example usage: obj.alloc_unicodestring(string, gdbvar) and returns: self