class_docstr: Unit test for our bytea format parser.
class_docstr_tok: ["Unit","test","for","our","bytea","format","parser","."]
docstr: Use ctypes to access the C function.
docstr_tok: ["Use","ctypes","to","access","the","C","function","."]
code: def _import_cast(self):
      """Use ctypes to access the C function."""
      lib = ctypes.pydll.LoadLibrary(psycopg2._psycopg.__file__)
      cast = lib.typecast_BINARY_cast
      cast.argtypes = [
          ctypes.c_char_p,
          ctypes.c_size_t,
          ctypes.py_object,
      ]
      cast.restype = ctypes.py_object
      return cast
  
imports: import string
  import ctypes
  import decimal
  import datetime
  import platform
  from .None import testutils
  import unittest
  from .testutils import ConnectingTestCase, restore_types
  from .testutils import skip_if_crdb
  import psycopg2
  from psycopg2.extensions import AsIs, adapt, register_adapter
label_desc: Use image node_id 2 for calling the ByteaParserTest obj's underlying member method code with example usage: obj._import_cast() and returns: cast