def check_predicate(result, func, cargs):
 val = ord(result)
 if (val == 1):
  return True
 elif (val == 0):
  return False
 else:
  raise GEOSException(('Error encountered on GEOS C predicate function "%s".' % func.__name__))

def check_predicate ( result , func , cargs ) : val = ord ( result ) if ( val == 1 ) : return True elif ( val == 0 ) : return False else : raise GEOSException ( ( 'Error encountered on GEOS C predicate function "%s".' % func . __name__ ) )
error checking for unary/binary predicate functions .