A verb with a predicate function
545460
def _if(cls, verb):
        
        pred = verb.predicate
        data = verb.data
        groups = set(_get_groups(verb))

        # force predicate
        if isinstance(pred, str):
            if not pred.endswith('_dtype'):
                pred = '{}_dtype'.format(pred)
            pred = getattr(pdtypes, pred)
        elif pdtypes.is_bool_dtype(np.array(pred)):
            # Turn boolean array into a predicate function
            it = iter(pred)

            def pred(col):
                return next(it)

        return [col for col in data
                if pred(data[col]) and col not in groups]
230147
function(rules, verb, group, resource) {
      var resources = rules[group];
      if (!resources) {
        return false;
      }
      var verbs = resources[resource];
      if (!verbs) {
        return false;
      }
      return _.includes(verbs, verb) || _.includes(verbs, '*');
    }
680515
@Nullable
  private Pattern pronomPattern(AnalyzedTokenReadings aToken) {
    if (matchPostagRegexp(aToken,VERB_1S) && matchPostagRegexp(aToken,VERB_3S))
      return PRONOM_FEBLE_13S;
    if (matchPostagRegexp(aToken,VERB_2S) && matchPostagRegexp(aToken,VERB_3S))
      return PRONOM_FEBLE_23S;
    else if (matchPostagRegexp(aToken,VERB_1S) )
      return PRONOM_FEBLE_1S;
    else if (matchPostagRegexp(aToken,VERB_2S) )
      return PRONOM_FEBLE_2S;
    else if (matchPostagRegexp(aToken,VERB_3S) )
      return PRONOM_FEBLE_3S;
    else if (matchPostagRegexp(aToken,VERB_1P) )
      return PRONOM_FEBLE_1P;
    else if (matchPostagRegexp(aToken,VERB_2P) )
      return PRONOM_FEBLE_2P;
    else if (matchPostagRegexp(aToken,VERB_3P) )
      return PRONOM_FEBLE_3P;
    else
      return null;
  }
1149719
def split_predicate(ex: Extraction) -> Extraction:
    
    rel_toks = ex.toks[char_to_word_index(ex.rel.span[0], ex.sent) \
                       : char_to_word_index(ex.rel.span[1], ex.sent) + 1]
    if not rel_toks:
        return ex

    verb_inds = [tok_ind for (tok_ind, tok)
                 in enumerate(rel_toks)
                 if tok.tag_.startswith('VB')]

    last_verb_ind = verb_inds[-1] if verb_inds \
                    else (len(rel_toks) - 1)

    rel_parts = [element_from_span([rel_toks[last_verb_ind]],
                                   'V')]

    before_verb = rel_toks[ : last_verb_ind]
    after_verb = rel_toks[last_verb_ind + 1 : ]

    if before_verb:
        rel_parts.append(element_from_span(before_verb, "BV"))

    if after_verb:
        rel_parts.append(element_from_span(after_verb, "AV"))

    return Extraction(ex.sent, ex.toks, ex.arg1, rel_parts, ex.args2, ex.confidence)
760409
@Nonnull
  public static <T> Predicate<T> predicate(@Nonnull final Function<T, Boolean> predicate) {
    return predicate::apply;
  }
