check will retrieve latest info
of the entity then compare a field to
a given value
ex: $call->check('state', 'active') => TRUE

@param k: key to check
@param v: value to compare against
429366
public function check($k,$v)
    {
      $this->get($this->id);

      if ($this->$k == $v)
      return TRUE;

      return FALSE;
    }
390992
boolean checkUpdate(final INodeReadTrx paramNewRtx, final INodeReadTrx paramOldRtx) throws TTIOException {
        assert paramNewRtx != null;
        assert paramOldRtx != null;
        boolean updated = false;
        final long newKey = paramNewRtx.getNode().getDataKey();
        boolean movedNewRtx = paramNewRtx.moveTo(((ITreeStructData)paramNewRtx.getNode()).getRightSiblingKey());
        final long oldKey = paramOldRtx.getNode().getDataKey();
        boolean movedOldRtx = paramOldRtx.moveTo(((ITreeStructData)paramOldRtx.getNode()).getRightSiblingKey());
        if (movedNewRtx && movedOldRtx && checkNodes(paramNewRtx, paramOldRtx)) {
            updated = true;
        } else if (!movedNewRtx && !movedOldRtx) {
            movedNewRtx = paramNewRtx.moveTo(paramNewRtx.getNode().getParentKey());
            movedOldRtx = paramOldRtx.moveTo(paramOldRtx.getNode().getParentKey());

            if (movedNewRtx && movedOldRtx && checkNodes(paramNewRtx, paramOldRtx)) {
                updated = true;
            }
        }
        paramNewRtx.moveTo(newKey);
        paramOldRtx.moveTo(oldKey);
        if (!updated) {
            updated = paramNewRtx.getNode().getDataKey() == paramOldRtx.getNode().getDataKey();
        }
        return updated;
    }
1360384
def callback(val, schema, name = None): # pylint: disable-msg=W0613
    
    if name is None:
        name = schema

    if not _callbacks.has_key(name):
        return False

    return _callbacks[name](val)
1168155
public static void checkVersion(DB db, StoreVersion newversion, ObjectMapper mapper) throws
      IOException {
    byte[] bytes = db.get(StoreVersion.KEY);
    if (bytes == null) {
      storeVersion(db, newversion, mapper);
    } else {
      StoreVersion version = mapper.readValue(bytes, StoreVersion.class);
      if (version.major != newversion.major) {
        throw new IOException("cannot read state DB with version " + version + ", incompatible " +
            "with current version " + newversion);
      }
      storeVersion(db, newversion, mapper);
    }
  }
645609
@SuppressWarnings("unchecked")
    public final BooleanExpression contains(Expression<K> key, Expression<V> value) {
        return get(key).eq((Expression) value);
    }
988509
def set_state(k, v)
        if @state[k] != v # Only set state if it has actually changed
          @state[k] = v

          if !self.methods.include? k
            self.define_singleton_method(k.to_sym) do
              return State.new(@state[k])
            end
          end

          notify_listeners(k)
        end
      end
1161704
@Override
    public V get(K key) {
        if(key == null) {
            return null;
        }
        
        byte[] bytes = _store.get(_keySerializer.serialize(key));
        return bytes == null ? null : _valSerializer.deserialize(bytes);
    }
1365421
@Override
    public boolean getValue() throws OntopConnectionException {
        if (hasRead)
            throw new IllegalStateException("getValue() can only called once!");
        hasRead = true;
        try {
            return set.next();
        } catch (SQLException e) {
            throw new OntopConnectionException(e);
        }
    }
830772
function(json, keyVal) {
            for (var k in keyVal) {
                if (keyVal.hasOwnProperty(k))
                    if (!jsonQ.identical(keyVal[k], json[k])) return false;
            }
            return true;
        }
368988
function _watch(vm, vars, update) {
    var watchKeys = []
    function _handler (kp) {
        if (watchKeys.some(function(key) {
            if (_relative(kp, key)) {
                return true
            }
        })) update.apply(null, arguments)
    }

    if (vars && vars.length) {
        vars.forEach(function (k) {
            if (~keywords.indexOf(k)) return
            while (k) {
                if (!~watchKeys.indexOf(k)) watchKeys.push(k)
                k = util.digest(k)
            }
        })
        if (!watchKeys.length) return noop
        return vm.$watch(_handler)
    }
    return noop
}
545189
public static function check(?string $v, ?array $aux = null) : bool
    {
        if (self::formatNumber($v) !== null) {
            return true;
        }

        return false;
    }
