given a bytes object, should return a base python data
        structure that represents the object.
763047
def load(raw_bytes):
        
        try:
            if not isinstance(raw_bytes, string_type):
                raw_bytes = raw_bytes.decode()
            return json.loads(raw_bytes)
        except ValueError as e:
            raise SerializationException(str(e))
350516
def load_bytes(buf, num, pos):
    """"""
    end = pos + num
    if end > len(buf):
        raise BadRarFile('cannot load bytes')
    return buf[pos : end], end
1161841
def array_bytes(array):
    
    return np.product(array.shape)*np.dtype(array.dtype).itemsize
289949
def get_bytes(self):
        """"""

        pq_io = BytesIO()
        serialize_string(pq_io, self.p)
        serialize_string(pq_io, self.q)

        ret = struct.pack("<I16s16s16sq", req_DH_params.constructor, self.nonce, self.server_nonce,
                          pq_io.getvalue(), self.public_key_fingerprint)

        bytes_io = BytesIO()
        bytes_io.write(ret)

        serialize_string(bytes_io, self.encrypted_data)

        return bytes_io.getvalue()
257951
def read_bytes(fd, byte_order, dtype, count):
    """"""
    return numpy.fromfile(fd, byte_order+dtype[-1], count).tostring()
133834
def from_bytes(self, raw):
        ''''''
        if len(raw) < UDP._MINLEN:
            raise NotEnoughDataError("Not enough bytes ({}) to reconstruct an UDP object".format(len(raw)))
        fields = struct.unpack(UDP._PACKFMT, raw[:UDP._MINLEN])
        self._src = fields[0]
        self._dst = fields[1]
        self._len = fields[2]
        self._checksum = fields[3]
        return raw[UDP._MINLEN:]
579391
def dumpb(obj, container_count=False, sort_keys=False, no_float32=True, default=None):
    """"""
    with BytesIO() as fp:
        dump(obj, fp, container_count=container_count, sort_keys=sort_keys, no_float32=no_float32, default=default)
        return fp.getvalue()
235103
def to_bytes(s, encoding=None, errors='strict'):
    """"""
    encoding = encoding or 'utf-8'

    if is_unicode(s):
        return s.encode(encoding, errors)
    elif is_strlike(s):
        return s
    else:
        if six.PY2:
            return str(s)
        else:
            return str(s).encode(encoding, errors)
438528
def byteify(input_object):
    
    if isinstance(input_object, dict):
        return {byteify(key): byteify(value)
                for key, value in list(input_object.items())}
    elif isinstance(input_object, list):
        return [byteify(element) for element in input_object]
    elif isinstance(input_object, str):
        return input_object.encode('utf-8')
    else:
        return input_object
61119
def get_bytes(self):
        """"""

        ret = struct.pack("<I16s16s", set_client_DH_params.constructor, self.nonce, self.server_nonce)

        bytes_io = BytesIO()
        bytes_io.write(ret)
        serialize_string(bytes_io, self.encrypted_data)

        return bytes_io.getvalue()
1303531
def loadb(b):
    """"""
    assert isinstance(b, (bytes, bytearray))
    return std_json.loads(b.decode('utf-8'))
849127
def to_bytes(self, obj, encoding=None):
        
        if encoding is None:
            encoding = self.encoding
        text = self.to_string(obj)
        return bytes_(text, encoding=self.encoding)
734314
def from_bytes(self, raw):
        ''''''
        if len(raw) < TCP._MINLEN:
            raise NotEnoughDataError("Not enough bytes ({}) to reconstruct an TCP object".format(len(raw)))
        fields = struct.unpack(TCP._PACKFMT, raw[:TCP._MINLEN])
        self._src = fields[0]
        self._dst = fields[1]
        self._seq = fields[2]        
        self._ack = fields[3]
        offset = fields[4] >> 12
        self._flags = fields[4] & 0x01ff
        self._window = fields[5]
        csum = fields[6]
        self._urg = fields[7]
        headerlen = offset * 4
        optlen = headerlen - TCP._MINLEN
        self._options.from_bytes(raw[TCP._MINLEN:headerlen])
        return raw[headerlen:]
418033
def from_blob(cls, blob):
        
        stream = BytesIO(blob)
        return cls._from_stream(stream, blob)
622181
def array_bytes(shape, dtype):
    
    return np.product(shape)*np.dtype(dtype).itemsize
216561
def _get_base(obj):
    """"""
    if hasattr(obj, '__func__'):
        obj = obj.__func__
    elif isinstance(obj, property):
        obj = obj.fget
    elif isinstance(obj, (classmethod, staticmethod)):
        # Fallback for Python < 2.7 back when no `__func__` attribute
        # was defined for those descriptors.
        obj = obj.__get__(None, object)
    else:
        return obj

    return _get_base(obj)
1181649
def of_bytes(self, py_bytes):
        
        m = self.hash_algo()
        m.update(py_bytes)
        if self.return_int:
            return int(m.hexdigest(), 16)
        else:
            return m.hexdigest()