Accepts normal responses from the device.

        Args:
          timeout_ms: Timeout in milliseconds to wait for each response.
          info_cb: Optional callback for text sent from the bootloader.

        Returns:
          OKAY packet's message.
550627
def HandleSimpleResponses(
            self, timeout_ms=None, info_cb=DEFAULT_MESSAGE_CALLBACK):
        
        return self._AcceptResponses(b'OKAY', info_cb, timeout_ms=timeout_ms)
1083161
def get_timeout(service):
    
    custom_timeout_key = "RESTCLIENTS_%s_TIMEOUT" % service.upper()
    if hasattr(settings, custom_timeout_key):
        return getattr(settings, custom_timeout_key)

    default_key = "RESTCLIENTS_DEFAULT_TIMEOUT"
    if hasattr(settings, default_key):
        return getattr(settings, default_key)

    return OLD_DEFAULT_TIMEOUT
52012
def _packet_timeout(self, packet, now):
        
        if now >= packet["timeout"]:
            # timed out
            return False

        if now >= packet["resend"]:
            # resend command
            self._send_command(packet)
            return False

        # keep packet
        return True
904197
def getSystemInfo(self, timeout=1):
        
        namespace = System.getServiceType("getSystemInfo")
        uri = self.getControlURL(namespace)

        results = self.execute(uri, namespace, "GetInfo", timeout=timeout)

        return SystemInfo(results)
250709
def _can_read(self):
        
        if self.__sock is None:
            return None
        if select.select([self.__sock], [], [], self.__timeout)[0]:
            return True
        else:
            self.__last_error = const.MB_TIMEOUT_ERR
            self.__debug_msg('timeout error')
            self.close()
            return None
1318071
def uptime
      send_message!(Protocol::Device::GetInfo.new,
         wait_for: Protocol::Device::StateInfo) do |payload|
        payload.uptime.to_f / NSEC_IN_SEC
      end
    end
612318
def timeout_per_mb(seconds_per_mb, size_bytes):
    
    result = seconds_per_mb * (size_bytes / 1e6)
    if result < DEFAULT_TIMEOUT:
        return DEFAULT_TIMEOUT
    return result
1116337
def get_timeout(self, callback=None):
        
        def got_timeout(a):
            if callable(callback):
                callback(int(a['VisibilityTimeout']))
        self.get_attributes('VisibilityTimeout', callback=got_timeout)
1174263
def check_command(self, op_description, op=None, data=b'', chk=0, timeout=DEFAULT_TIMEOUT):
        
        val, data = self.command(op, data, chk, timeout=timeout)

        # things are a bit weird here, bear with us

        # the status bytes are the last 2/4 bytes in the data (depending on chip)
        if len(data) < self.STATUS_BYTES_LENGTH:
            raise FatalError("Failed to %s. Only got %d byte status response." % (op_description, len(data)))
        status_bytes = data[-self.STATUS_BYTES_LENGTH:]
        # we only care if the first one is non-zero. If it is, the second byte is a reason.
        if byte(status_bytes, 0) != 0:
            raise FatalError.WithResult('Failed to %s' % op_description, status_bytes)

        # if we had more data than just the status bytes, return it as the result
        # (this is used by the md5sum command, maybe other commands?)
        if len(data) > self.STATUS_BYTES_LENGTH:
            return data[:-self.STATUS_BYTES_LENGTH]
        else:  # otherwise, just return the 'val' field which comes from the reply header (this is used by read_reg)
            return val
727040
def wait_for_text(text,
                      timeout: Calabash::Wait.default_options[:timeout],
                      timeout_message: nil,
                      retry_frequency: Calabash::Wait.default_options[:retry_frequency])

      wait_for_view("* {text CONTAINS[c] '#{text}'}",
                    timeout: timeout,
                    timeout_message: timeout_message,
                    retry_frequency: retry_frequency)
    end
768046
def wait_for_signal(self, timeout=None):
		
		timeout_ms = int(timeout * 1000) if timeout else win32event.INFINITE
		win32event.WaitForSingleObject(self.signal_event, timeout_ms)
771609
def default_callback(pending, timeout):
    

    def echo(msg):
        sys.stderr.write(msg + "\n")

    echo("Sentry is attempting to send %i pending error messages" % pending)
    echo("Waiting up to %s seconds" % timeout)
    echo("Press Ctrl-%s to quit" % (os.name == "nt" and "Break" or "C"))
    sys.stderr.flush()
681951
def do_timeout(self, args):
        

        if not self.current:
            print('There are no resources in use. Use the command "open".')
            return

        args = args.strip()

        if not args:
            try:
                print('Timeout: {}ms'.format(self.current.timeout))
            except Exception as e:
                print(e)
        else:        
            args = args.split(' ')
            try:
                self.current.timeout = float(args[0])
                print('Done')
            except Exception as e:
                print(e)
157700
def add_timeout_callback(self, callback, timeout_milliseconds, callback_id=None):
        
        def wrapper(*args, **kwargs):
            self.remove_timeout_callback(callback_id)
            return callback(*args, **kwargs)

        handle = None

        def remover():
            if handle is not None:
                self._loop.remove_timeout(handle)

        callback_id = self._assign_remover(callback, callback_id, self._timeout_callback_removers, remover)
        handle = self._loop.call_later(timeout_milliseconds / 1000.0, wrapper)
        return callback_id
736760
def result(self, timeout=None):
        
        if self.done:
            return self._result

        result = self.conn.process_packets(transaction_id=self.transaction_id,
                                           timeout=timeout)

        self._result = result
        self.done = True

        return result
1195867
def recv_all(self, timeout='default'):
        

        self._print_recv_header('======== Receiving until close{timeout_text} ========', timeout)

        return self._recv_predicate(lambda s: 0, timeout, raise_eof=False)
1264319
def _handle_timeout(self, msg_id, start_time):
        
        msg, reply_cb, inform_cb, user_data, timeout_handle = \
            self._pop_async_request(msg_id, None)
        # We may have been racing with the actual reply handler if the reply
        # arrived close to the timeout expiry,
        # which means the self._pop_async_request() call gave us None's.
        # In this case, just bail.
        #
        # NM 2014-09-17 Not sure if this is true after porting to tornado,
        # but I'm too afraid to remove this code :-/
        if timeout_handle is None:
            return

        reason = "Request {0.name} timed out after {1:f} seconds.".format(
            msg, self.ioloop.time() - start_time)
        self._do_fail_callback(
            reason, msg, reply_cb, inform_cb, user_data, timeout_handle)