function _challengeResponse($lm = false)  // removed for dapphp/radius
775911
protected function _challengeResponse($lm = false)
    {
        if ($lm) {
            $hash = $this->lmPasswordHash();
        } else {
            $hash = $this->ntPasswordHash();
        }

        $hash = str_pad($hash, 21, "\0");

        if (extension_loaded('openssl') && $this->useMcrypt === false) {
            // added openssl routines for dapphp/radius
            $key   = $this->_desAddParity(substr($hash, 0, 7));
            $resp1 = openssl_encrypt($this->challenge, 'des-ecb', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING);

            $key   = $this->_desAddParity(substr($hash, 7, 7));
            $resp2 = openssl_encrypt($this->challenge, 'des-ecb', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING);

            $key   = $this->_desAddParity(substr($hash, 14, 7));
            $resp3 = openssl_encrypt($this->challenge, 'des-ecb', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING);
        } else {
            $td = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_ECB, '');
            $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
            $key = $this->_desAddParity(substr($hash, 0, 7));
            mcrypt_generic_init($td, $key, $iv);
            $resp1 = mcrypt_generic($td, $this->challenge);
            mcrypt_generic_deinit($td);

            $key = $this->_desAddParity(substr($hash, 7, 7));
            mcrypt_generic_init($td, $key, $iv);
            $resp2 = mcrypt_generic($td, $this->challenge);
            mcrypt_generic_deinit($td);

            $key = $this->_desAddParity(substr($hash, 14, 7));
            mcrypt_generic_init($td, $key, $iv);
            $resp3 = mcrypt_generic($td, $this->challenge);
            mcrypt_generic_deinit($td);
            mcrypt_module_close($td);
        }

        return $resp1 . $resp2 . $resp3;
    }
102959
public function check($challenge, $response)
    {
        $parameters = http_build_query([
            'privatekey' => value(app('config')->get('recaptcha.private_key')),
            'remoteip'   => app('request')->getClientIp(),
            'challenge'  => $challenge,
            'response'   => $response,
        ]);

        $http_request = "POST " . self::ENDPOINT . " HTTP/1.0\r\n";
        $http_request .= "Host: " . self::VERIFY_SERVER . "\r\n";
        $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
        $http_request .= "Content-Length: " . strlen($parameters) . "\r\n";
        $http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
        $http_request .= "\r\n";
        $http_request .= $parameters;

        $apiResponse = '';

        if (false == ( $fs = @fsockopen(self::VERIFY_SERVER, 80) )) {
            throw new \Exception('Could not open socket');
        }

        fwrite($fs, $http_request);

        while ( ! feof($fs)) {
            $apiResponse .= fgets($fs, 1160); // One TCP-IP packet
        }

        fclose($fs);

        $apiResponse = explode("\r\n\r\n", $apiResponse, 2);

        list( $passed, $responseText ) = explode("\n", $apiResponse[1]);

        return ( 'true' === trim($passed) );
    }
1109615
def cmd(send, msg, args):
    
    if not msg:
        send("What is your question?")
        # let people !8ball again if they screw up and forget the part where you ask a question.
        args['handler'].abuselist[args['nick']]['8ball'].pop()
        return
    answers = {
        "It is certain": "yes",
        "It is decidedly so": "yes",
        "Without a doubt": "yes",
        "Yes, definitely": "yes",
        "You may rely on it": "yes",
        "As I see it, yes": "yes",
        "Most likely": "yes",
        "Outlook good": "yes",
        "Yes": "yes",
        "Signs point to yes": "yes",
        "Reply hazy, try again": "maybe",
        "Ask again later": "maybe",
        "Better not tell you now": "maybe",
        "Cannot predict now": "maybe",
        "Concentrate and ask again": "maybe",
        "Don't count on it": "no",
        "My reply is no": "no",
        "My sources say no": "no",
        "Outlook not so good": "no",
        "Very doubtful": "no"
    }
    answer = choice(list(answers.keys()))
    send('says... %s' % answer, 'action')
1167976
def local_response_norm(attrs, inputs, proto_obj):
    """"""
    new_attrs = translation_utils._fix_attribute_names(attrs,
                                                       {'bias': 'knorm',
                                                        'size' : 'nsize'})
    return 'LRN', new_attrs, inputs
1087993
function _rsavp1($s)
    {
        if ($s->compare($this->zero) < 0 || $s->compare($this->modulus) > 0) {
            user_error('Signature representative out of range');
            return false;
        }
        return $this->_exponentiate($s);
    }
991535
public function challengeParseAndApply(Buffer $challenge_buffer)
    {
        // Pull out the challenge
        $challenge = substr(preg_replace("/[^0-9\-]/si", "", $challenge_buffer->getBuffer()), 1);

        // By default, no challenge result (see #197)
        $challenge_result = '';

        // Check for valid challenge (see #197)
        if ($challenge) {
            // Encode chellenge result
            $challenge_result = sprintf(
                "%c%c%c%c",
                ($challenge >> 24),
                ($challenge >> 16),
                ($challenge >> 8),
                ($challenge >> 0)
            );
        }

        // Apply the challenge and return
        return $this->challengeApply($challenge_result);
    }
1009414
function rp(p,i)
			{
				if(!p || typeof p.then !== "function")
					p = Zousan.resolve(p);
				p.then(
						function(yv) { results[i] = yv; rc++; if(rc == pa.length) retP.resolve(results); },
						function(nv) { retP.reject(nv); }
					);
			}