1329222
function(kb) {
			if (!kb.keys) { return false; }
			if (kb.keys.length !== this.keys.length) { return false; }
			for (var i=0; i<kb.keys.length; i++) {
				if (!kb.keys[i].equals(this.keys[i])) { return false; }
			}
			return true;
		}
534337
protected function checkValue($value, $key = null)
    {
        if ($value != null) {
            if ($key !== null) {
                return isset($value[$key]) ? $value[$key] : null;
            }

            return $value;
        }
    }
788682
def check(call_fct):
        
        # wrap the method
        @wraps(call_fct)
        def checked_call(self, *args, **kwargs):
            self.set_options_values(kwargs, parse=False, strict=True)
            options_values = self.get_options_values(hidden=True)
            return call_fct(self, *args, **options_values)
        # add a flag on the new method to indicate that it is 'checked'
        checked_call._checked = True
        checked_call._no_check = call_fct
        return checked_call
696028
private boolean checkUpdateRequired(final ConnectionResource _con)
        throws SQLException
    {
        final SQLSelect select = new SQLSelect();
        for (final AbstractColumnWithValue<?> colValue : getColumnWithValues()) {
            select.column(colValue.getColumnName());
        }
        select.from(getTableName());
        select.addPart(SQLPart.WHERE).addColumnPart(null, "ID")
                        .addPart(SQLPart.EQUAL).addValuePart(getIds()[0]);

        final Statement stmt = _con.createStatement();
        final ResultSet rs = stmt.executeQuery(select.getSQL());
        final ArrayListHandler handler = new ArrayListHandler(Context.getDbType().getRowProcessor());
        final List<Object[]> rows = handler.handle(rs);
        rs.close();
        stmt.close();
        if (rows.size() == 1) {
            final Object[] values = rows.get(0);
            int idx = 0;
            final Iterator<AbstractColumnWithValue<?>> colIter = getColumnWithValues().iterator();
            while (colIter.hasNext()) {
                final AbstractColumnWithValue<?> colValue = colIter.next();
                final Object dbValue = values[idx];
                final Object newValue = colValue.getValue();
                if (dbValue instanceof Long) {
                    if (newValue instanceof Long) {
                        if (dbValue.equals(newValue)) {
                            colIter.remove();
                        }
                    } else if (newValue instanceof Integer) {
                        if (dbValue.equals(new Long((Integer) newValue))) {
                            colIter.remove();
                        }
                    }
                } else if (dbValue instanceof BigDecimal) {
                    if (newValue instanceof BigDecimal) {
                        if (((BigDecimal) dbValue).compareTo((BigDecimal) newValue) == 0) {
                            colIter.remove();
                        }
                    } else if (newValue instanceof Long) {
                        if (((BigDecimal) dbValue).compareTo(BigDecimal.valueOf((Long) newValue)) == 0) {
                            colIter.remove();
                        }
                    } else if (newValue instanceof Integer) {
                        if (((BigDecimal) dbValue).compareTo(BigDecimal.valueOf(new Long((Integer) newValue))) == 0) {
                            colIter.remove();
                        }
                    }
                } else if (dbValue instanceof Timestamp) {
                    if (newValue instanceof Timestamp) {
                        if (((Timestamp) dbValue).equals((Timestamp) newValue)) {
                            colIter.remove();
                        }
                    }
                } else if (dbValue instanceof Boolean) {
                    if (newValue instanceof Boolean) {
                        if (((Boolean) dbValue).equals(newValue)) {
                            colIter.remove();
                        }
                    }
                } else if (dbValue instanceof String) {
                    if (newValue instanceof String) {
                        if (((String) dbValue).trim().equals(((String) newValue).trim())) {
                            colIter.remove();
                        }
                    }
                }
                idx++;
            }
        }
        return !getColumnWithValues().isEmpty();
    }
928341
public function virtual($key, $val) {
		$this->vFields[$key]=$val;
		if (!empty($this->whitelist)) {
			$this->whitelist[] = $key;
			$this->whitelist = array_unique($this->whitelist);
		}
	}
989990
@Override
    public V get(Object key) {
        if (key == null) {
            throw new NullPointerException();
        }
        
        CachedValue<K, V> entry = map.get(key);
        if (entry == null) {
            return null;
        }
        if (isValueExpired(entry)) {
            if (map.remove(key, entry)) {
                onValueRemove(entry);
                return null;
            }
            return get(key);
        }
        return readValue(entry);
    }