Easy null-safe conversion of the typed key.
763688
public static com.google.appengine.api.datastore.Key raw( Key<?> typed ) {
        if ( typed == null ) {
            return null;
        } else {
            return typed.getRaw();
        }
    }
1256494
static <K,V> K keyOrNull(TreeMapEntry<K,V> e) {
        return (e == null) ? null : e.key;
    }
828401
def [](key)
      key = CF::String.from_string(key) if key.is_a?(::String)
      self.class.check_cftype(key)
      raw = CF.CFDictionaryGetValue(self, key)
      raw.null? ? nil : self.class.typecast(raw).retain.release_on_gc
    end
654583
function simpleKeys (original) {
        return Object.keys(original).reduce(function (obj, key) {
          obj[key] = typeof original[key] === 'object' ? '{ ... }' : original[key];
          return obj;
        }, {});
      }
1324333
public static RSAKeyString keyGen(int keySize) {
        try {
            RSAKey keys = RSA.keyGen(keySize);
            return new RSAKeyString(
                    Base64Util.encode2String(keys.getPublicKey().getEncoded()),
                    Base64Util.encode2String(keys.getPrivateKey().getEncoded())
            );
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
36406
private static void encodeKey(ByteBuf buf, byte[] key) {
        if (key == null || key.length == 0) {
            return;
        }

        buf.writeBytes(key);
    }
882233
public Query rowKey(String key) {
    Preconditions.checkNotNull(key, "Key can't be null.");
    return rowKey(ByteString.copyFromUtf8(key));
  }
581486
def convert(self, key, value):
        """"""
        if key not in self._dtypes:
            self.read_types()
            if key not in self._dtypes:
                name = utils.name(value)
                serializer = utils.serializer(name)
                deserializer = utils.deserializer(name)
                self._dtypes[key] = (name, serializer, deserializer)
                with self.db:
                    self.db.execute("replace into value_types (key, value_type) values (?, ?)", (key, name))
        return self._dtypes[key][1](value)
63950
private V removeFromDataIndexOfKey(int dataIndexOfKey) {
    int dataSize = this.size << 1;
    if (dataIndexOfKey < 0 || dataIndexOfKey >= dataSize) {
      return null;
    }
    V result = valueAtDataIndex(dataIndexOfKey + 1);
    Object[] data = this.data;
    int moved = dataSize - dataIndexOfKey - 2;
    if (moved != 0) {
      System.arraycopy(data, dataIndexOfKey + 2, data, dataIndexOfKey, moved);
    }
    this.size--;
    setData(dataSize - 2, null, null);
    return result;
  }
162818
protected Key getKeyByType(KeyType type) {
		switch (type) {
		case PrivateKey:
			if (null == this.privateKey) {
				throw new NullPointerException("Private key must not null when use it !");
			}
			return this.privateKey;
		case PublicKey:
			if (null == this.publicKey) {
				throw new NullPointerException("Public key must not null when use it !");
			}
			return this.publicKey;
		}
		throw new CryptoException("Uknown key type: " + type);
	}
651574
private int checkKey(Object key) {
	if (key == null) {
	    throw new NullPointerException("key cannot be null");
	} else if (!(key instanceof Integer)) {
	    throw new IllegalArgumentException("key must be an Integer");
	}
	else {
	    return ((Integer)key).intValue();
	}
    }
820546
def _typed_null_handler(c, ctx):
    """"""
    assert c == _DOT
    c, self = yield
    nxt = _NULL_STARTS
    i = 0
    length = None
    done = False
    trans = ctx.immediate_transition(self)
    while True:
        if done:
            if _ends_value(c) or (ctx.container.ion_type is IonType.SEXP and c in _OPERATORS):
                trans = ctx.event_transition(IonEvent, IonEventType.SCALAR, nxt.ion_type, None)
            else:
                _illegal_character(c, ctx, 'Illegal null type.')
        elif length is None:
            if c not in nxt:
                _illegal_character(c, ctx, 'Illegal null type.')
            nxt = nxt[c]
            if isinstance(nxt, _NullSequence):
                length = len(nxt.sequence)
        else:
            if c != nxt[i]:
                _illegal_character(c, ctx, 'Illegal null type.')
            i += 1
            done = i == length
        c, _ = yield trans
1268307
public Key ceil(Key k) {
		SortedMap<Key, Value> tail = st.tailMap(k);
		if (tail.isEmpty()) return null;
		else return tail.firstKey();
	}
270809
public static <K, V> void validateNotNull(K key, V value) {
        checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
        checkNotNull(value, NULL_VALUE_IS_NOT_ALLOWED);
    }
667877
def p_ConstValue_null(p):
  """"""
  p[0] = model.Value(type=model.Value.NULL, value=p[1])
225373
public <T> void put(@NonNull String key, @NonNull T value) {
    Preconditions.checkNotNull(value, VALUE_IS_NULL);
    put(key, value, TypeToken.fromValue(value));
  }
435597
@SuppressWarnings({ "unchecked", "rawtypes" })
	public static final <TO, FROM> TO convert(Class<TO> to, FROM from) {

		// Convert null value
		if (from == null || to == null) {
			return null;
		}

		// Convert "null" String to null
		if ("null".equals(from)) {
			return null;
		}

		// Class is same
		if (to == Object.class || from.getClass() == to) {
			return (TO) from;
		}

		// BSON conversion
		boolean isFromMap = from != null && from instanceof Map;
		if (isFromMap) {
			Object subValue = getSubValue((Map) from);
			if (subValue != null) {
				return convert(to, subValue);
			}
		}

		// Convert FROM -> TO
		DataConverterKey<TO, FROM> key = new DataConverterKey<TO, FROM>(to, (Class<FROM>) from.getClass());
		DataConverter<TO, FROM> converter = (DataConverter<TO, FROM>) converters.get(key);
		if (converter != null) {
			return converter.convert(from);
		}

		// Convert any -> TO
		converter = (DataConverter<TO, FROM>) defaultConverters.get(to);
		if (converter != null) {
			return converter.convert(from);
		}

		// Converter not found
		throw new IllegalArgumentException("Unable to convert " + from.getClass() + " to " + to
				+ ", converter not found in DataConverterRegistry!");
	}