/*
@description
Returns a precomputed shared key
which can be used in nacl.box.after and nacl.box.open.after.
773082
public byte [] before() {
            if (this.sharedKey == null) {
                this.sharedKey = new byte[sharedKeyLength];
                crypto_box_beforenm(this.sharedKey, this.theirPublicKey, this.mySecretKey);
            }

            return this.sharedKey;
        }
257961
function getNextKeyWith( keys, fullSid, ndx ) {

		for ( ; ndx < keys.length; ndx ++ ) {

			var key = keys[ ndx ];

			if ( key.hasTarget( fullSid ) ) {

				return key;

			}

		}

		return null;

	}
1346112
function(key, context) {
        var first, keys, subkey;
        if (typeof context === "undefined" || context === null) {
            context = this;
        }
        if (key.indexOf(".") > -1) {
            keys = key.split(".");
            first = keys.shift();
            subkey = keys.join(".");
            return this._attr_get(keys.join("."), context[first]);
        } else {
            return context[key];
        }
    }
1204051
public After<PartialResponseInsertType<T>> getOrCreateAfter()
   {
      Node node = childNode.getOrCreate("after");
      After<PartialResponseInsertType<T>> after = new AfterImpl<PartialResponseInsertType<T>>(this, "after", childNode, node);
      return after;
   }
1060891
def get(key, default=-1):
        """"""
        if isinstance(key, int):
            return TOS_PRE(key)
        if key not in TOS_PRE._member_map_:
            extend_enum(TOS_PRE, key, default)
        return TOS_PRE[key]
735110
function newRandomKey(coll, key, currentKey){
      var randKey;
      do {
        randKey = coll[Math.floor(coll.length * Math.random())][key];
      } while (randKey == currentKey);
      return randKey;
    }
1268307
public Key ceil(Key k) {
		SortedMap<Key, Value> tail = st.tailMap(k);
		if (tail.isEmpty()) return null;
		else return tail.firstKey();
	}
129950
function getInitializedAverage(data) {
    return _.reduce(data, function (prev, a, dataKey) {
      // create a first-level object of the key
      prev[dataKey] = {};

      _.each(data[dataKey], function (b, dataMetricKey) {
        // the metrics are properties inside this object
        prev[dataKey][dataMetricKey] = 0;
      });

      return prev;
    }, {});
  }
499590
public K key() {
    if (jc.hasNext()) {
      return jc.key();
    }
    if (!q.isEmpty()) {
      return q.peek().key();
    }
    return null;
  }
407238
def getKey(k)
      return nil if k > @nitems || k <= 0
      pos = SIZEOF_BLOCK_HEADER + (SIZEOF_KEY * (k - 1))
      keydata = @data[pos, SIZEOF_KEY]
      data2key(keydata)
    end
877413
@Override
    public INDArray get(T key) {
        try {
            if (emulateIsAbsent)
                lock.readLock().lock();

            if (containsKey(key)) {
                INDArray result = compressedEntries.get(key);

                // TODO: we don't save decompressed entries here, but something like LRU might be good idea
                return compressor.decompress(result);
            } else {
                return null;
            }
        } finally {
            if (emulateIsAbsent)
                lock.readLock().unlock();
        }
    }
1249057
@SuppressWarnings("unchecked")
    public Object getFirstKeyPart() {
        Object keyPart = null;
        if (this.key.value() instanceof List && !((List<Object>) this.key.value()).isEmpty()) {
            keyPart = ((List<Object>) this.key.value()).get(0);
        } else {
            // UniqueKey or MultitontKey with only one key part
            keyPart = this.key.value();
        }
        return keyPart;
    }
1138052
function hasKey(key) {
		var reads = stacheKey.reads(key);
		var readValue;

		if (reads[0].key === "scope") {
			// read properties like `scope.vm.foo` directly from the scope
			readValue = stacheKey.read(this, reads.slice(1), key);
		} else {
			// read normal properties from the scope's context
			readValue = stacheKey.read(this._context, reads, key);
		}

		return readValue.foundLastParent && readValue.parentHasKey;
	}
189452
private final K getRoundKey(final K key, final boolean upORdown, final boolean acceptEqual) {
		final TreeEntry<K, V> entry = getRoundEntry(key, upORdown, acceptEqual);
		if (entry == null) {
			return null;
		}
		return entry.getKey();
	}
539613
function (sessionKey) {
        //The first 16 bytes (MSB first) will be the key, the next 16 bytes (MSB first) will be the initialization vector (IV), and the final 8 bytes (MSB first) will be the salt.
        var key = new Buffer(16); //just the key... +8); //key plus salt
        var iv = new Buffer(16); //initialization vector

        sessionKey.copy(key, 0, 0, 16); //copy the key
        //sessionKey.copy(key, 16, 32, 40); //append the 8-byte salt?
        sessionKey.copy(iv, 0, 16, 32); //copy the iv

        //are we not be doing something with the salt here?

        return crypto.createDecipheriv('aes-128-cbc', key, iv);
    }
1122769
private Entry<K, V> getEntry(K key) {
        final K k = key;
        
        return new Entry<K, V>() {
            public boolean equals(Object ob) {
                if( ob instanceof Entry ) {
                    Entry entry = (Entry)ob;
                    
                    if( !entry.getKey().equals(getKey()) ) {
                        return false;
                    }
                    if( !entry.getValue().equals(getValue()) ) {
                        return false;
                    }
                    return true;
                }
                return false;
            }

            public K getKey() {
                return k;
            }

            public V getValue() {
                return ConcurrentCache.this.get(getKey());
            }

            public V setValue(V val) {
                return ConcurrentCache.this.put(getKey(), val);
            }
        };
    }
404129
function privKeyToPubKey(privKey, toCompressed) {
  toCompressed = toCompressed || false;

  const pkBuffer = Buffer.from(privKey, 'hex');
  var publicKey = secp256k1.publicKeyCreate(pkBuffer, toCompressed);
  return publicKey.toString('hex');
}