def __init__(self, swift_proxy=None, swift_proxy_storage_path=None,
                 swift_proxy_cdn_path=None, attempts=5, eventlet=None,
                 chunk_size=65536, verbose=None, verbose_id='',
                 direct_object_ring=None):
        super(DirectClient, self).__init__()
        self.storage_path = swift_proxy_storage_path
        self.cdn_path = swift_proxy_cdn_path
        self.attempts = attempts
        self.chunk_size = chunk_size
        if verbose:
            self.verbose = lambda m, *a, **k: verbose(
                self._verbose_id + m, *a, **k)
        else:
            self.verbose = lambda *a, **k: None
        self.verbose_id = verbose_id
        self._verbose_id = self.verbose_id
        if self._verbose_id:
            self._verbose_id += ' '
        self.swift_proxy = swift_proxy
        if not swift_proxy:
            self.verbose('Creating default proxy instance.')
            import swift.proxy.server
            from swiftly.client.localmemcache import LocalMemcache
            from swiftly.client.nulllogger import NullLogger
            try:
                import swift.common.swob
                self.Request = swift.common.swob.Request
            except ImportError:
                import webob
                self.Request = webob.Request
            self.swift_proxy = swift.proxy.server.Application(
                {}, memcache=LocalMemcache(), logger=NullLogger())
            self.oring = None
            def get_oring(*args):
                return self.oring

            if direct_object_ring:
                self.oring = swift.common.ring.ring.Ring(direct_object_ring)
                self.swift_proxy.get_object_ring = get_oring

        if eventlet is None:
            try:
                import eventlet
                # Eventlet 0.11.0 fixed the CPU bug
                if eventlet.__version__ >= '0.11.0':
                    eventlet = True
            except __HOLE__:
                pass
        if eventlet:
            try:
                import eventlet
                self.sleep = eventlet.sleep
            except ImportError:
                import time
                self.sleep = time.sleep
        else:
            import time
            self.sleep = time.sleep
dataset/ETHPy150Open gholt/swiftly/swiftly/client/directclient.py/DirectClient.__init__