<s> from ctypes import c_char <EOL> from django . contrib . gis . geos . libgeos import lgeos , GEOM_PTR , PREPGEOM_PTR <EOL> from django . contrib . gis . geos . prototypes . errcheck import check_predicate <EOL> geos_prepare = lgeos . GEOSPrepare <EOL> geos_prepare . argtypes = [ GEOM_PTR ] <EOL> geos_prepare . restype = PREPGEOM_PTR <EOL> prepared_destroy = lgeos . GEOSPreparedGeom_destroy <EOL> prepared_destroy . argtpes = [ PREPGEOM_PTR ] <EOL> prepared_destroy . restype = None <EOL> def prepared_predicate ( func ) : <EOL> func . argtypes = [ PREPGEOM_PTR , GEOM_PTR ] <EOL> func . restype = c_char <EOL> func . errcheck = check_predicate <EOL> return func <EOL> prepared_contains = prepared_predicate ( lgeos . GEOSPreparedContains ) <EOL> prepared_contains_properly = prepared_predicate ( lgeos . GEOSPreparedContainsProperly ) <EOL> prepared_covers = prepared_predicate ( lgeos . GEOSPreparedCovers ) <EOL> prepared_intersects = prepared_predicate ( lgeos . GEOSPreparedIntersects ) </s>
