the message would cause high watermark the function returns false.
3342
public boolean checkWrite()
    {
        if (!outActive || state != State.ACTIVE) {
            return false;
        }

        // TODO DIFF V4 small change, it is done like this in 4.2.2
        boolean full = !checkHwm();

        if (full) {
            outActive = false;
            return false;
        }

        return true;
    }
293388
public void
applyStream(Message m, TSIGRecord old, boolean first) {
	if (first) {
		apply(m, old);
		return;
	}
	Date timeSigned = new Date();
	int fudge;
	hmac.reset();

	fudge = Options.intValue("tsigfudge");
	if (fudge < 0 || fudge > 0x7FFF)
		fudge = FUDGE;

	DNSOutput out = new DNSOutput();
	out.writeU16(old.getSignature().length);
	hmac.update(out.toByteArray());
	hmac.update(old.getSignature());

	/* Digest the message */
	hmac.update(m.toWire());

	out = new DNSOutput();
	long time = timeSigned.getTime() / 1000;
	int timeHigh = (int) (time >> 32);
	long timeLow = (time & 0xFFFFFFFFL);
	out.writeU16(timeHigh);
	out.writeU32(timeLow);
	out.writeU16(fudge);

	hmac.update(out.toByteArray());

	byte [] signature = hmac.doFinal();
	byte [] other = null;

	Record r = new TSIGRecord(name, DClass.ANY, 0, alg, timeSigned, fudge,
				  signature, m.getHeader().getID(),
				  Rcode.NOERROR, other);
	m.addRecord(r, Section.ADDITIONAL);
	m.tsigState = Message.TSIG_SIGNED;
}
642563
public JsonElement getExpectedHighWatermark() {
    return JSON_PARSER.parse(getProp(ConfigurationKeys.WATERMARK_INTERVAL_VALUE_KEY)).getAsJsonObject()
        .get(WatermarkInterval.EXPECTED_HIGH_WATERMARK_TO_JSON_KEY);
  }
995437
def watermark_process():
    """"""
    # Redirect to watermark page that contains form
    if not request.method == 'POST':
        abort(403)

    # Check if the post request has the file part
    if 'pdf' not in request.files:
        abort(403)

    # Retrieve PDF file and parameters
    file = request.files['pdf']

    # If user does not select file, browser also submit an empty part without filename
    if file.filename == '':
        abort(403)

    # Check if the file is an allowed file type
    if not allowed_file(file.filename):
        abort(403)

    params = {
        'address': request.form['address'],
        'town': request.form['town'],
        'state': request.form['state'],
    }

    # Save file to uploads folder
    filename = secure_filename(file.filename)
    file_path = os.path.join(app.config['UPLOAD_FOLDER'], filename)

    # Make uploads directory if it does not exist
    if not os.path.exists(app.config['UPLOAD_FOLDER']):
        os.mkdir(app.config['UPLOAD_FOLDER'])

    file.save(file_path)

    # Create new watermarked file and return file path
    watermarked = apply_watermark(file_path, params)
    return send_from_directory(app.config['UPLOAD_FOLDER'], os.path.basename(watermarked))
906973
function () {
        var mime = this.mime();

        // if there is no mime detected, there is no accurate way to render this thing
        if (!this.mime) {
            return E;
        }

        // we create the body string first from stream and then fallback to body
        return 'data:' + mime._sanitisedContentType + ';base64, ' + ((!_.isNil(this.stream) &&
            util.bufferOrArrayBufferToBase64(this.stream)) || (!_.isNil(this.body) && util.btoa(this.body)) || E);
    }
1318481
function isValidMethodCharacter(ch) {
  if (!ch) {
    return false
  }

  return (
    inRange(code(ch), 0x30, 0x39) ||
    inRange(code(ch), 0x61, 0x7a)
  )
}
586526
private void handleWaterMarkEvent(Event<T> event) {
    long watermarkTs = event.getTimestamp();
    long windowEndTs = nextWindowEndTs;
    LOG.fine(String.format("Window end ts %d Watermark ts %d", windowEndTs, watermarkTs));
    while (windowEndTs <= watermarkTs) {
      long currentCount = windowManager.getEventCount(windowEndTs);
      evictionPolicy.setContext(new DefaultEvictionContext(windowEndTs, currentCount));
      if (handler.onTrigger()) {
        windowEndTs += slidingIntervalMs;
      } else {
                /*
                 * No events were found in the previous window interval.
                 * Scan through the events in the queue to find the next
                 * window intervals based on event ts.
                 */
        long ts = getNextAlignedWindowTs(windowEndTs, watermarkTs);
        LOG.fine(String.format("Next aligned window end ts %d", ts));
        if (ts == Long.MAX_VALUE) {
          LOG.fine(String.format("No events to process between %d and watermark ts %d",
              windowEndTs, watermarkTs));
          break;
        }
        windowEndTs = ts;
      }
    }
    nextWindowEndTs = windowEndTs;
  }