1245722
private boolean isThereReflexivePronoun(
      final AnalyzedTokenReadings[] tokens, int i) {
    Pattern pPronomBuscat = null;
    // 1) es queixa, se li queixa, se li'n queixa
    if (matchPostagRegexp(tokens[i], VERB_INDSUBJ)) {
      pPronomBuscat = pronomPattern(tokens[i]);
      if (pPronomBuscat != null) {
        int j = 1;
        boolean keepCounting = true;
        while (i - j > 0 && j < 4 && keepCounting) {
          if (matchPostagRegexp(tokens[i - j], pPronomBuscat)
              && matchRegexp(tokens[i -j].getToken(), REFLEXIU_ANTEPOSAT))
            return true;
          keepCounting = matchPostagRegexp(tokens[i - j],
              PRONOM_FEBLE);
          j++;
        }
      }
    }
    // 2) queixa't, queixeu-vos-hi
    if (matchPostagRegexp(tokens[i], VERB_IMP)) {
      pPronomBuscat = pronomPattern(tokens[i]);
      if (pPronomBuscat != null) {
        if (i+1<tokens.length
            && matchPostagRegexp(tokens[i + 1], pPronomBuscat)
            && matchRegexp(tokens[i + 1].getToken(), REFLEXIU_POSPOSAT))
          return true; 
      }
    }
    // 3) s'ha queixat, se li ha queixat, se li n'ha queixat.
    if (matchPostagRegexp(tokens[i], VERB_PARTICIPI)) {
      if (tokens[i - 1].hasLemma("haver")) {
        if (matchPostagRegexp(tokens[i - 1], VERB_INDSUBJ)) {
          pPronomBuscat = pronomPattern(tokens[i - 1]);
          if (pPronomBuscat != null) {
            int j = 2;
            boolean keepCounting = true;
            while (i - j > 0 && j < 5 && keepCounting) {
              if (matchPostagRegexp(tokens[i - j], pPronomBuscat)
                  && matchRegexp(tokens[i - j].getToken(), REFLEXIU_ANTEPOSAT))
                return true;
              keepCounting = matchPostagRegexp(tokens[i - j], PRONOM_FEBLE);
              j++;
            }
          }
        }
        // es podria haver endut
        else if (matchPostagRegexp(tokens[i - 1], VERB_INF)
            && matchPostagRegexp(tokens[i - 2], VERB_INDSUBJ)) {
          pPronomBuscat = pronomPattern(tokens[i - 2]);
          if (pPronomBuscat != null) {
            int j = 3;
            boolean keepCounting = true;
            while (i - j > 0 && j < 5 && keepCounting) {
              if (matchPostagRegexp(tokens[i - j], pPronomBuscat)
                  && matchRegexp(tokens[i - j].getToken(), REFLEXIU_ANTEPOSAT))
                return true;
              keepCounting = matchPostagRegexp(tokens[i - j], PRONOM_FEBLE);
              j++;
            }
          }
        }
      }
      // *havent queixat, *haver queixat
//      else if (!(matchLemmaRegexp(tokens[i - 1], VERB_HAVER) && matchPostagRegexp(
//          tokens[i - 1], VERB_INFGER)))
//        return true;
    }
    // 4) em vaig queixar, se li va queixar, se li'n va queixar, vas
    // queixar-te'n,
    // em puc queixar, ens en podem queixar, podeu queixar-vos,
    // es va queixant, va queixant-se, comences queixant-te
    // 5) no t'has de queixar, no has de queixar-te, pareu de queixar-vos,
    // comenceu a queixar-vos
    // corre a queixar-se, corre a queixar-te, vés a queixar-te
    // no hauria pogut burlar-me
    // 6) no podeu deixar de queixar-vos, no us podeu deixar de queixar
    // en teniu prou amb queixar-vos, comenceu lentament a queixar-vos
    // 7) no es va poder emportar, va decidir suïcidar-se,
    // 8) Queixar-se, queixant-vos, podent abstenir-se
    if (matchPostagRegexp(tokens[i], VERB_INFGER)) {
      int k = 1;
      boolean keepCounting = true;
      boolean foundVerb = false;
      while (i - k > 0 && keepCounting && !foundVerb) {
        foundVerb = matchPostagRegexp(tokens[i - k], VERB_INDSUBJIMP);
        keepCounting = matchPostagRegexp(tokens[i - k],
            PREP_VERB_PRONOM);
        if (matchPostagRegexp(tokens[i-k],VERB_INDSUBJ)
            && matchPostagRegexp(tokens[i-k+1],VERB_INFGER))
          keepCounting=false;
        if (matchPostagRegexp(tokens[i - k], VERB_INFGER) //pertanyen a grups verbals diferents
            && matchPostagRegexp(tokens[i - k + 1], PRONOM_FEBLE)
            && !matchRegexp(tokens[i - k + 1].getToken(), PRONOMFEBLE_POSPOSAT)) {
          keepCounting=false;
        }
        k++;
      }
      if (foundVerb) {
        k--;
        pPronomBuscat = pronomPattern(tokens[i - k]);
        if (pPronomBuscat != null) {
          if (i+1< tokens.length
              && matchPostagRegexp(tokens[i + 1], pPronomBuscat)
              && matchRegexp(tokens[i + 1].getToken(), REFLEXIU_POSPOSAT))
            return true;
          int j = 1;
          keepCounting = true;
          while (i - j > 0 && keepCounting) {
            if (j==1 && matchPostagRegexp(tokens[i - j], pPronomBuscat))
              return true;
            if (j>1 && matchPostagRegexp(tokens[i - j], pPronomBuscat)
                && !(matchRegexp(tokens[i - j].getToken(), REFLEXIU_POSPOSAT) && j>k))
              return true;
            keepCounting = matchPostagRegexp(tokens[i - j], PREP_VERB_PRONOM)
                && !(j>k-1 && matchPostagRegexp(tokens[i - j], VERB_PARTICIPI))
                && !matchPostagRegexp(tokens[i - j], TRENCA_COMPTE2);
            if (tokens[i-j].getToken().equalsIgnoreCase("per")
                && tokens[i-j+1].getToken().equalsIgnoreCase("a")) {
              keepCounting=false;
            }
            if (matchPostagRegexp(tokens[i - j], VERB_INFGER) //pertanyen a grups verbals diferents
                && matchPostagRegexp(tokens[i - j + 1], PRONOM_FEBLE)
                && !matchRegexp(tokens[i - j + 1].getToken(), PRONOMFEBLE_POSPOSAT)) {
              keepCounting=false;
            }
            j++;
          }
        }
      } else {
        if (i+1<tokens.length
            && matchPostagRegexp(tokens[i + 1], PRONOM_REFLEXIU)
            && matchRegexp(tokens[i + 1].getToken(), REFLEXIU_POSPOSAT))
          return true;
        int j = 1;
        keepCounting = true;
        while (i - j > 0 && keepCounting) {
          if (matchPostagRegexp(tokens[i - j], PRONOM_REFLEXIU))
            return true;
          keepCounting = matchPostagRegexp(tokens[i - j],
              PREP_VERB_PRONOM);
          if (tokens[i-j].getToken().equalsIgnoreCase("per")
              && tokens[i-j+1].getToken().equalsIgnoreCase("a")) {
            keepCounting=false;
          }
          if (matchPostagRegexp(tokens[i - j], VERB_INFGER) //pertanyen a grups verbals diferents
              && matchPostagRegexp(tokens[i - j + 1], PRONOM_FEBLE)
              && !matchRegexp(tokens[i - j + 1].getToken(), PRONOMFEBLE_POSPOSAT)) {
            keepCounting=false;
          }
          j++;
        }
      }
    }
    return false;
  }
