Right now, just gets chunk#0 from a ValueArray, or a normal Value otherwise.
487281
static public Value getValue( Key key ) {
    Value val = DKV.get(key);
    return val;
  }
328910
private static int byteArrayToInt(byte[] data)
    {
        // byte[] -> int
        int number = 0;
        for (int i = 0; i < 4; ++i)
        {
            number |= (data[3-i] & 0xff) << (i << 3);
        }
        return number;
    }
13019
def getBlockValue(self, block):
        
        if self._bit_count == 0:
            raise Exception( "The margin '" + self._name +
                             "' did not allocate any bits for the values")
        val = block.userState()
        if val in [ 0, -1 ]:
            return 0

        # Shift the value to the right
        val >>= self._bitRange[ 0 ]

        # Apply the mask to the value
        mask = 2 ** self._bit_count - 1
        val &= mask
        return val
1084269
private void nextChunk() throws IOException {
        if (state == CHUNK_INVALID) {
            throw new MalformedChunkCodingException("Corrupt data stream");
        }
        try {
            chunkSize = getChunkSize();
            if (chunkSize < 0L) {
                throw new MalformedChunkCodingException("Negative chunk size");
            }
            state = CHUNK_DATA;
            pos = 0L;
            if (chunkSize == 0L) {
                eof = true;
                parseTrailerHeaders();
            }
        } catch (MalformedChunkCodingException ex) {
            state = CHUNK_INVALID;
            throw ex;
        }
    }
590561
private byte[] readChunk() throws Exception {
        if (isEndOfInput()) {
            return EMPTY_BYTE_ARRAY;
        }

        try {
            // transfer to buffer
            byte[] tmp = new byte[chunkSize];
            int readBytes = in.read(tmp);
            if (readBytes <= 0) {
                return null;
            }
            byte[] buffer = new byte[readBytes];
            System.arraycopy(tmp, 0, buffer, 0, readBytes);
            offset += readBytes;
            return buffer;
        } catch (IOException e) {
            // Close the stream, and propagate the exception.
            IOUtils.closeQuietly(in);
            throw e;
        }
    }
297507
function encodeArray_Primitive( encoder, data ) {

	// Analyze primitive array and return clusters of values
	// that can be efficiently merged (such as numbers, repeated values,
	// primitives etc.)
	var chunks = analyzePrimitiveArray( encoder, data );
	if (chunks.length === 1) {

		// Just check
		if (chunks[0][1] !== data.length) {
			throw new Errors.AssertError('Primitive array analysis reported single chunk but does not match array length!');
		}

		// Just encode a single chunk as array component
		encodeArray_Chunk( encoder, data, chunks[0] );

	} else {

		// We have more than one chunk, start encoding chunked array
		encodeArray_PRIM_CHUNK( encoder, data, chunks );

	}

}
1249943
private static int zero(byte[] block, int offset, int len) {
    Util.zero(block, offset, len);
    return len;
  }
364527
def get_chunks(source, chunk_len):
    
    return (source[i: i + chunk_len] for i in range(0, len(source), chunk_len))
660914
function arrayHas(value, array) {
    error_if_not_array_1.errorIfNotArray(array);
    return (array.length > 0 && (array_get_indexes_1.getFirstIndexOf(value, array) > -1));
}
1043690
function parseFileChunk(data){
  var chunk = {};
  chunk.chunkIdx = new Float64Array(data.buffer, 8, 1)[0];
  chunk.fileID = String.fromCharCode.apply(null, new Uint16Array(data.buffer, 32, 8));
  chunk.msgIdx = new Float64Array(data.buffer, 16, 1)[0];
  chunk.data = new Uint8Array(data.buffer, 48);
  return chunk;
}
693211
def _as_chunk(self):
        

        if self._chunks_offset == 0:
            return self.contents
        return self.contents[self._chunks_offset:]
1112746
public static void extractChunkPart(Chunk ic, Chunk oc, int startRow, int nrows, Futures fs) {
    try {
      NewChunk dst = new NewChunk(oc);
      dst._len = dst._sparseLen = 0;
      NewChunk src = new NewChunk(ic);
      src = ic.inflate_impl(src);
      assert src._len == ic._len;
      // Iterate over values skip all 0
      int remain = nrows;
      Iterator<NewChunk.Value> it = src.values(startRow, startRow + nrows);
      int off = startRow - 1;
      while (it.hasNext()) {
        NewChunk.Value v = it.next();
        final int rid = v.rowId0();
        assert rid < startRow + nrows;
        int add = rid - off; // number of values to add
        off = rid;
        dst.addZeros(add - 1); // append (add-1) zeros
        v.add2Chunk(dst);    // followed by a value
        remain -= add;
        assert remain >= 0;
      }
      // Handle case when last added value is followed by zeros till startRow+nrows
      dst.addZeros(remain);

      assert dst._len == oc._len : "NewChunk.dst.len = " + dst._len + ", oc._len = " + oc._len;
      dst.close(dst.cidx(), fs);
    } catch(RuntimeException t){
      Log.err("gor exception in chunkSplitter, ic = " + ic + ", oc = " + oc + " startRow = " + startRow + " nrows = " + nrows);
      throw t;
    }
    return ;
  }
337757
private Chunk[] getScoringChunks(Chunk[] allChunks) {
    if (_preds == null)
      return allChunks;
    Chunk[] chks = new Chunk[allChunks.length - _preds.numCols()];
    System.arraycopy(allChunks, 0, chks, 0, chks.length);
    return chks;
  }
713645
function chunk(arr, chunkSize) {
      var result = [];
      for (var index = 0, length = arr.length; index < length; index += chunkSize) {
        result.push(arr.slice(index,index + chunkSize));
      }
      return(result);
    }
1216760
def _get_raw(source, bitarray):
        '''  '''
        offset = int(source['offset'])
        size = int(source['size'])
        return int(''.join(['1' if digit else '0' for digit in bitarray[offset:offset + size]]), 2)
609823
public void get1Value(int index, float[] valueDestination) {
        try {
            SFVec2f sfVec2f = value.get(index);
            valueDestination[0] = sfVec2f.x;
            valueDestination[1] = sfVec2f.y;
        }
        catch (IndexOutOfBoundsException e) {
            Log.e(TAG, "X3D MFVec2f get1Value(index) out of bounds." + e);
        }
        catch (Exception e) {
            Log.e(TAG, "X3D MFVec2f get1Value(index) exception " + e);
        }
    }
294380
function findValue (arr, value) {
	value = purifyValue(value);

	for (var i = arr.length - 1; i >= 0; i--) {
		if (arr[i].val === value) {
			return arr[i].pos;
		};

		if (i === 0) {
			return -1;
		};
	};
}