Snooze this incident for `duration` seconds.
334877
def snooze(self, from_email, duration):
        """"""
        if from_email is None or not isinstance(from_email, six.string_types):
            raise MissingFromEmail(from_email)

        endpoint = '/'.join((self.endpoint, self.id, 'snooze'))
        add_headers = {'from': from_email, }

        return self.__class__.create(
            endpoint=endpoint,
            api_key=self.api_key,
            add_headers=add_headers,
            data_key='duration',
            data=duration,
        )
1055780
def delay(self):
        ''''''
        if self._last_checked:
            return self._interval - (time.time() - self._last_checked)
        return self._interval
66564
def main(sleep_length=0.1):
    """"""
    log = logging.getLogger('sip.examples.log_spammer')

    log.info('Starting to spam log messages every %fs', sleep_length)
    counter = 0
    try:
        while True:
            log.info('Hello %06i (log_spammer: %s, sip logging: %s)',
                     counter, _version.__version__, __version__)
            counter += 1
            time.sleep(sleep_length)
    except KeyboardInterrupt:
        log.info('Exiting...')
1140405
def timeout(self, seconds=None):
        
        if seconds is None:
            self.socketIO.wait()
        else:
            self.socketIO.wait(seconds=seconds)
1115407
def snooze(self, requester, duration):
        
        path = '{0}/{1}/{2}'.format(self.collection.name, self.id, 'snooze')
        data = {"duration": duration}
        extra_headers = {"From": requester}
        return self.pagerduty.request('POST', path, data=_json_dumper(data), extra_headers=extra_headers)
487783
def pause(self):
        """"""
        if self.state == PygAnimation.PLAYING:
            self.elapsedAtPause = self.elapsed
            # only change state if it was playing
            self.state = PygAnimation.PAUSED

        elif self.state == PygAnimation.STOPPED:
            pass  # nothing to do

        elif self.state == PygAnimation.PAUSED:
            pass
15849
def stop(self) -> None:
        
        end_time = datetime.datetime.now()
        elapsed_time = end_time - self.start_time
        elapsed_seconds = elapsed_time.seconds
        hours, remainder = divmod(int(elapsed_seconds), 3600)
        minutes, seconds = divmod(remainder, 60)
        as_str = "%sh %sm %ss %dms" % (
            hours,
            minutes,
            seconds,
            elapsed_time.microseconds / 1000,
        )
        info("%s took %s" % (self.description, as_str))
1224617
async def sleep(self, duration: float=0.0) -> None:
        ''''''
        duration = max(0, duration)

        if duration > 0:
            Log.debug('sleeping task %s for %.1f seconds', self.name, duration)
            await asyncio.sleep(duration)
1101155
def responsive_sleep(self, seconds, wait_reason=''):
        """"""
        for x in xrange(int(seconds)):
            if (self.config.wait_log_interval and
                    not x % self.config.wait_log_interval):
                self.config.logger.debug(
                    '%s: %dsec of %dsec' % (wait_reason, x, seconds)
                )
            self.quit_check()
            time.sleep(1.0)
899240
def kill_after(seconds, timeout=2):
    """"""
    pid = os.getpid()
    kill = os.kill
    run_after_async(seconds, kill, pid, signal.SIGTERM)
    run_after_async(seconds + timeout, kill, pid, 9)
801476
def sleep(seconds=0):
    
    loop = evergreen.current.loop
    current = Fiber.current()
    assert loop.task is not current
    timer = loop.call_later(seconds, current.switch)
    try:
        loop.switch()
    finally:
        timer.cancel()
875508
def Sleep(self, timeout):
    """"""
    if self.nanny_controller:
      self.nanny_controller.Heartbeat()

    # Split a long sleep interval into 1 second intervals so we can heartbeat.
    while timeout > 0:
      time.sleep(min(1., timeout))
      timeout -= 1
      # If the output queue is full, we are ready to do a post - no
      # point in waiting.
      if self._out_queue.Full():
        return

      if self.nanny_controller:
        self.nanny_controller.Heartbeat()
25528
public static void sleep(int milliseconds) {

        try {
            Thread.sleep(milliseconds);
        } catch (InterruptedException e) {
            QuickUtils.log.e("Interrupted exception", e);
        }
    }
1112149
def until(timeout=10, step=0.5, action=None, silent=False):
    """"""
    yield

    started = time.time()
    while True:
        if action and not silent:
            log.info(action)

        if time.time() - started > timeout:
            if action and not silent:
                log.error("Timedout %s", action)
            return
        else:
            time.sleep(step)
            yield
712879
public static void sleep(long length, TimeUnit unit) {
		try {
			unit.sleep(length);
		} catch (InterruptedException e) {
			Thread.currentThread().interrupt();
		}
	}
1163917
def timeout(self, timeout):
        '''
        '''
        if self._timeout is None:
            self.event('connection_made').bind(self._add_timeout)
            self.event('connection_lost').bind(self._cancel_timeout)
        self._timeout = timeout or 0
        self._add_timeout(None)
55685
def take_break(minutes: hug.types.number=5):
    """"""
    print("")
    print("######################################### ARE YOU SURE? #####################################")
    try:
        for remaining in range(60, -1, -1):
            sys.stdout.write("\r")
            sys.stdout.write("{:2d} seconds to change your mind. Won't you prefer programming? Or a book?".format(remaining))
            sys.stdout.flush()
            time.sleep(1)
    except KeyboardInterrupt:
        print("")
        print("")
        print(":D :D :D\nGood on you! <3")
        return

    # The user insisted on breaking concentration.
    lose()
    print("")
    print("######################################### TAKING A BREAK ####################################")
    try:
        for remaining in range(minutes * 60, -1, -1):
            sys.stdout.write("\r")
            sys.stdout.write("{:2d} seconds remaining without concentration.".format(remaining))
            sys.stdout.flush()
            time.sleep(1)
    except KeyboardInterrupt:
        pass
    finally:
        sys.stdout.write("\rEnough distraction!                                                            \n")
        print("######################################### BREAK OVER :) #####################################")
        print("")
        improve()