13277
def predicate
      header.reduce(Function::Proposition::Tautology.instance) do |predicate, attribute|
        predicate.and(attribute.eq(attribute.call(self)))
      end
    end
924526
function makeHelper(obj, verb) {
  obj[verb] = function helper(url, options, f) {
    // ('url')
    if(_.isString(url)){
      // ('url', f)
      if(_.isFunction(options)){
        f = options;
      }

      if(!_.isObject(options)){
        options = {};
      }

      // ('url', {object})
      options.url = url;
    }

    if(_.isObject(url)){
      if(_.isFunction(options)){
        f = options;
      }
      options = url;
    }

    options.method = verb.toUpperCase();
    return obj(options, f);
  };
}
709819
function maybeModifier(predicate) {
        return function () {
          if (!check.defined(arguments[0]) || check.nulled(arguments[0])) {
            return true;
          }
          return predicate.apply(null, arguments);
        };
      }
319917
def __get_verb(counts):
    

    cursor = CONN.cursor()
    check_query = "select verb_id from surverbs"

    cursor.execute(check_query)
    check_result = cursor.fetchall()

    id_list = []
    for row in check_result:
        id_list.append(row[0])

    rand = random.randint(1, counts['max_verb'])

    while rand not in id_list:
        rand = random.randint(1, counts['max_verb'])

    query = "select * from surverbs where verb_id = {0}".format(rand)
    cursor.execute(query)
    result = cursor.fetchone()
    # cursor.close()

    return result[1]
111540
def verb(**kwargs):
    """"""
    e_tree, e_oaipmh = envelope(**kwargs)
    e_element = SubElement(e_oaipmh, etree.QName(NS_OAIPMH, kwargs['verb']))
    return e_tree, e_element
270280
function safe(pred, x) {
  if(!isPredOrFunc(pred)) {
    throw new TypeError('safe: Pred or predicate function required for first argument')
  }

  return predOrFunc(pred, x)
    ? Just(x)
    : Nothing()
}
776758
public function byVerb(Verb $verb): self
    {
        $this->filter['verb'] = $verb->getId()->getValue();

        return $this;
    }
347191
def lexeme(self, verb, parse=True):
        
        a = []
        b = self.lemma(verb, parse=parse)
        if b in self:
            a = [x for x in self[b] if x != ""]
        elif parse is True: # rule-based
            a = self.find_lexeme(b)
        u = []; [u.append(x) for x in a if x not in u]
        return u
462083
function filter(pred, m) {
  if(!isPredOrFunc(pred)) {
    throw new TypeError('filter: Pred or predicate function required for first argument')
  }

  const fn =
    x => predOrFunc(pred, x)

  if(m && isFunction(m.filter)) {
    return m.filter(fn)
  }

  if(m && isObject(m)) {
    return object.filter(fn, m)
  }

  throw new TypeError('filter: Filterable or Object required for second argument')
}
798239
def function(self, function_name, word):
        
        word = self._parse_filter_word(word)

        self._add_filter(
            *self._prepare_function(function_name, self._attribute, word,
                                    self._negation))
        return self
668151
def popwhile(predicate, iterable):
    
    while iterable:
        item = iterable.pop()
        if predicate(item):
            yield item
        else:
            break