ETag can be None if a subset of element json is using
        this container, such as the case with Routing.
421520
def etag(self, href):
        
        if self and self._etag is None:
            self._etag = LoadElement(href, only_etag=True)
        return self._etag
1103174
def _exists_with_etag(self, name, content):
        
        url = self._get_url(name)
        response = requests.head(url)
        if response.status_code == 404:
            return False
        etag = response.headers['ETAG'].split('"')[1]
        hash = self.file_hash(name, content)
        return etag.startswith(hash)
1250612
public static String notContain(String textToSearch, String substring) throws IllegalArgumentException {
		return notContain(textToSearch, substring, "[Assertion failed] - this String argument must not contain the substring [{}]", substring);
	}
1023826
public static void notFound(Router router, String regExPath, Class<? extends NotFoundResponseWriter> notFound) {

		Assert.notNull(router, "Missing router!");
		Assert.notNull(notFound, "Missing not found handler!");

		addLastHandler(router, regExPath, getNotFoundHandler(notFound));
	}
947454
def _forbidden(self, path, value):
    """"""
    if path[0] == '/':
      path = path[1:]
    for rule in reversed(self.rules):
      if isinstance(rule[1], six.string_types):
        if fnmatch(path, rule[1]):
          return not rule[0]
      elif rule[1](path, value):
        return not rule[0]
    return True
1046154
def remove_None(params: dict):
    """"""
    return {
        key: value
        for key, value in params.items()
        if value is not None
    }
985609
private static Optional<ICondition> asNotMoreThan( JsonObject json)
    {
    return
      Optional.of( json)
      .filter( j -> j.containsKey( NOT_MORE_THAN_KEY))
      .map( j -> j.getJsonObject( NOT_MORE_THAN_KEY))
      .map( a -> new AssertNotMore( a.getString( PROPERTY_KEY), a.getInt( MAX_KEY)));
    }
1001473
def get_remote_etag(storage, prefixed_path):
    
    normalized_path = safe_join(storage.location, prefixed_path).replace(
        '\\', '/')
    try:
        return storage.bucket.get_key(normalized_path).etag
    except AttributeError:
        pass
    try:
        return storage.bucket.Object(normalized_path).e_tag
    except:
        pass
    return None
50138
public static void setEtag(final HttpServletResponse response, final String etag) {
		response.setHeader(HttpHeaders.ETAG, etag);
	}
345511
function etag (entity, options) {
  if (entity == null) {
    throw new TypeError('argument entity is required')
  }

  // support fs.Stats object
  var isStats = isstats(entity)
  var weak = options && typeof options.weak === 'boolean'
    ? options.weak
    : isStats

  // validate argument
  if (!isStats && typeof entity !== 'string' && !Buffer.isBuffer(entity)) {
    throw new TypeError('argument entity must be string, Buffer, or fs.Stats')
  }

  // generate entity tag
  var tag = isStats
    ? stattag(entity)
    : entitytag(entity)

  return weak
    ? 'W/' + tag
    : tag
}
3222
function RouteRule_match(rgx, str) {
        var group, matched, data = [];
        if (Type.isString(rgx)) {
            rgx = this.toRegex(rgx);
        }
        if (Type.isObject(rgx) && Type.isRegExp(rgx.regex)) {
            if (rgx.group && rgx.group.length) {
                group = rgx.group;
                matched = core.match(rgx.regex, str).shift();
                if (Type.isArray(matched)) {
                    matched = matched.slice(1, matched.length - 2);
                    group.forEach(function (item) {
                        data.push({
                            key: item.isNamed ? item.key : false,
                            index: item.index,
                            value: matched[item.index]
                        });
                    });
                }
            } else {
                return core.match(rgx.regex, str);
            }
        } else if (Type.isRegExp(rgx)) {
            return core.match(rgx, str);
        }
        return data;
    }
432462
def should_skip_middleware(self, middleware, matching, rest) -> bool:
        
        return bool(not matching) or bool(rest)
