# Path: opendiamond/helpers.py
# def murmur(data):
#     '''Return a lower-case hex string representing the MurmurHash3-x64-128
#     hash of the specified data using the seed 0xbb40e64d (the first 10
#     digits of pi, in hex).'''
#     return mmh3.hash_bytes(data, 314159).hex()
# 
# def split_scheme(url):
#     if sys.version_info[0:3] == (2, 7, 1) and url.startswith('sha256:'):
#         return url.split(':')
# 
#     parts = urlparse(url)
#     return (parts.scheme, parts.path)
# 
# Path: opendiamond/protocol.py
# class XDR_attribute(XDRStruct):
#     '''An object attribute'''
#     members = (
#         'name', XDR.string(),
#         'value', XDR.opaque(),
#     )
# 
# class XDR_object(XDRStruct):
#     '''Blast channel object data'''
#     members = (
#         'attrs', XDR.array(XDR.struct(XDR_attribute)),
#     )


from future import standard_library
from builtins import str
from builtins import object
from io import BytesIO
from urllib.parse import urljoin
from opendiamond.helpers import murmur, split_scheme
from opendiamond.protocol import XDR_attribute, XDR_object
import logging
import simplejson as json
import pycurl as curl
import xmltodict

        if src:
            self.src = src
        if meta:
            self.meta = meta

        # Set default attributes
        self[ATTR_DEVICE_NAME] = server_id + '\0'
        self[ATTR_OBJ_ID] = url + '\0'

    def __str__(self):
        '''Return the object ID.'''
        return self._id

    def __repr__(self):
        return '<Object %s>' % self

    def __setitem__(self, key, value):
        self._attrs[key] = value
        if self._compute_signature:
            self._signatures[key] = murmur(value)
        else:
            self._signatures[key] = 0


class _HttpLoader(object):
    '''A context for loading Object data via HTTP.  Caches and reuses HTTP
    connections.  Must not be used by more than one thread.'''

    def __init__(self, config):

# Path: opendiamond/helpers.py
# def murmur(data):
#     '''Return a lower-case hex string representing the MurmurHash3-x64-128
#     hash of the specified data using the seed 0xbb40e64d (the first 10
#     digits of pi, in hex).'''
#     return mmh3.hash_bytes(data, 314159).hex()
# 
# def split_scheme(url):
#     if sys.version_info[0:3] == (2, 7, 1) and url.startswith('sha256:'):
#         return url.split(':')
# 
#     parts = urlparse(url)
#     return (parts.scheme, parts.path)
# 
# Path: opendiamond/protocol.py
# class XDR_attribute(XDRStruct):
#     '''An object attribute'''
#     members = (
#         'name', XDR.string(),
#         'value', XDR.opaque(),
#     )
# 
# class XDR_object(XDRStruct):
#     '''Blast channel object data'''
#     members = (
#         'attrs', XDR.array(XDR.struct(XDR_attribute)),
#     )


# Path: opendiamond/server/object_.py
from future import standard_library
from builtins import str
from builtins import object
from io import BytesIO
from urllib.parse import urljoin
from opendiamond.helpers import murmur, split_scheme
from opendiamond.protocol import XDR_attribute, XDR_object
import logging
import simplejson as json
import pycurl as curl
import xmltodict


        if src:
            self.src = src
        if meta:
            self.meta = meta

        # Set default attributes
        self[ATTR_DEVICE_NAME] = server_id + '\0'
        self[ATTR_OBJ_ID] = url + '\0'

    def __str__(self):
        '''Return the object ID.'''
        return self._id

    def __repr__(self):
        return '<Object %s>' % self

    def __setitem__(self, key, value):
        self._attrs[key] = value
        if self._compute_signature:
            self._signatures[key] = murmur(value)
        else:
            self._signatures[key] = 0


class _HttpLoader(object):
    '''A context for loading Object data via HTTP.  Caches and reuses HTTP
    connections.  Must not be used by more than one thread.'''

    def __init__(self, config):

        self._curl = curl.Curl()