Unpackages a payload
772310
def unpackage(package_):
    '''
    
    '''
    return salt.utils.msgpack.loads(package_, use_list=True,
                                    _msgpack_module=msgpack)
429244
def unpack_token(token):
    
    if isinstance(token, (unicode,str)):
        return _decode_token_compact(token)

    else:
        return _decode_token_json(token)
100938
def unpack(self, s):
        """"""
        return self._create(super(NamedStruct, self).unpack(s))
1139367
def unpack_rawr_zip_payload(table_sources, payload):
    """"""
    # the io we get from S3 is streaming, so we can't seek on it, but zipfile
    # seems to require that. so we buffer it all in memory. RAWR tiles are
    # generally up to around 100MB in size, which should be safe to store in
    # RAM.
    from tilequeue.query.common import Table
    from io import BytesIO

    zfh = zipfile.ZipFile(BytesIO(payload), 'r')

    def get_table(table_name):
        # need to extract the whole compressed file from zip reader, as it
        # doesn't support .tell() on the filelike, which gzip requires.
        data = zfh.open(table_name, 'r').read()
        unpacker = Unpacker(file_like=BytesIO(data))
        source = table_sources[table_name]
        return Table(source, unpacker)

    return get_table
624262
function Unpack20(bstream, Solid) {
    var destUnpSize = RarUtils.BUFFERS.unpack.data.length;
    var oldDistPtr = 0;

    RarReadTables20(bstream);
    while (destUnpSize > RarUtils.BUFFERS.unpack.ptr) {
        var num = RarUtils.RarDecodeNumber(bstream, RarUtils.CONST.LD);
        if (num < 256) {
            RarUtils.BUFFERS.unpack.insertByte(num);
            continue;
        }
        if (num > 269) {
            var Length = RarUtils.CONST.rLDecode[num -= 270] + 3;
            if ((Bits = RarUtils.CONST.rLBits[num]) > 0) {
                Length += bstream.readBits(Bits);
            }
            var DistNumber = RarUtils.RarDecodeNumber(bstream, RarUtils.CONST.DD);
            var Distance = RarUtils.CONST.rDDecode[DistNumber] + 1;
            if ((Bits = RarUtils.CONST.rDBits[DistNumber]) > 0) {
                Distance += bstream.readBits(Bits);
            }
            if (Distance >= 0x2000) {
                Length++;
                if (Distance >= 0x40000) Length++;
            }
            lastLength = Length;
            lastDist = rOldDist[oldDistPtr++ & 3] = Distance;
            RarUtils.RarCopyString(Length, Distance);
            continue;
        }
        if (num == 269) {
            RarReadTables20(bstream);

            RarUtils.RarUpdateProgress();

            continue;
        }
        if (num == 256) {
            lastDist = rOldDist[oldDistPtr++ & 3] = lastDist;
            RarUtils.RarCopyString(lastLength, lastDist);
            continue;
        }
        if (num < 261) {
            var Distance = rOldDist[(oldDistPtr - (num - 256)) & 3];
            var LengthNumber = RarUtils.RarDecodeNumber(bstream, RarUtils.CONST.RD);
            var Length = RarUtils.CONST.rLDecode[LengthNumber] + 2;
            if ((Bits = RarUtils.CONST.rLBits[LengthNumber]) > 0) {
                Length += bstream.readBits(Bits);
            }
            if (Distance >= 0x101) {
                Length++;
                if (Distance >= 0x2000) {
                    Length++
                    if (Distance >= 0x40000) Length++;
                }
            }
            lastLength = Length;
            lastDist = rOldDist[oldDistPtr++ & 3] = Distance;
            RarUtils.RarCopyString(Length, Distance);
            continue;
        }
        if (num < 270) {
            var Distance = RarUtils.CONST.rSDDecode[num -= 261] + 1;
            if ((Bits = RarUtils.CONST.rSDBits[num]) > 0) {
                Distance += bstream.readBits(Bits);
            }
            lastLength = 2;
            lastDist = rOldDist[oldDistPtr++ & 3] = Distance;
            RarUtils.RarCopyString(2, Distance);
            continue;
        }

    }
    RarUtils.RarUpdateProgress();
}
742317
def Unpack(self, msg):
    """"""
    descriptor = msg.DESCRIPTOR
    if not self.Is(descriptor):
      return False
    msg.ParseFromString(self.value)
    return True
