NOTE: Doesn't do the encoding/decoding dance
543076
function parse(input, isindex) {
				var sequences = input.split('&');
				if (isindex && sequences[0].indexOf('=') === -1)
					sequences[0] = '=' + sequences[0];
				var pairs = [];
				sequences.forEach(function (bytes) {
					if (bytes.length === 0) return;
					var index = bytes.indexOf('=');
					if (index !== -1) {
						var name = bytes.substring(0, index);
						var value = bytes.substring(index + 1);
					} else {
						name = bytes;
						value = '';
					}
					name = name.replace(/\+/g, ' ');
					value = value.replace(/\+/g, ' ');
					pairs.push({ name: name, value: value });
				});
				var output = [];
				pairs.forEach(function (pair) {
					output.push({
						name: decodeURIComponent(pair.name),
						value: decodeURIComponent(pair.value)
					});
				});
				return output;
			}
335792
def iterencode(self, o, _one_shot=False):
        
        if self.check_circular:
            markers = {}
        else:
            markers = None
        if self.ensure_ascii:
            _encoder = encode_basestring_ascii
        else:
            _encoder = encode_basestring
        if self.encoding != 'utf-8':
            def _encoder(o, _orig_encoder=_encoder, _encoding=self.encoding):
                if isinstance(o, str):
                    o = o.decode(_encoding)
                return _orig_encoder(o)

        def floatstr(o, allow_nan=self.allow_nan,
                     _repr=FLOAT_REPR, _inf=INFINITY, _neginf=-INFINITY):
            # Check for specials.  Note that this type of test is processor
            # and/or platform-specific, so do tests which don't depend on the
            # internals.

            if o != o:
                text = 'NaN'
            elif o == _inf:
                text = 'Infinity'
            elif o == _neginf:
                text = '-Infinity'
            else:
                return _repr(o)

            if not allow_nan:
                raise ValueError(
                    "Out of range float values are not JSON compliant: " +
                    repr(o))

            return text

        _iterencode = _make_iterencode(
            markers, self.default, _encoder, self.indent, floatstr,
            self.key_separator, self.item_separator, self.sort_keys,
            self.skipkeys, _one_shot, self._order)

        return _iterencode(o, 0)
352946
def get_codec(data):
    
    try:
        key = ensure_bytes(data[:CODE_LENGTH], 'utf8')
        codec = ENCODINGS_LOOKUP[key]
    except KeyError:
        raise ValueError('Can not determine encoding for {}'.format(data))
    else:
        return codec
594684
def iterencode(self, o, _one_shot=False):
        
        c_make_encoder_original = json.encoder.c_make_encoder
        json.encoder.c_make_encoder = None

        if self.check_circular:
            markers = {}
        else:
            markers = None
        if self.ensure_ascii:
            _encoder = json.encoder.encode_basestring_ascii
        else:
            _encoder = json.encoder.encode_basestring

        def floatstr(o, allow_nan=self.allow_nan,
                     _repr=lambda x: format(x, self._formatter),
                     _inf=float("inf"), _neginf=-float("inf")):
            # Check for specials.  Note that this type of test is processor
            # and/or platform-specific, so do tests which don't depend on the
            # internals.
            if o != o:
                text = 'NaN'
            elif o == _inf:
                text = 'Infinity'
            elif o == _neginf:
                text = '-Infinity'
            else:
                return _repr(o)

            if not allow_nan:
                raise ValueError(
                    "Out of range float values are not JSON compliant: " +
                    repr(o))

            return text

        if (_one_shot and json.encoder.c_make_encoder is not None
                and self.indent is None):
            _iterencode = json.encoder.c_make_encoder(
                markers, self.default, _encoder, self.indent,
                self.key_separator, self.item_separator, self.sort_keys,
                self.skipkeys, self.allow_nan)
        else:
            _iterencode = json.encoder._make_iterencode(
                markers, self.default, _encoder, self.indent, floatstr,
                self.key_separator, self.item_separator, self.sort_keys,
                self.skipkeys, _one_shot)
        json.encoder.c_make_encoder = c_make_encoder_original
        return _iterencode(o, 0)
