Keep items that match the regex

 Usage (block, during initialization):
     Smoke.yql(:ruby) do
       ...
       emit do
         keep(:title, /tuesday/i)
       end
     end
 Keep must be used inside an `emit` block.
189286
def keep(key, matcher)
      @items.reject! {|i| (i[key] =~ matcher) ? false : true }
    end
471993
function reRunBlock(block, index, callback){
  growing:
  for(var i=index; i<block.length; i++){ //iterate over the block [body, header, etck] *
    var code=block[i].substr(0,2);//                                            |      |
    if (code=== ">>") {//The only tag  by deffault                         |    |      |
      printBrand(block[i]);//                                              |    |      |
    /*  if(block[i].substr(2)==="default"){                                |    |      |
        if(callback) callback();// // fixes the bug of last element        |    |      |
        else recallback();//                                               |    v      |
      }//                                                                  |           |
   */ //                                                                   v           |
    }//                                                                                |
    for(var ii=0; ii<taggies.length;ii++){//                                           |
        //match user taggies and control if there are some seeds  so executes... *     |
        if(taggies[ii].code === code){//                                         |     |
          if (code[0]==="x") {//user lib needs all control-->callback-mode       |     |
            interf=true;//                                                       |     |
            interfPath="../"+taggies[ii].path+"/index.js";//                     |     |
            indexb=i+1;//                                                        |     |
            scionBlock=block;//                                                  |     |
            scionName= block[i];//                                               |     |
            break growing;//  BREAK THE TWO LOOPS                                |     |
          }//if there are no seeds then, executes next                    |      |     |
           var audreySeed= require("../"+taggies[ii].path+"/index.js");// |      |     |
           var seed= audreySeed();//                                      |      |     |
           var callbackname=block[i];//                                   |      |     |
           seed.grow(callbackname, terminal);//                           V      |     |
        }//                                                                      |     |
    }//                                                                          |     |
   //if it's the last element, callback                                          |     |
     if(i===block.length-1){ //                                    |             |     |
              if(callback) callback();//                           |             |     |
              else recallback();//if it's other                    v             |     |
        }//                                                                      v     |
  }//                                                                                  v
  if(interf){//if the element was a seed then executes interface
    interf=undefined;
    recallback= callback;
    runInterf(block);
  }

}
686143
def _is_in_keep_going(self, x, y):
        """"""
        x1, y1, x2, y2 = self._keep_going
        return self.won == 1 and x1 <= x < x2 and y1 <= y < y2
1333772
function emitLine(line, isEnd) {
  if (this.filters.every(function(fn) { return fn(line) }))
    emit.call(this, 'data', line, !!isEnd);
}
918199
def forever(self, key, value):
        
        self._store.forever(self.tagged_item_key(key), value)
891530
def handle_block(self, match, block_start=None):
        
        # we have to handle comments inside blocks because you could do this:
        # {% blk foo %}asdf {# {% endblk %} #} {%endblk%}
        # they still end up in the data/raw_data of the block itself, but we
        # have to know to ignore stuff until the end comment marker!
        found = BlockTag(**match.groupdict())
        # the full block started at the given match start, which may include
        # prefixed whitespace! we'll strip it later
        if block_start is None:
            block_start = match.start()

        self._block_contents = ''

        # you can have as many comments in your block as you'd like!
        while True:
            match = self._expect_match(
                '"{}"'.format(found.end_block_type_name),
                found.end_pat(), COMMENT_START_PATTERN, RAW_START_PATTERN,
                regex('''(?P<quote>(['"]))''')
            )
            groups = match.groupdict()
            if groups.get('endblock') is not None:
                break

            self.advance(match.end())

            if groups.get('comment_start') is not None:
                self.expect_comment_end()
            elif groups.get('raw_start') is not None:
                self.expect_raw_end()
            elif groups.get('quote') is not None:
                self.rewind()
                match = self._expect_match('any string', STRING_PATTERN)
                self.advance(match.end())
            else:
                raise dbt.exceptions.InternalException(
                    'unhandled regex in handle_block, no match: {}'
                    .format(groups)
                )

        # we want to advance to just the end tag at first, to extract the
        # contents
        self.advance(match.start())
        found.contents = self._block_contents
        self._block_contents = None
        # now advance to the end
        self.advance(match.end())
        found.full_block = self.data[block_start:self.pos]
        return found
546823
def _match_and_pop(self, regex_pattern):
        
        results = []
        self.lock.acquire()
        for name in self.event_dict.keys():
            if re.match(regex_pattern, name):
                q = self.event_dict[name]
                if q:
                    try:
                        results.append(q.get(False))
                    except:
                        pass
        self.lock.release()
        return results
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;
  }
857841
function hasBlock(regExp, state) {
  const { focusText } = state;
  const focusedText = focusText.text;
  return regExp.test(focusedText);
}
614996
function matches(regex, str) {
    var ret = [];
    var match = regex.exec(str);
    while (match !== null) {
        ret.push({
            full: match[0],
            inner: match[1]
        });
        match = regex.exec(str);
    }
    return ret;
}
1102277
def after_hash(node)
      builder = DefinitionBuilder::RubyHash.new(
        node,
        self,
        :values => value_stack.pop
      )

      push_value(builder.build)
    end
725548
protected function blockQuoteContinue($Line, array $Block)
    {
        if (!$this->config('markup.quote.keepSigns'))
        {
            return parent::blockQuote($Line);
        }

        if (mb_ereg('^>([ ]?.*)', $Line['text'], $matches))
        {
            if (isset($Block['interrupted']))
            {
                $Block['element']['text'] []= '';

                unset($Block['interrupted']);
            }

            $matches = str_replace(">", "&gt;", $matches[1]);
            $Block['element']['text'][] = "&gt;{$matches}";

            return $Block;
        }
    }
1048999
def keep(self, diffTo, diffFrom):
        
        diff = self.toObj.diff(diffTo, diffFrom)
        self.butterStore.keep(diff)
691565
def around *matchers, &proc
      proc || raise(ArgumentError, 'block is missing')
      matchers.flatten!
      matchers = [:*] if matchers.empty?
      return if around?.find {|x| x[0] == matchers && x[1].source_location == proc.source_location}
      around?.push([matchers, proc])
    end
1362387
public static Set<String> retainMatchingKeys(Counter<String> counter, List<Pattern> matchPatterns) {
    Set<String> removed = new HashSet<String>();
    for (String key : counter.keySet()) {
      boolean matched = false;
      for (Pattern pattern : matchPatterns) {
        if (pattern.matcher(key).matches()) {
          matched = true;
          break;
        }
      }
      if (!matched) {
        removed.add(key);
      }
    }
    for (String key : removed) {
      counter.remove(key);
    }
    return removed;
  }
1219690
def _keep_this(self, name):
        """"""
        for keep_name in self.keep:
            if name == keep_name:
                return True
        return False
1095770
def keepOriginalText(s,startLoc,t):
    """"""
    try:
        endloc = getTokensEndLoc()
    except ParseException:
        raise ParseFatalException("incorrect usage of keepOriginalText - may only be called as a parse action")
    del t[:]
    t += ParseResults(s[startLoc:endloc])
    return t