<s> """<STR_LIT>""" <EOL> from ctypes import c_int , c_double , POINTER <EOL> from django . contrib . gis . geos . libgeos import GEOM_PTR , GEOS_PREPARE <EOL> from django . contrib . gis . geos . prototypes . errcheck import check_dbl , check_string <EOL> from django . contrib . gis . geos . prototypes . geom import geos_char_p <EOL> from django . contrib . gis . geos . prototypes . threadsafe import GEOSFunc <EOL> from django . utils . six . moves import xrange <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> def dbl_from_geom ( func , num_geom = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> argtypes = [ GEOM_PTR for i in xrange ( num_geom ) ] <EOL> argtypes += [ POINTER ( c_double ) ] <EOL> func . argtypes = argtypes <EOL> func . restype = c_int <EOL> func . errcheck = check_dbl <EOL> return func <EOL> geos_area = dbl_from_geom ( GEOSFunc ( '<STR_LIT>' ) ) <EOL> geos_distance = dbl_from_geom ( GEOSFunc ( '<STR_LIT>' ) , num_geom = <NUM_LIT:2> ) <EOL> geos_length = dbl_from_geom ( GEOSFunc ( '<STR_LIT>' ) ) <EOL> if GEOS_PREPARE : <EOL> geos_isvalidreason = GEOSFunc ( '<STR_LIT>' ) <EOL> geos_isvalidreason . argtypes = [ GEOM_PTR ] <EOL> geos_isvalidreason . restype = geos_char_p <EOL> geos_isvalidreason . errcheck = check_string <EOL> __all__ . append ( '<STR_LIT>' ) </s>