1003444
def code_data_whitening(self, decoding, inpt):
        
        inpt_copy = array.array("B", inpt)
        return self.apply_data_whitening(decoding, inpt_copy)
970741
def replace_surrogate_decode(mybytes):
    
    decoded = []
    for ch in mybytes:
        # We may be parsing newbytes (in which case ch is an int) or a native
        # str on Py2
        if isinstance(ch, int):
            code = ch
        else:
            code = ord(ch)
        if 0x80 <= code <= 0xFF:
            decoded.append(_unichr(0xDC00 + code))
        elif code <= 0x7F:
            decoded.append(_unichr(code))
        else:
            # # It may be a bad byte
            # # Try swallowing it.
            # continue
            # print("RAISE!")
            raise NotASurrogateError
    return str().join(decoded)
1331147
function(encoders, cb) {
        var unavailable;

        // Audio codec(s)
        unavailable = self._outputs.reduce(function(cdcs, output) {
          var acodec = output.audio.find('-acodec', 1);
          if (acodec && acodec[0] !== 'copy') {
            if (!(acodec[0] in encoders) || encoders[acodec[0]].type !== 'audio') {
              cdcs.push(acodec[0]);
            }
          }

          return cdcs;
        }, []);

        if (unavailable.length === 1) {
          return cb(new Error('Audio codec ' + unavailable[0] + ' is not available'));
        } else if (unavailable.length > 1) {
          return cb(new Error('Audio codecs ' + unavailable.join(', ') + ' are not available'));
        }

        // Video codec(s)
        unavailable = self._outputs.reduce(function(cdcs, output) {
          var vcodec = output.video.find('-vcodec', 1);
          if (vcodec && vcodec[0] !== 'copy') {
            if (!(vcodec[0] in encoders) || encoders[vcodec[0]].type !== 'video') {
              cdcs.push(vcodec[0]);
            }
          }

          return cdcs;
        }, []);

        if (unavailable.length === 1) {
          return cb(new Error('Video codec ' + unavailable[0] + ' is not available'));
        } else if (unavailable.length > 1) {
          return cb(new Error('Video codecs ' + unavailable.join(', ') + ' are not available'));
        }

        cb();
      }
1092525
def decode(in_bytes):
    """"""
    if isinstance(in_bytes, str):
        raise TypeError('Unicode-objects are not supported; byte buffer objects only')
    in_bytes_mv = _get_buffer_view(in_bytes)
    out_bytes = bytearray()
    idx = 0

    if len(in_bytes_mv) > 0:
        while True:
            length = ord(in_bytes_mv[idx])
            if length == 0:
                raise DecodeError("zero byte found in input")
            idx += 1
            end = idx + length - 1
            copy_mv = in_bytes_mv[idx:end]
            if b'\x00' in copy_mv:
                raise DecodeError("zero byte found in input")
            out_bytes += copy_mv
            idx = end
            if idx > len(in_bytes_mv):
                raise DecodeError("not enough input bytes for length code")
            if idx < len(in_bytes_mv):
                if length < 0xFF:
                    out_bytes.append(0)
            else:
                break
    return bytes(out_bytes)
869542
def content_transfer_encoding(self) \
            -> Optional[ContentTransferEncodingHeader]:
        """"""
        try:
            return cast(ContentTransferEncodingHeader,
                        self[b'content-transfer-encoding'][0])
        except (KeyError, IndexError):
            return None
744377
private static String convertToNativeEncoding(String fileName, boolean isPath) {
        String ret = fileName;

        ret = removeIllegalCharacters(ret, isPath);

        //convert our filename to OS encoding...
        try {
            final CharsetEncoder charsetEncoder = Charset.defaultCharset().newEncoder();
            charsetEncoder.onMalformedInput(CodingErrorAction.REPLACE); // otherwise breaks on first unconvertable char
            charsetEncoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
            charsetEncoder.replaceWith(new byte[]{'_'});

            final ByteBuffer buf = charsetEncoder.encode(CharBuffer.wrap(ret));
            if (buf.hasArray()) {
                ret = new String(buf.array());
            }

            //remove NUL character from conversion...
            ret = ret.replaceAll("\\u0000", "");
        } catch (CharacterCodingException e) {
            e.printStackTrace();
        }

        return ret;
    }