843131
function addWatermark(source, options, callback) {
    var error;

    // check for valid/invalid arguments
    if((arguments.length < 2)
        || (arguments.length  === 2 && !ratify.isFunction(arguments[1]))
        || (arguments.length > 2 && !ratify.isFunction(arguments[2]))) {
        throw new Error('Text-Watermark::addWatermark : Invalid arguments');
    }
    else if(arguments.length === 2 && ratify.isFunction(arguments[1])) {
        callback = arguments[1];
        options = null;
    }

    // if no image source is found
    if(!source || source == "") {
        error = new Error('Text-Watermark::addWatermark : No image source');
        return callback(error);
    }

    // check if source file exists at the specified path
    fs.lstat(source, function(err, stats) {
        if(err) {
            error = new Error('Text-Watermark::addWatermark : Image file doesn\'t exist at source ' + source);
            return callback(error);
        }
        else if(!stats.isFile()) {
            error = new Error('Text-Watermark::addWatermark : Invalid image source at ' + source);
            return callback(error);
        }
        else {
            // use default options if options aren't properly specified
            if(!options || typeof options !== 'object')
                options = defaultOptions;

            im.identify(source, function(err, imageData) {
                if(err) {
                    error = new Error('Text-Watermark::addWatermark : Error while processing image file : ' + err);
                    return callback(error);
                }

                var finalObj = _parseOptions(imageData, source, options);

                im.convert(finalObj.args, function(err, stdout) {
                    if(err) {
                        error = new Error('Text-Watermark::addWatermark : Error in applying watermark : ' + err);
                        return callback(error);
                    }
                    else {
                        console.log('Text-Watermark::addWatermark : Watermark applied. You can check the output file at : ' + finalObj.outputPath);
                        return callback(null);
                    }
                });
            });
        }
    });

    return;
}
963356
function isPctEncoded (chr) {
        if (!isPercentDigitDigit(chr, 0)) {
            return false;
        }
        var firstCharCode = parseHex2(chr, 1);
        var numBytes = utf8.numBytes(firstCharCode);
        if (numBytes === 0) {
            return false;
        }
        for (var byteNumber = 1; byteNumber < numBytes; byteNumber += 1) {
            if (!isPercentDigitDigit(chr, 3*byteNumber) || !utf8.isValidFollowingCharCode(parseHex2(chr, 3*byteNumber + 1))) {
                return false;
            }
        }
        return true;
    }
376611
function isFalse(value, message, id) {
    if (message === void 0) { message = ''; }
    if (id === void 0) { id = ''; }
    if (this.enabled && value !== false) {
        throw ValueException.unexpectedValue(assertionTypes.IS_FALSE, value, false, message, id);
    }
}
252479
def secure(self, func):
        '''
        '''
        if isinstance(func, basestring):
            return self._apply_permission(Permission(RoleNeed(func)))
        elif isinstance(func, Permission):
            return self._apply_permission(func)
        else:
            return self._apply_secure(func)
494260
function (message, signature) {
      var md = forge.md.sha1.create();
      md.update(message, 'utf8');
      try {
        return this._cert.publicKey.verify(md.digest().bytes(), forge.util.decode64(signature));
      } catch (e) {
        return false;
      }
    }
775622
public boolean isSignatureValid() {
        try {
            return ECKey.verify(Sha256Hash.hashTwice(content), signature, params.getAlertSigningKey());
        } catch (SignatureDecodeException e) {
            return false;
        }
    }
180294
def _validate(cls, message):
        
        valid = False
        if(('name' in message and 'value' in message) or
                ('id' in message and 'data' in message)):
            valid = True
        return valid
1007271
def _convert(self, image, output=None):
        """"""
        with Image.open(image) as im:
            width, height = im.size

            co = CanvasObjects()
            co.add(CanvasImg(image, 1.0, w=width, h=height))

            return WatermarkDraw(co, tempdir=self.tempdir, pagesize=(width, height)).write(output)
1217692
public function do_watermark($file, $offsetX = 0, $offsetY = 0, $opacity = 1.0)
    {
        $file = $this->alias->resolve($file);

        list($maskWidth, $maskHeight, $maskType) = getimagesize($file);

        if ($maskType === IMAGETYPE_GIF) {
            $maskImage = imagecreatefromgif($file);
        } elseif ($maskType === IMAGETYPE_JPEG) {
            $maskImage = imagecreatefromjpeg($file);
        } elseif ($maskType === IMAGETYPE_PNG) {
            $maskImage = imagecreatefrompng($file);
        } else {
            throw new PreconditionException('Installed GD does not support such images');
        }

        imagesavealpha($maskImage, true);

        $image = imagecreatetruecolor($this->_width, $this->_height);
        imagealphablending($image, false);
        imagesavealpha($image, true);
        if ($maskType !== IMAGETYPE_PNG) {
            $filedColor = imagecolorallocatealpha($image, 127, 127, 127, (1 - $opacity) * 127);
        } else {
            $filedColor = imagecolorallocate($image, 127, 127, 127);
        }

        imagelayereffect($maskImage, IMG_EFFECT_OVERLAY);
        imagefilledrectangle($maskImage, 0, 0, $maskWidth, $maskHeight, $filedColor);
        imagealphablending($this->_image, true);
        imagecopy($this->_image, $maskImage, $offsetX, $offsetY, 0, 0, $maskWidth, $maskHeight);

        return $this;
    }
134604
function hasMessageIdentifier(msgState) {
  const md5s = msgState.md5s;
  return isNotBlank(msgState.eventID) || // isNotBlank(msgState.eventSeqNo) || isNotBlank(msgState.eventSubSeqNo) ||
    (msgState.idVals && msgState.idVals.some(isNotBlank)) ||
    ((msgState.keyVals && msgState.keyVals.some(isNotBlank)) &&
      (msgState.seqNoVals && msgState.seqNoVals.some(isNotBlank))) ||
    (md5s && (isNotBlank(md5s.msg) || isNotBlank(md5s.userRec) || isNotBlank(md5s.rec) || isNotBlank(md5s.data)));
}