Example first bit of decoding
977461
public int getNumberOfCodebooks() {
        byte[] data = getData();
        int number = -1;
        if(data != null && data.length >= 10) {
            number = IOUtils.toInt(data[8]);
        }
        return (number+1);
    }
1130135
private int decodeBlackCodeWord() {
        int current, entry, bits, isT, code = -1;
        int runLength = 0;
        boolean isWhite = false;
        
        while (!isWhite) {
            current = nextLesserThan8Bits(4);
            entry = initBlack[current];
            
            // Get the 3 fields from the entry
            isT = entry & 0x0001;
            bits = (entry >>> 1) & 0x000f;
            code = (entry >>> 5) & 0x07ff;
            
            if (code == 100) {
                current = nextNBits(9);
                entry = black[current];
                
                // Get the 3 fields from the entry
                isT = entry & 0x0001;
                bits = (entry >>> 1) & 0x000f;
                code = (entry >>> 5) & 0x07ff;
                
                if (bits == 12) {
                    // Additional makeup codes
                    updatePointer(5);
                    current = nextLesserThan8Bits(4);
                    entry = additionalMakeup[current];
                    bits = (entry >>> 1) & 0x07;     // 3 bits 0000 0111
                    code  = (entry >>> 4) & 0x0fff;  // 12 bits
                    runLength += code;
                    
                    updatePointer(4 - bits);
                } else if (bits == 15) {
                	// EOL code
                	if ( runLength == 0 ) {
                		isWhite = true;
                	}
                	else {
                		throw new RuntimeException("EOL code word encountered in Black run.");
                	}
                } else {
                    runLength += code;
                    updatePointer(9 - bits);
                    if (isT == 0) {
                        isWhite = true;
                    }
                }
            } else if (code == 200) {
                // Is a Terminating code
                current = nextLesserThan8Bits(2);
                entry = twoBitBlack[current];
                code = (entry >>> 5) & 0x07ff;
                runLength += code;
                bits = (entry >>> 1) & 0x0f;
                updatePointer(2 - bits);
                isWhite = true;
            } else {
                // Is a Terminating code
                runLength += code;
                updatePointer(4 - bits);
                isWhite = true;
            }
        }
        
        return runLength;
    }
807821
def decode_example(self, tfexample_data):
    """"""
    # TODO(epot): Support dynamic shape
    if self.shape.count(None) < 2:
      # Restore the shape if possible. TF Example flattened it.
      shape = [-1 if i is None else i for i in self.shape]
      tfexample_data = tf.reshape(tfexample_data, shape)
    if tfexample_data.dtype != self.dtype:
      tfexample_data = tf.dtypes.cast(tfexample_data, self.dtype)
    return tfexample_data
880762
static final int decodeFromBytes(final byte[] arcs, final int start, final int n) {
    int r = 0;
    for (int i = n; --i >= 0;) {
      r = r << 8 | (arcs[start + i] & 0xff);
    }
    return r;
  }
830117
def smart_decode(binary, errors="strict"):
    
    d = chardet.detect(binary)
    encoding = d["encoding"]
    confidence = d["confidence"]

    text = binary.decode(encoding, errors=errors)
    return text, encoding, confidence
112746
public void decode1D(byte[] buffer, byte[] compData,
    int startX, int height) {
        this.data = compData;
        
        int lineOffset = 0;
        int scanlineStride = (w + 7)/8;
        
        bitPointer = 0;
        bytePointer = 0;
        
        for (int i = 0; i < height; i++) {
            decodeNextScanline(buffer, lineOffset, startX);
            lineOffset += scanlineStride;
        }
    }
801273
def decode(in_bytes):
    """"""
    out_bytes = []
    idx = 0

    if len(in_bytes) > 0:
        while True:
            length = ord(in_bytes[idx])
            if length == 0:
                raise DecodeError("zero byte found in input")
            idx += 1
            end = idx + length - 1
            copy_bytes = in_bytes[idx:end]
            if '\x00' in copy_bytes:
                raise DecodeError("zero byte found in input")
            out_bytes.append(copy_bytes)
            idx = end
            if idx > len(in_bytes):
                raise DecodeError("not enough input bytes for length code")
            if idx < len(in_bytes):
                if length < 0xFF:
                    out_bytes.append('\x00')
            else:
                break
    return ''.join(out_bytes)
