signal that the user has added or deleted a char from the pattern
 and data should be requeried, etc
509761
def buffer_changed
      # display the pattern on the header
      @header.text1(">>>#{@buffer}_") if @header
      @header.text_right(Dir.pwd) if @header
      @no_match = false

      if @command
        @list = @command.call(@buffer)
      else
        @list = @__list.select do |line|
          line.index @buffer
        end
      end
      sz = @list.size
      if sz == 0
        Ncurses.beep
        #return 1
        #this should make ENTER and arrow keys unusable except for BS or Esc, 
        @list = ["No entries"]
        @no_match = true
      end
      data_changed @list
      0
    end
5687
function handlePlainCharacter(element, char) {
  const prefix = element[typedPrefixKey] || '';
  element[typedPrefixKey] = prefix + char;
  element.selectItemWithTextPrefix(element[typedPrefixKey]);
  setPrefixTimeout(element);
}
630721
function onBeforeShow() {
    var trigger = self.hc_.getAnchorElement();
    var ch = self.getChar_(trigger);
    if (ch) {
      self.zoomEl_.innerHTML = self.displayChar_(ch);
      self.unicodeEl_.innerHTML = goog.i18n.uChar.toHexString(ch);
      // Clear the character name since we don't want to show old data because
      // it is retrieved asynchronously and the DOM object is re-used
      self.charNameEl_.innerHTML = '';
      self.charNameFetcher_.getName(ch, function(charName) {
        if (charName) {
          self.charNameEl_.innerHTML = charName;
        }
      });
    }
  }
147663
function (formatString, mapping) {
    var len = formatString.length;
    var i = 0;
    var startIndex = -1;
    var lastChar = null;
    var currentChar = "";
    var resultString = "";

    for (; i < len; i++) {
      currentChar = formatString.charAt(i);

      if (lastChar === null || lastChar !== currentChar) {
        // change detected
        resultString = _appendMappedString(formatString, mapping, startIndex, i, resultString);

        startIndex = i;
      }

      lastChar = currentChar;
    }

    return _appendMappedString(formatString, mapping, startIndex, i, resultString);
  }
820033
function(str, pattern)
	{
		// LATER: Check is this can be done with a regular expression
		var postfix = '';
		
		while (str.length > 0 && str.charAt(str.length - 1) == '\n')
		{
			str = str.substring(0, str.length - 1);
			postfix += pattern;
		}
		
		return str + postfix;
	}
519501
def in_string(objet, pattern):
        
        return bool(re.search(pattern, str(objet), flags=re.I)) if objet else False
409141
function _findChangedCharacters(oldValue, value) {
        if (oldValue === value) {
            return undefined;
        }
        var length = oldValue.length;
        var index = 0;

        // find the first character that changed
        var i;
        for (i = 0; i < length; i++) {
            if (value[i] !== oldValue[i]) {
                break;
            }
        }
        index += i;
        value = value.substr(i);
        length -= i;

        // find the last character that changed
        for (i = 0; i < length; i++) {
            if (value[value.length - 1 - i] !== oldValue[oldValue.length - 1 - i]) {
                break;
            }
        }
        length -= i;
        value = value.substr(0, value.length - i);

        return { from: index, to: index + length, text: value };
    }
1046883
def _clear(self):
        """"""
        self._current_output = U_EMPTY_STRING
        self._accrued_input = U_EMPTY_STRING
        self._accrued_input_without_formatting = U_EMPTY_STRING
        self._formatting_template = U_EMPTY_STRING
        self._last_match_position = 0

        # The pattern from number_format that is currently used to create
        # formatting_template.
        self._current_formatting_pattern = U_EMPTY_STRING
        # This contains anything that has been entered so far preceding the
        # national significant number, and it is formatted (e.g. with space
        # inserted). For example, this can contain IDD, country code, and/or
        # NDD, etc.
        self._prefix_before_national_number = U_EMPTY_STRING
        self._should_add_space_after_national_prefix = False
        # This contains the national prefix that has been extracted. It
        # contains only digits without formatting.
        self._extracted_national_prefix = U_EMPTY_STRING
        self._national_number = U_EMPTY_STRING
        # This indicates whether AsYouTypeFormatter is currently doing the
        # formatting.
        self._able_to_format = True
        # Set to true when users enter their own
        # formatting. AsYouTypeFormatter will do no formatting at all when
        # this is set to True.
        self._input_has_formatting = False
        # The position of a digit upon which input_digit(remember_position=True) is
        # most recently invoked, as found in accrued_input_without_formatting.
        self._position_to_remember = 0
        # The position of a digit upon which input_digit(remember_position=True) is
        # most recently invoked, as found in the original sequence of
        # characters the user entered.
        self._original_position = 0
        # This is set to true when we know the user is entering a full
        # national significant number, since we have either detected a
        # national prefix or an international dialing prefix. When this is
        # true, we will no longer use local number formatting patterns.
        self._is_complete_number = False
        self._is_expecting_country_calling_code = False
        self._possible_formats = []
245636
function emitCharsWhile(pattern) {
    pattern.lastIndex = nextchar-1;
    var match = pattern.exec(chars)[0];
    if (!match) return false;
    emitCharString(match);
    nextchar += match.length - 1;
    return true;
  }
405907
def handle_flush_error(cls, exception):
        """"""

        trace = exception.args[0]
        m = re.match(cls.MYSQL_FLUSH_ERROR_REGEX, trace)

        if not m:
            raise exception

        entity = m.group('entity')
        eid = m.group('eid')

        raise AlreadyExistsError(entity=entity, eid=eid)
935523
public void pushOut (String pattern)
    {
        Pattern pat = makePattern(pattern);
        Iterator<String> i = _imports.iterator();
        while (i.hasNext()) {
            String imp = i.next();
            if (pat.matcher(imp).matches()) {
                i.remove();
                _pushed.add(imp);
                return;
            }
        }
        _pushed.add(null);
    }
915098
def _new_output_char(self, char):
        
        self.text.config(state=tkinter.NORMAL)
        self.text.insert("end", char)
        self.text.see("end")
        self.text.config(state=tkinter.DISABLED)
426261
static void logchar(int integer, int width) {
        if (integer > ' ' && integer <= '}') {
            log("'" + (char) integer + "':" + width + " ");
        } else {
            log(integer, width);
        }
    }
916135
def defa(self, pattern):
        
        self.checkpat(pattern)
        self.A_a_user_defined.extend((pattern, "a"))
        return 1
990148
function flush_char(outs) {
    if (a_count > 0) {
      outs.writeByte(a_count);
      outs.writeBytes(accum, 0, a_count);
      a_count = 0;
    }
  }
483856
private static void handleRemainingCharIfAny(final String messagePattern, final int len,
            final StringBuilder buffer, final int escapeCounter, final int i) {
        if (i == len - 1) {
            final char curChar = messagePattern.charAt(i);
            handleLastChar(buffer, escapeCounter, curChar);
        }
    }
1333004
function conditionalExtend(user, args) {
    var extra = _.omit(args, options.updateUser.omit)
    _.map(extra, function(val, key) {
      if (!key.match(/\$/)) {
        user[key] = val
      }
    })
  }