simple endsWith function. Use with care
503682
function endsWith(str,test){
  var lastIndex = str.lastIndexOf(test);
  return (lastIndex != -1) && (lastIndex + test.length == str.length);
}
750784
public static function endsWith($string, $end)
    {
        $l = strlen($end);
        if ($l == 0) {
            return true;
        }
        return substr($string, - $l) === $end;
    }
319177
function endshere(subword) {
		var nextindex = charindex + 1;
		return input.length === nextindex ||
			!input[nextindex].match(METHODNAME);
	}
1163604
def ends_with_path_separator(self, file_path):
        """"""
        if is_int_type(file_path):
            return False
        file_path = make_string_path(file_path)
        return (file_path and
                file_path not in (self.path_separator,
                                  self.alternative_path_separator) and
                (file_path.endswith(self._path_separator(file_path)) or
                 self.alternative_path_separator is not None and
                 file_path.endswith(
                     self._alternative_path_separator(file_path))))
664590
def cell_ends_with_function_or_class(lines):
    """"""
    non_quoted_lines = []
    parser = StringParser('python')
    for line in lines:
        if not parser.is_quoted():
            non_quoted_lines.append(line)
        parser.read_line(line)

    # find the first line, starting from the bottom, that is not indented
    lines = non_quoted_lines[::-1]
    for i, line in enumerate(lines):
        if not line.strip():
            # two blank lines? we won't need to insert more blank lines below this cell
            if i > 0 and not lines[i - 1].strip():
                return False
            continue
        if line.startswith('#') or line.startswith(' '):
            continue
        if line.startswith('def ') or line.startswith('class '):
            return True
        return False

    return False
198110
def block_end?(line)
      return nil if !line

      if line =~ /^\s*?end\s*?(!.*?)?$/i                 ||
          line =~ /^\s*?end\s+module(\s+\w+)?\s*?(!.*?)?$/i       ||
          line =~ /^\s*?end\s+program(\s+\w+)?\s*?(!.*?)?$/i      ||
          line =~ /^\s*?end\s+block\s+data(\s+\w+)?\s*?(!.*?)?$/i  ||
          line =~ /^\s*?end\s+subroutine(\s+\w+)?\s*?(!.*?)?$/i   ||
          line =~ /^\s*?end\s+function(\s+\w+)?\s*?(!.*?)?$/i
        return true
      end

      return nil
    end
883297
def __end_of_list(self, ast_token):
        """"""
        self.list_level -= 1
        if self.list_level == 0:
            if self.list_entry is not None:
                self.final_ast_tokens.append(self.list_entry)
                self.list_entry = None
            self.final_ast_tokens.append(ast_token)
617927
function simpleExtend( from, to ) {
		for ( var k in from) {
			if (to[k] == undefined) {
				to[k] = from[k];
			}
		}
		return to;
	}
925450
function strEndWith(str,substr){
    return str.lastIndexOf(substr) + substr.length === str.length;
}
226518
def ends_with(self, other):
        ''''''
        @Parser
        def ends_with_parser(text, index):
            res = self(text, index)
            if not res.status:
                return res
            end = other(text, res.index)
            if end.status:
                return res
            else:
                return Value.failure(end.index, 'ends with {}'.format(end.expected))
        return ends_with_parser
725321
function NodeWithToken(str, start, end) {
        this.name = str;
        this.start = start;
        this.end = end;
}
1196286
function findEnd(node) {
	if (!node) {
		return undefined;
	}
	var {left, right, el} = node;
	findEnd(left);
	findEnd(right);
	node.high = Math.max(getHigh(left), getHigh(right), el.end);
	return node;
}
436513
public void endsWith(String string) {
    checkNotNull(string);
    if (actual() == null) {
      failWithActual("expected a string that ends with", string);
    } else if (!actual().endsWith(string)) {
      failWithActual("expected to end with", string);
    }
  }
655419
public static boolean endsWith(CharSequence s, String end) {
    return (s.length() >= end.length() && s.subSequence(s.length() - end.length(), s.length()).equals(end));
  }
415352
def _handle_end_way(self):
        
        self._result.append(Way(result=self._result, **self._curr))
        self._curr = {}
194161
def endswith(self, pat):
        
        check_type(pat, str)

        return _series_bool_result(self, weld_str_endswith, pat=pat)
652100
public static boolean endsWith(CharSequence s, char c) {
        int len = s.length();
        return len > 0 && s.charAt(len - 1) == c;
    }