Decodes a Base64 bytes (or string) input and decompresses it using Gzip
    :param data: Base64 (bytes) data to be decoded
    :return: Decompressed and decoded bytes
1219
def decompress(data):
    

    if isinstance(data, bytes):
        source = data
    elif isinstance(data, str):
        source = bytes(data, encoding='utf-8')
    else:
        raise RuntimeError("Compression is only supported for strings and bytes")

    return gzip.decompress(base64.b64decode(source))
634519
def decode_aes256_base64_auto(data, encryption_key):
    """"""
    assert isinstance(data, bytes)
    length = len(data)

    if length == 0:
        return b''
    elif data[0] == b'!'[0]:
        return decode_aes256_cbc_base64(data, encryption_key)
    else:
        return decode_aes256_ecb_base64(data, encryption_key)
978318
def compute_md5_for_data_asbase64(data):
    # type: (obj) -> str
    
    hasher = blobxfer.util.new_md5_hasher()
    hasher.update(data)
    return blobxfer.util.base64_encode_as_string(hasher.digest())
621662
def parse(self, data: bytes, context=None):
        
        stream = BytesIO(data)
        return self.parse_stream(stream, context)
319360
def hxzip_decode(data_size, data):
    
    import zlib
    data_stream = zlib.decompress(data)
    output = numpy.array(struct.unpack('<{}B'.format(len(data_stream)), data_stream), dtype=numpy.uint8)
    assert len(output) == data_size
    return output
818701
function encodeData (data) {
    // json encode data
    data = jsonStableStringify(data)
    // compress if compression in use
    if (this.compression) {
        data = snappy.compressSync(data).toString('base64')
    }
    // return encoded data
    return data
}
523436
public static byte[] decodeLZ(byte[] data, String dictionary) {
    try {
      Inflater decompresser = new Inflater();
      decompresser.setInput(data, 0, data.length);
      byte[] result = new byte[data.length * 32];
      int resultLength = 0;
      if (!dictionary.isEmpty()) {
        resultLength = decompresser.inflate(result);
        assert (0 == resultLength);
        if (decompresser.needsDictionary()) {
          byte[] bytes = dictionary.getBytes("UTF-8");
          decompresser.setDictionary(bytes);
        }
      }
      resultLength = decompresser.inflate(result);
      decompresser.end();
      return Arrays.copyOfRange(result, 0, resultLength);
    } catch (DataFormatException | UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
  }
1299418
def gzip_decode(data, max_decode=20971520):
    
    if not gzip:
        raise NotImplementedError
    f = StringIO.StringIO(data)
    gzf = gzip.GzipFile(mode="rb", fileobj=f)
    try:
        if max_decode < 0: # no limit
            decoded = gzf.read()
        else:
            decoded = gzf.read(max_decode + 1)
    except IOError:
        raise ValueError("invalid data")
    f.close()
    gzf.close()
    if max_decode >= 0 and len(decoded) > max_decode:
        raise ValueError("max gzipped payload length exceeded")
    return decoded
121241
def decode(cls, data, bytes_to_read=None):
        
        if isinstance(data, bytes):
            data = io.BytesIO(data)
        if bytes_to_read is None:
            bytes_to_read = Int32.decode(data)

        # if FetchRequest max_bytes is smaller than the available message set
        # the server returns partial data for the final message
        # So create an internal buffer to avoid over-reading
        raw = io.BytesIO(data.read(bytes_to_read))

        items = []
        while bytes_to_read:
            try:
                offset = Int64.decode(raw)
                msg_bytes = Bytes.decode(raw)
                bytes_to_read -= 8 + 4 + len(msg_bytes)
                items.append((offset, len(msg_bytes), Message.decode(msg_bytes)))
            except ValueError:
                # PartialMessage to signal that max_bytes may be too small
                items.append((None, None, PartialMessage()))
                break
        return items
599272
def base64decode(_input=None):
    """"""
    missing_padding = 4 - len(_input) % 4
    if missing_padding:
        _input += '=' * missing_padding
    if PY2:  # pragma: no cover
        return base64.decodestring(_input)
    elif PY3:  # pragma: no cover
        if isinstance(_input, bytes):
            return base64.b64decode(_input).decode('UTF-8')
        elif isinstance(_input, str):
            return base64.b64decode(bytearray(_input, encoding='UTF-8')).decode('UTF-8')
715281
def _decompress_data(self, data):
        ''''''
        if self._decompressor:
            try:
                return self._decompressor.decompress(data)
            except zlib.error as error:
                raise ProtocolError(
                    'zlib error: {0}.'.format(error)
                ) from error
        else:
            return data
126798
def decode_streaming(self, data):
        
        # Reverse lookup table: map (bitsize, value) to symbols
        lookup = dict(((b, v), s) for (s, (b, v)) in self._table.items())

        buffer = 0
        size = 0
        for byte in data:
            for m in [128, 64, 32, 16, 8, 4, 2, 1]:
                buffer = (buffer << 1) + bool(from_byte(byte) & m)
                size += 1
                if (size, buffer) in lookup:
                    symbol = lookup[size, buffer]
                    if symbol == _EOF:
                        return
                    yield symbol
                    buffer = 0
                    size = 0
44923
public static byte[] decompress(byte[] data) throws Exception {
		ByteArrayInputStream bais = new ByteArrayInputStream(data);
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		decompress(bais, baos);
		data = baos.toByteArray();
		baos.flush();
		baos.close();
		bais.close();
		return data;
	}
106520
def hexdigest(self, data=None):
        
        from base64 import b16encode
        if pyver == 2:
            return b16encode(self.digest(data))
        else:
            return b16encode(self.digest(data)).decode('us-ascii')
1289592
public static List<String> decodeStringsFromBase64Parameter(String data) {

        data = StringUtils.replaceChars(data, BASE64_EXTRA_REPLACEMENTS, BASE64_EXTRA);
        byte[] bytes = deobfuscateBytes(Base64.decodeBase64(data));
        try {
            JSONArray json = new JSONArray(new String(bytes, "UTF-8"));
            List<String> result = Lists.newArrayList();
            for (int i = 0; i < json.length(); i++) {
                result.add(json.getString(i));
            }
            return result;
        } catch (UnsupportedEncodingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (JSONException e) {
            throw new IllegalArgumentException("Decoding failed: " + data, e);
        }
        return null;
    }
125204
def to_str(data):
    
    if isinstance(data, bytes):
        return codecs.decode(data, TEXT_ENCODING)
    return data
1238364
def Decode(self, encoded_data):
    
    try:
      decoded_data = base64.b32decode(encoded_data, casefold=False)
    except (TypeError, binascii.Error) as exception:
      raise errors.BackEndError(
          'Unable to decode base32 stream with error: {0!s}.'.format(
              exception))

    return decoded_data, b''