1709
private static String encoder(final String toEncode) {
        try {
            return URLEncoder.encode(toEncode, URL_ENCODING);
        } catch (UnsupportedEncodingException ex) {
            LOG.warn("Failed to encode: {}", ex.getMessage(), ex);
            return "";
        }
    }
1265898
def _encode_sequence(self, inputs, token_types, valid_length=None):
        
        # embedding
        word_embedding = self.word_embed(inputs)
        type_embedding = self.token_type_embed(token_types)
        embedding = word_embedding + type_embedding
        # encoding
        outputs, additional_outputs = self.encoder(embedding, None, valid_length)
        return outputs, additional_outputs
528307
function detectEncoding(label, input_stream) {
      if (input_stream.match([0xFF, 0xFE])) {
        input_stream.offset(2);
        return 'utf-16';
      }
      if (input_stream.match([0xFE, 0xFF])) {
        input_stream.offset(2);
        return 'utf-16be';
      }
      if (input_stream.match([0xEF, 0xBB, 0xBF])) {
        input_stream.offset(3);
        return 'utf-8';
      }
      return label;
    }
654848
def decode_string(data, encoding='hex'):
    '''
    
    '''
    if six.PY2:
        return data.decode(encoding)
    else:
        return codecs.decode(data.encode('ascii'), encoding)
159559
def toUnicode(s):
    
    if isinstance(s, six.binary_type):
        s = s.decode('utf-8')
    return s
2966
def encode(self):
        

        match_id = self.match_id
        if match_id is None:
            match_id = (1 << 11) - 1

        return (self.match_type << 12) | DataStreamSelector.SpecifierEncodings[self.match_spec] | match_id
1308529
def tile_decode(tile, tileindex, tileshape, tiledshape,
                lsb2msb, decompress, unpack, unpredict, out):
    """"""
    _, imagedepth, imagelength, imagewidth, _ = out.shape
    tileddepth, tiledlength, tiledwidth = tiledshape
    tiledepth, tilelength, tilewidth, samples = tileshape
    tilesize = tiledepth * tilelength * tilewidth * samples

    pl = tileindex // (tiledwidth * tiledlength * tileddepth)
    td = (tileindex // (tiledwidth * tiledlength)) % tileddepth * tiledepth
    tl = (tileindex // tiledwidth) % tiledlength * tilelength
    tw = tileindex % tiledwidth * tilewidth

    if tile:
        if lsb2msb:
            tile = bitorder_decode(tile, out=tile)
        tile = decompress(tile)
        tile = unpack(tile)
        # decompression / unpacking might return too many bytes
        tile = tile[:tilesize]
        try:
            # complete tile according to TIFF specification
            tile.shape = tileshape
        except ValueError:
            # tile fills remaining space; found in some JPEG compressed slides
            s = (min(imagedepth - td, tiledepth),
                 min(imagelength - tl, tilelength),
                 min(imagewidth - tw, tilewidth),
                 samples)
            try:
                tile.shape = s
            except ValueError:
                # incomplete tile; see gdal issue #1179
                log.warning('tile_decode: incomplete tile %s %s',
                            tile.shape, tileshape)
                t = numpy.zeros(tilesize, tile.dtype)
                s = min(tile.size, tilesize)
                t[:s] = tile[:s]
                tile = t.reshape(tileshape)

        tile = unpredict(tile, axis=-2, out=tile)
        out[pl, td:td+tiledepth, tl:tl+tilelength, tw:tw+tilewidth] = (
            tile[:imagedepth-td, :imagelength-tl, :imagewidth-tw])
    else:
        out[pl, td:td+tiledepth, tl:tl+tilelength, tw:tw+tilewidth] = 0