def check_pointer(result, func, cargs):
    "Makes sure the result pointer is valid."
    if isinstance(result, six.integer_types):
        result = c_void_p(result)
    if result:
        return result
    else:
        raise GDALException(func.__name__ % 'Invalid pointer returned from "%s"')
dataset/ETHPy150Open django/django/django/contrib/gis/gdal/prototypes/errcheck.py/check_pointer/swapped operands of `%`