returns true if webhooks are identical
778710
function compareWebhooks(webhook, name, targetUrl, resource, event, filter, secret) {
	if ((webhook.name !== name)
	|| (webhook.targetUrl !== targetUrl)
	|| (webhook.resource !== resource)
	|| (webhook.event !== event)) {
		return false;
	}

	// they look pretty identifty, let's check optional fields
	if (filter) {
		if (filter !== webhook.filter) {
			fine("webhook look pretty similar BUT filter is different");
			return false;
		}
	}
	else {
		if (webhook.filter) {
			fine("webhook look pretty similar BUT filter is different");
			return false;
		}
	}

	if (secret) {
		if (secret !== webhook.secret) {
			fine("webhook look pretty similar BUT secret is different");
			return false;
		}
	}
	else {
		if (webhook.secret) {
			fine("webhook look pretty similar BUT secret is different");
			return false;
		}
	}
	return true;
}
1032040
public boolean anyMatched(String[] requestPathTokens) {
		Map<String, String> pathParams = new HashMap<>();
		for (PathPattern pattern : routes.keySet()) {
			if (pattern.match(requestPathTokens, pathParams)) {
				return true;
			}

			// Reset for the next loop
			pathParams.clear();
		}

		return false;
	}
763304
public function verifyHash() {
		$this->ensureInput();
		if(empty($this->input['hash']))
			throw new WebHookHandlerException('No hash provided in input payload', WebHookHandlerException::NO_INPUT_HASH);
		
		if($this->input['payloadEncrypted']) {
			if(!$this->payloadJSONString && !$this->getPayload()) return false;
		} else {
			if(!$this->payloadJSONString) $this->payloadJSONString = json_encode($this->input['payload']);
		}
		
		$webHookSalt = substr($this->input['hash'], 0, self::SALT_LENGTH);
		return $this->input['hash'] === $webHookSalt.hash(self::HASH_METHOD, $webHookSalt.$this->secret.$this->payloadJSONString);
	}
57797
function copyHooks() {
		var src = path.join(__dirname, 'hooks');
		var dest = path.join(process.env.PWD, 'hooks');

		return pify(fs.copy.bind(fs), Promise)(path.join(__dirname, 'platforms.json'), path.join(dest, 'platforms.json'))
			.then(function () {
				memFsEditor.copyTpl(src, dest, options);

				return pify(memFsEditor.commit.bind(memFsEditor))();
			})
			.then(function () {
				// Make all the scripts executable in the Cordova project
				fs.readdirSync(src).forEach(function (hook) {
					var hookPath = path.join(dest, hook);

					fs.readdirSync(hookPath).forEach(function (script) {
						fs.chmodSync(path.join(hookPath, script), '755');
					});
				});
			});
	}
954030
public static function checkBrowserShiretoko()
    {
        if (stripos(self::$userAgentString, 'Mozilla') !== false &&
            preg_match('/Shiretoko\/([^ ]*)/i', self::$userAgentString, $matches)
        ) {
            if (isset($matches[1])) {
                self::$browser->setVersion($matches[1]);
            }
            self::$browser->setName(Browser::SHIRETOKO);

            return true;
        }

        return false;
    }
1094731
def get_webhook(self, webhook):
        
        return self.manager.get_webhook(self.scaling_group, self, webhook)
807855
def process_webhooks(webhooks)
      webhooks.each do |element|
        webhook = Webhook.new(element, @bot)
        @webhooks[webhook.id] = webhook
      end
    end
44559
function _is_same(a, b){
	//bark('typeof(a, b): ' + typeof(a) + ',' + typeof(b));

	var ret = false;
	if( a == b ){ // atoms, incl. null and 'string'
	    //bark('true on equal atoms: ' + a + '<>' + b);
	    ret = true;
	}else{ // is list or obj (ignore func)
	    if( typeof(a) === 'object' && typeof(b) === 'object' ){
		//bark('...are objects');
		
		// Null is an object, but not like the others.
		if( a == null || b == null ){
		    ret = false;
		}else if( Array.isArray(a) && Array.isArray(b) ){ // array equiv
		    //bark('...are arrays');
		    
		    // Recursively check array equiv.
		    if( a.length == b.length ){
			if( a.length == 0 ){
			    //bark('true on 0 length array');
			    ret = true;
			}else{
			    ret = true; // assume true until false here
			    for( var i = 0; i < a.length; i++ ){
				if( ! _is_same(a[i], b[i]) ){
				    //bark('false on diff @ index: ' + i);
				    ret = false;
				    break;
				}
			    }
			}
		    }

		}else{ // object equiv.

		    // Get unique set of keys.
		    var a_keys = Object.keys(a);
		    var b_keys = Object.keys(b);
		    var keys = a_keys.concat(b_keys.filter(function(it){
			return a_keys.indexOf(it) < 0;
		    }));
		    
		    // Assume true until false.
		    ret = true;
		    for( var j = 0; j < keys.length; j++ ){ // no forEach - break
			var k = keys[j];
			if( ! _is_same(a[k], b[k]) ){
			    //bark('false on key: ' + k);
			    ret = false;
			    break;
			}
		    }
		}
	    }else{
		//bark('false by default');
	    }
	}
	
	return ret;
    }
911941
def getsystemhooks(self, page=1, per_page=20):
        
        data = {'page': page, 'per_page': per_page}

        request = requests.get(
            self.hook_url, params=data, headers=self.headers,
            verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 200:
            return request.json()
        else:
            return False
319275
def webhooks
      webhooks = JSON.parse(API::Server.webhooks(@bot.token, @id))
      webhooks.map { |webhook| Webhook.new(webhook, @bot) }
    end
365155
def create_webhook(self, events, url, payload_format):
        """"""
        body = {
            "Events": events,
            "Url": url,
            "PayloadFormat": payload_format}
        response = self._post(self.uri_for("webhooks"), json.dumps(body))
        return json_to_py(response)
1228158
def probably_identical(self):
        
        if len(self._unmatched_blocks_from_a | self._unmatched_blocks_from_b) > 0:
            return False
        for (a, b) in self._block_matches:
            if not self.blocks_probably_identical(a, b):
                return False
        return True
112725
function mergeHook (
  parentVal,
  childVal
) {
  const res = childVal
    ? parentVal
      ? parentVal.concat(childVal)
      : Array.isArray(childVal)
        ? childVal
        : [childVal]
    : parentVal;
  return res
    ? dedupeHooks(res)
    : res
}
48529
def if_match(self):
        """"""
        match = True
        if_match = self.request.META.get('HTTP_IF_MATCH')
        if if_match:
            etag = self.etag()
            if etag != if_match:
                match = False
        return match
12600
protected function checkBrowserShiretoko()
    {
        if (stripos($this->_agent, 'Mozilla') !== false && preg_match('/Shiretoko\/([^ ]*)/i', $this->_agent, $matches)) {
            $this->setVersion($matches[1]);
            $this->setBrowser(self::BROWSER_SHIRETOKO);
            return true;
        }
        return false;
    }
213534
function DetectBlackBerryWebKit()
   {
      if (($this->DetectBlackBerry() == $this->true) &&
		($this->DetectWebkit() == $this->true))
         return $this->true; 
      else
        return $this->false; 
   }
302221
function isInTrustyOrigins(url, trustyOrigins) {
  const len = trustyOrigins.length;
  for (let i = 0; i < len; i++) {
    if (trustyOrigins[i] === '*') {
      return true;
    }
    if (isSameOrigin(trustyOrigins[i], url)) {
      return true;
    }
  }
  return false;
}