865148
function decodeSample$1(muLawSample) {
  /** @type {number} */
  let sign;
  /** @type {number} */
  let exponent;
  /** @type {number} */
  let mantissa;
  /** @type {number} */
  let sample;
  muLawSample = ~muLawSample;
  sign = (muLawSample & 0x80);
  exponent = (muLawSample >> 4) & 0x07;
  mantissa = muLawSample & 0x0F;
  sample = decodeTable[exponent] + (mantissa << (exponent+3));
  if (sign != 0) sample = -sample;
  return sample;
}
193323
def _init_decoder(self):
        
        # Note: content-encoding value should be case-insensitive, per RFC 7230
        # Section 3.2
        content_encoding = self.headers.get('content-encoding', '').lower()
        if self._decoder is None:
            if content_encoding in self.CONTENT_DECODERS:
                self._decoder = _get_decoder(content_encoding)
            elif ',' in content_encoding:
                encodings = [e.strip() for e in content_encoding.split(',') if e.strip() in self.CONTENT_DECODERS]
                if len(encodings):
                    self._decoder = _get_decoder(content_encoding)
105739
def decode(encoded, eol=NL):
    
    if not encoded:
        return encoded
    # BAW: see comment in encode() above.  Again, we're building up the
    # decoded string with string concatenation, which could be done much more
    # efficiently.
    decoded = ''

    for line in encoded.splitlines():
        line = line.rstrip()
        if not line:
            decoded += eol
            continue

        i = 0
        n = len(line)
        while i < n:
            c = line[i]
            if c != '=':
                decoded += c
                i += 1
            # Otherwise, c == "=".  Are we at the end of the line?  If so, add
            # a soft line break.
            elif i+1 == n:
                i += 1
                continue
            # Decode if in form =AB
            elif i+2 < n and line[i+1] in hexdigits and line[i+2] in hexdigits:
                decoded += unquote(line[i:i+3])
                i += 3
            # Otherwise, not in form =AB, pass literally
            else:
                decoded += c
                i += 1

            if i == n:
                decoded += eol
    # Special case if original string did not end with eol
    if encoded[-1] not in '\r\n' and decoded.endswith(eol):
        decoded = decoded[:-1]
    return decoded
23172
def decode_from_bin(input_bin):
    
    for chunk in partition_all(8, input_bin):
        yield sum(
            2**exp * bit
            for exp, bit
            in enumerate(reversed(chunk))
        )
449140
def decode(self, bytes):
        
        opcode  = struct.unpack(">H", bytes[0:2])[0]
        nbytes  = struct.unpack("B",  bytes[2:3])[0]
        name   = None
        args   = []

        if opcode in self.opcodes:
            defn = self.opcodes[opcode]
            name = defn.name
            stop = 3

            for arg in defn.argdefns:
                start = stop
                stop  = start + arg.nbytes
                if arg.fixed:
                    pass  # FIXME: Confirm fixed bytes are as expected?
                else:
                    args.append(arg.decode(bytes[start:stop]))

        return self.create(name, *args)
875497
private static byte[] decode4to3(byte[] fourBytes) {
		byte[] outBuff1 = new byte[3];
		int count = decode4to3(fourBytes, 0, outBuff1, 0);
		byte[] outBuff2 = new byte[count];

		for (int i = 0; i < count; i++) {
			outBuff2[i] = outBuff1[i];
		}

		return outBuff2;
	}
515329
static CacheBucketOffset decode(long value) {
        return value < 0 ? new CacheBucketOffset(value ^ FIRST_BIT, true) : new CacheBucketOffset(value, false);
    }
1029137
def _decode_byte(byte):
    
    bits = []
    for _ in range(8):
        bits.append(byte & 1)
        byte >>= 1
    return bits
999898
def leb128_decode(data):
        
        result = 0
        shift = 0

        while True:
            character = data.read(1)
            if len(character) == 0:
                raise bitcoin.core.SerializationTruncationError('Invalid LEB128 integer')

            b = ord(character)
            result |= (b & 0x7f) << shift
            if b & 0x80 == 0:
                break
            shift += 7
        return result
527103
int decodevs(float[] a, int index, Buffer b, int step, int addmul) {
        int entry = decode(b);
        if (entry == -1) {
            return (-1);
        }
        switch (addmul) {
            case -1:
                for (int i = 0, o = 0; i < dim; i++, o += step) {
                    a[index + o] = valuelist[entry * dim + i];
                }
                break;
            case 0:
                for (int i = 0, o = 0; i < dim; i++, o += step) {
                    a[index + o] += valuelist[entry * dim + i];
                }
                break;
            case 1:
                for (int i = 0, o = 0; i < dim; i++, o += step) {
                    a[index + o] *= valuelist[entry * dim + i];
                }
                break;
            default:
            //System.err.println("CodeBook.decodeves: addmul="+addmul); 
        }
        return (entry);
    }