231362
def clean_etag(self, etag):
        
        if etag:
            etag = etag.replace('"', '')
            extension = None
            for ext, mime in self.EXTENSION_MAP:
                if mime == self.type:
                    extension = ext[1:]
                    break
            if extension:
                etag += '_' + extension
            self.response.etag = etag
32932
@Override
  public MappeableContainer not(final int firstOfRange, final int lastOfRange) {
    // TODO: may need to convert to a RunContainer
    // TODO: this can be optimized for performance
    if (firstOfRange >= lastOfRange) {
      return clone(); // empty range
    }

    // determine the span of array indices to be affected
    int startIndex = BufferUtil.unsignedBinarySearch(content, 0, cardinality, (short) firstOfRange);
    if (startIndex < 0) {
      startIndex = -startIndex - 1;
    }
    int lastIndex =
        BufferUtil.unsignedBinarySearch(content, 0, cardinality, (short) (lastOfRange - 1));
    if (lastIndex < 0) {
      lastIndex = -lastIndex - 2;
    }
    final int currentValuesInRange = lastIndex - startIndex + 1;
    final int spanToBeFlipped = lastOfRange - firstOfRange;
    final int newValuesInRange = spanToBeFlipped - currentValuesInRange;
    final int cardinalityChange = newValuesInRange - currentValuesInRange;
    final int newCardinality = cardinality + cardinalityChange;

    if (newCardinality > DEFAULT_MAX_SIZE) {
      return toBitmapContainer().not(firstOfRange, lastOfRange);
    }

    final MappeableArrayContainer answer = new MappeableArrayContainer(newCardinality);
    if (!BufferUtil.isBackedBySimpleArray(answer.content)) {
      throw new RuntimeException("Should not happen. Internal bug.");
    }
    short[] sarray = answer.content.array();

    for (int i = 0; i < startIndex; ++i) {
      // copy stuff before the active area
      sarray[i] = content.get(i);
    }

    int outPos = startIndex;
    int inPos = startIndex; // item at inPos always >= valInRange

    int valInRange = firstOfRange;
    for (; valInRange < lastOfRange && inPos <= lastIndex; ++valInRange) {
      if ((short) valInRange != content.get(inPos)) {
        sarray[outPos++] = (short) valInRange;
      } else {
        ++inPos;
      }
    }

    for (; valInRange < lastOfRange; ++valInRange) {
      answer.content.put(outPos++, (short) valInRange);
    }

    // content after the active range
    for (int i = lastIndex + 1; i < cardinality; ++i) {
      answer.content.put(outPos++, content.get(i));
    }
    answer.cardinality = newCardinality;
    return answer;
  }
640416
function defineRoute (server, opts) {

    server.route({
        method: 'GET',
        path: '/bomb',
        handler: handler,
        config: {
            jsonp: 'callback',
            validate: {
                query: {
                    count: Hapi.types.Number()
                },
                payload: false
            }
        }
    });

    function handler (req) {
        var count = (req.query.count || opts.defaultBombCount);
        var res = {};
        res[opts.plural] = _.sample(opts.things, count);
        req.reply(res);
    }

}
96271
function notfoundUnit (server) {
  var regexes = [];
  var callbacks = [];

  function notfound (paths, literalCall) {
    regexes.push(RegExp(paths));
    callbacks.push(literalCall);
  }

  server.notfound = notfound;

  return function notfoundLayer (req, res) {
    res.statusCode = 404;
    var matched = null;
    var cbindex = -1;
    for (var i = 0; i < regexes.length; i++) {
      matched = req.path.match (regexes[i]);
      if (matched !== null) { cbindex = i; break; }
    }
    if (cbindex >= 0) {
      catchpath(req, res, matched, callbacks[cbindex], server.templateReader);
    } else {
      res.end('Not Found\n');
    }
  };
}
677713
function (sep) {
            var nonEncodedSep = [];
            for (var i = 0, len = sep.length; i < len; i++) {
                if (sep[i] == encodeURIComponent(sep[i])) {
                    nonEncodedSep.push(sep[i]);
                }
            }
            return nonEncodedSep;
        }