1032978
def unpack(self, unpacker):
        

        (a, b, c, d) = unpacker.unpack_struct(_HHHH)

        self.start_pc = a
        self.end_pc = b
        self.handler_pc = c
        self.catch_type_ref = d
756773
function unpackTx (tx) {
  const deserializedTx = TxBuilder.unpackTx(tx)
  console.log(JSON.stringify(deserializedTx, undefined, 2))
}
1321517
def unpack(cls, msg, client, server, request_id):
        
        payload_document = OrderedDict()
        flags, = _UNPACK_UINT(msg[:4])
        pos = 4
        if flags != 0 and flags != 2:
            raise ValueError('OP_MSG flag must be 0 or 2 not %r' % (flags,))

        while pos < len(msg):
            payload_type, = _UNPACK_BYTE(msg[pos:pos + 1])
            pos += 1
            payload_size, = _UNPACK_INT(msg[pos:pos + 4])
            if payload_type == 0:
                doc = bson.decode_all(msg[pos:pos + payload_size],
                                      CODEC_OPTIONS)[0]
                payload_document.update(doc)
                pos += payload_size
            elif payload_type == 1:
                section_size, = _UNPACK_INT(msg[pos:pos + 4])
                pos += 4
                identifier, pos = _get_c_string(msg, pos)
                # Section starts w/ 4-byte size prefix, identifier ends w/ nil.
                documents_len = section_size - len(identifier) - 1 - 4
                documents = bson.decode_all(msg[pos:pos + documents_len],
                                            CODEC_OPTIONS)
                payload_document[identifier] = documents
                pos += documents_len

        database = payload_document['$db']
        return OpMsg(payload_document, namespace=database, flags=flags,
                     _client=client, request_id=request_id,
                     _server=server)
662167
def parse_payload(data, payload_fmt, *payload_names):
    
    payload = struct.unpack(payload_fmt, data)
    return dict(zip(payload_names, payload))
173036
def cleanup_payload(self, payload):
        
        p = payload.replace('\n', '')
        p = p.rstrip()
        p = p.lstrip()
        return p
897261
def unpack(self, s):
        """"""
        return self._create(super(DictStruct, self).unpack(s))
1213682
def unpack(cls, data):
        
        header, data = APPHeader.unpack(data)

        if len(data) < header.payload_length:
            raise ProtocolViolation("Payload too small")
        payload = data[:header.payload_length]
        body = cls()
        body._header = header
        body._payload = payload
        return body, data[header.payload_length:]
561214
def unpack(cls, msg, client, server, request_id):
        
        flags, = _UNPACK_INT(msg[:4])
        namespace, pos = _get_c_string(msg, 4)
        num_to_return, = _UNPACK_INT(msg[pos:pos + 4])
        pos += 4
        cursor_id, = _UNPACK_LONG(msg[pos:pos + 8])
        return OpGetMore(namespace=namespace, flags=flags, _client=client,
                         num_to_return=num_to_return, cursor_id=cursor_id,
                         request_id=request_id, _server=server)
576189
def unpack(fmt, arg):
    """"""

    if isinstance(arg, bytearray) and not (sys.version_info >= (2, 7, 5)):
        return struct.unpack(fmt, str(arg))

    return struct.unpack(fmt, arg)
1159837
def unpack(d):
    
    p = SBP._parser.parse(d)
    assert p.preamble == SBP_PREAMBLE, "Invalid preamble 0x%x." % p.preamble
    return SBP(p.msg_type, p.sender, p.length, p.payload, p.crc)
633859
def unpack(self, buff, offset=0):
        
        super().unpack(buff, offset)
        # Recover field from field_and_hasmask.
        try:
            self.oxm_field = self._unpack_oxm_field()
        except ValueError as exception:
            raise UnpackException(exception)

        # The last bit of field_and_mask is oxm_hasmask
        self.oxm_hasmask = (self.oxm_field_and_mask & 1) == 1  # as boolean

        # Unpack oxm_value that has oxm_length bytes
        start = offset + 4  # 4 bytes: class, field_and_mask and length
        end = start + self.oxm_length
        self.oxm_value = buff[start:end]