838012
function Response(json) {
		// PRIVATE MEMBERS //

		var checkBounds = function (idx) {
			// Ensures that an index is within the number of candidates
			if (idx >= json.length || idx < 0) {
				if (json.length == 0)
					throw new Error("Candidate index is out of bounds (no candidates returned; requested " + idx + ")");
				else
					throw new Error("Candidate index is out of bounds (" + json.length + " candidates; indicies 0 through " +
						(json.length - 1) + " available; requested " + idx + ")");
			}
		};

		var maybeDefault = function (idx) {
			// Assigns index to 0, the default value, if no value is passed in
			return typeof idx === "undefined" ? 0 : idx;
		};

		// PUBLIC-FACING MEMBERS //

		this.raw = json;
		this.length = json.length;

		this.isValid = function () {
			return (this.length === 1 &&
				(this.raw[0].analysis.verification_status === "Verified" ||
					this.raw[0].analysis.verification_status === "Partial" ||
					(typeof this.raw[0].analysis.dpv_match_code !== "undefined" && this.raw[0].analysis.dpv_match_code !== "N")));
		};

		this.isInvalid = function () {
			return (this.length === 0 ||
				(this.length === 1 &&
					(this.raw[0].analysis.verification_status === "None" ||
						this.raw[0].analysis.address_precision === "None" ||
						this.raw[0].analysis.address_precision === "AdministrativeArea" ||
						this.raw[0].analysis.address_precision === "Locality" ||
						this.raw[0].analysis.address_precision === "Thoroughfare" ||
						this.raw[0].analysis.dpv_match_code === "N" ||
						(typeof this.raw[0].analysis.verification_status === "undefined" &&
							typeof this.raw[0].analysis.dpv_match_code === "undefined"))));
		};

		this.isAmbiguous = function () {
			return this.length > 1;
		};

		this.isMissingSecondary = function (idx) {
			idx = maybeDefault(idx);
			checkBounds(idx);
			return (this.raw[idx].analysis.dpv_footnotes && this.raw[idx].analysis.dpv_footnotes.indexOf("N1") > -1) ||
				(this.raw[idx].analysis.dpv_footnotes && this.raw[idx].analysis.dpv_footnotes.indexOf("R1") > -1) ||
				(this.raw[idx].analysis.footnotes && this.raw[idx].analysis.footnotes.indexOf("H#") > -1);
		};
	}
274254
function (actual, message) {
        YUITest.Assert._increment();
        if (true !== actual) {
            throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be true."), true, actual);
        }

    }
775415
function reject(vReason) {
			vResult = vReason;
			iState = -1;

			if (!bCaught && SyncPromise.listener) {
				SyncPromise.listener(that, false);
			}

			if (fnReject) {
				fnReject(vReason);
				fnReject = fnResolve = null; // be nice to the garbage collector
			}
		}
512119
function (/*response*/) {

        // do something when collide
        me.audio.play("cling", false);
        // give some score
        game.data.score += 250;

        //avoid further collision and delete it
        this.body.setCollisionMask(me.collision.types.NO_OBJECT);

        me.game.world.removeChild(this);

        return false;
    }
1370672
function (rawEmail, callback) {
        if (!isSpamcAvailable) {
            return callback(null, 0.0);
        }

        spamc.report(rawEmail, function (err, result) {
            logger.verbose(result);
            if (err) logger.error(err);
            if (err) return callback(new Error('Unable to compute spam score.'));
            callback(null, result.spamScore);
        });
    }
1229849
static function _httpResponseToMessage($response)
    {
        // Should this function be named Message.fromHTTPResponse instead?
        $response_message = Auth_OpenID_Message::fromKVForm($response->body);

        if ($response->status == 400) {
            return Auth_OpenID_ServerErrorContainer::fromMessage(
                        $response_message);
        } else if ($response->status != 200 and $response->status != 206) {
            return null;
        }

        return $response_message;
    }
1000536
def _check_pillar_pcre_minions(self, expr, delimiter, greedy):
        '''
        
        '''
        return self._check_cache_minions(expr,
                                         delimiter,
                                         greedy,
                                         'pillar',
                                         regex_match=True)
576263
function _rsaep($m)
    {
        if ($m->compare($this->zero) < 0 || $m->compare($this->modulus) > 0) {
            user_error('Message representative out of range');
            return false;
        }
        return $this->_exponentiate($m);
    }
1170941
function removeAssociation($server_url, $handle)
    {
        // create memcached keys for association itself
        // and list of associations for this server
        $serverKey = $this->associationServerKey($server_url);
        $associationKey = $this->associationKey($server_url,
            $handle);

        // get list of associations
        $serverAssociations = $this->connection->get($serverKey);
        // return null if failed or got empty list
        if (!$serverAssociations) {
            return false;
        }

        // ensure that given association key exists in list
        $serverAssociations = array_flip($serverAssociations);
        if (!array_key_exists($associationKey, $serverAssociations)) {
            return false;
        }

        // remove given association key from list
        unset($serverAssociations[$associationKey]);
        $serverAssociations = array_flip($serverAssociations);

        // save updated list
        $this->connection->set(
            $serverKey,
            $serverAssociations,
            $this->compress
        );

        // delete association
        return $this->connection->delete($associationKey);
    }
113859
def yes_no_query(question):
    

    print("{} (y/n)".format(question), end=" "),
    while True:
        try:
            return strtobool(input().lower())
        except ValueError:
            print("Please respond with 'y' or 'n'.")