Enable the plugin.

            Args:
                timeout (int): Timeout in seconds. Default: 0

            Raises:
                :py:class:`docker.errors.APIError`
                    If the server returns an error.
430199
def enable(self, timeout=0):
        
        self.client.api.enable_plugin(self.name, timeout)
        self.reload()
549576
def _timeout_to_float(self, timeout):
        
        if timeout is not None:
            try:
                timeout_float = float(timeout)
            except ValueError:
                raise ValueError(
                    'timeout_sec must be a valid number or None. timeout="{}"'.format(
                        timeout
                    )
                )
            if timeout_float:
                return timeout_float
731767
def timeout(seconds):
    
    def _timeout_error(signal, frame):
        raise TimeoutError("Operation did not finish within \
        {} seconds".format(seconds))

    def timeout_decorator(func):

        @wraps(func)
        def timeout_wrapper(*args, **kwargs):
            signal.signal(signal.SIGALRM, _timeout_error)
            signal.alarm(seconds)
            try:
                return func(*args, **kwargs)
            finally:
                signal.alarm(0)

        return timeout_wrapper

    return timeout_decorator
1236316
def _maybe_stop_timeout():
    
    global _timeout

    if _timeout is not None:
        LOGGER.debug('Removing the pending timeout (%r)', _timeout)
        ioloop.IOLoop.current().remove_timeout(_timeout)
        _timeout = None
473387
def set_timeout(self, visibility_timeout, callback=None):
        
        def _set_timeout(retval):
            if retval:
              self.visibility_timeout = visibility_timeout
            if callable(callback):
                callback(retval)
        retval = self.set_attribute('VisibilityTimeout', visibility_timeout, callback=_set_timeout)
1095026
def run(self, timeout = 0):
        
        ptimeout = float(
            timeout.microseconds/1000000+timeout.seconds if timeout
            else (self.resolution if timeout is None else 0)
        )
        if self.tokens:
            events = self.kcontrol(None, self.default_size, ptimeout)
            len_events = len(events)-1
            for nr, ev in enumerate(events):
                fd = ev.ident
                act = self.shadow.pop(fd)

                if ev.flags & KQ_EV_ERROR:
                    self.kcontrol((kevent(fd, act.flags, KQ_EV_DELETE),), 0)
                    self.handle_error_event(act, 'System error %s.'%ev.data)
                else:
                    if nr == len_events:
                        ret = self.yield_event(act)
                        if not ret:
                            ev.flags = KQ_EV_ADD | KQ_EV_ONESHOT
                            self.kcontrol((ev,), 0)
                            self.shadow[fd] = act
                        return ret
                    else:
                        if not self.handle_event(act):
                            ev.flags = KQ_EV_ADD | KQ_EV_ONESHOT
                            self.kcontrol((ev,), 0)
                            self.shadow[fd] = act
        else:
            sleep(timeout)
905326
def retry_timeout(api, retries=3):
    """"""
    @wraps(api)
    def retry_api(*args, **kwargs):
        """Retrying API."""
        for i in range(1, retries + 1):
            try:
                return api(*args, **kwargs)
            except RequestTimeout:
                if i == retries:
                    raise

    return retry_api
93185
def wait(self, timeout):
        
        self.timeout = timeout
        self.start()
        self.join(timeout=5)
387473
def _flush_timeout(self, timeout):
        
        future = tornado.concurrent.Future()
        yield self._send_ping(future)
        try:
            result = yield tornado.gen.with_timeout(
                timedelta(seconds=timeout), future)
        except tornado.gen.TimeoutError:
            # Set the future to False so it can be ignored in _process_pong,
            # and try to remove from the list of pending pongs.
            future.set_result(False)
            for i, pong_future in enumerate(self._pongs):
                if pong_future == future:
                    del self._pongs[i]
                    break
            raise
        raise tornado.gen.Return(result)
1279387
def readout(self, *args, **kwargs):
        ''' 
        '''
        timeout = kwargs.pop('timeout', 10.0)
        self.start_readout(*args, **kwargs)
        try:
            yield
        finally:
            try:
                self.stop_readout(timeout=timeout)
            except Exception:
                # in case something fails, call this on last resort
                # if run was aborted, immediately stop readout
                if self.abort_run.is_set():
                    with self._readout_lock:
                        if self.fifo_readout.is_running:
                            self.fifo_readout.stop(timeout=0.0)
535799
def open_timeout=(value)
      fail ArgumentError, "must be an integer or float" unless value && (value.is_a?(Integer) || value.is_a?(Float))
      @open_timeout = value
    end
210315
def start(self, timeout=None):
        
        if not self._ioloop:
            raise RuntimeError('Call get_ioloop() or set_ioloop() first')

        self._ioloop.add_callback(self._running.set)

        if self._ioloop_managed:
            self._run_managed_ioloop()
        else:            #  TODO this seems inconsistent with what the docstring describes
            self._running.set()

        if timeout:
            return self._running.wait(timeout)
1270766
def _on_timeout(self, key: object, info: str = None) -> None:
        
        request, callback, timeout_handle = self.waiting[key]
        self.queue.remove((key, request, callback))

        error_message = "Timeout {0}".format(info) if info else "Timeout"
        timeout_response = HTTPResponse(
            request,
            599,
            error=HTTPTimeoutError(error_message),
            request_time=self.io_loop.time() - request.start_time,
        )
        self.io_loop.add_callback(callback, timeout_response)
        del self.waiting[key]
1222277
def timeout(self, timeout):
        
        clone = copy.deepcopy(self)
        clone._timeout = timeout
        return clone
1150903
def client_pause(self, timeout):
        
        if not isinstance(timeout, int):
            raise TypeError("timeout argument must be int")
        if timeout < 0:
            raise ValueError("timeout must be greater equal 0")
        fut = self.execute(b'CLIENT', b'PAUSE', timeout)
        return wait_ok(fut)
969814
def _call_api(self, api_url, err_env):
        
        while True:  # may retry on error
            api_request = urllib2.Request(
                api_url, headers={"Accept-Encoding": "gzip"})

            log.debug("Amazon URL: %s" % api_url)

            try:
                if self.Timeout and sys.version[:3] in ["2.4", "2.5"]:
                    # urllib2.urlopen() doesn't accept timeout until 2.6
                    old_timeout = socket.getdefaulttimeout()
                    try:
                        socket.setdefaulttimeout(self.Timeout)
                        return urllib2.urlopen(api_request)
                    finally:
                        socket.setdefaulttimeout(old_timeout)
                else:
                    # the simple way
                    return urllib2.urlopen(api_request, timeout=self.Timeout)
            except:
                if not self.ErrorHandler:
                    raise

                exception = sys.exc_info()[1]  # works in Python 2 and 3
                err = {'exception': exception}
                err.update(err_env)
                if not self.ErrorHandler(err):
                    raise
856120
def timeout_error(url, timeout):
    """"""
    msg = 'Request timed out: {} timeout: {}s'.format(url, timeout)
    log.warning(msg)
    return ServerError(msg)