@defer.inlineCallbacks
    def _validate_captcha(self, ip_addr, private_key, challenge, response):
        response = yield self._submit_captcha(ip_addr, private_key, challenge,
                                              response)
        # parse Google's response. Lovely format..
        lines = response.split('\n')
        json = {
            "valid": lines[0] == 'true',
            "error_url": "http://www.google.com/recaptcha/api/challenge?" +
                         "error=%s" % lines[1]
        }
        defer.returnValue(json)
Validates the captcha provided.
dataset/ETHPy150Open matrix-org/synapse/synapse/handlers/register.py/RegistrationHandler._validate_captcha