def _rest_config(self, method, url, data=None, headers=None):
        """
        Configure a REST resource. This issues an HTTP POST or PUT request
        to configure or update the specified resource.

        @param method: The HTTP verb to use (GET, PUT, POST)
        @param url: The URL to access.
        @param data: The serialized data to send.
        @param msg: The error message to report if something goes wrong.
        @keyword headers: Optional. HTTP headers to include in the transaction.
        @returns: True if the configuration succeeded.
        """
        if headers is None:
            headers = self.headers['default']
        try:
            conn = httplib.HTTPConnection(self.host, self.port)
            conn.request(method, url, data, headers)
            rsp = conn.getresponse()
            rsp.read() # and discard
            conn.close()
            if rsp.status != 201 and rsp.status != 200:
                logger.debug((rsp.status, method, url,) % 'HTTP Status: %d, %s %s')
                logger.debug(data)
                return False
        except Exception, ex:
            logger.debug(ex)
            return False

        return True
dataset/ETHPy150Open PublicMapping/DistrictBuilder/django/publicmapping/redistricting/config.py/SpatialUtils._rest_config/swapped operands of `%`