Pause Guard listening to file changes.
424441
def pause(expected = nil)
      paused = listener.paused?
      states = { paused: true, unpaused: false, toggle: !paused }
      pause = states[expected || :toggle]
      fail ArgumentError, "invalid mode: #{expected.inspect}" if pause.nil?
      return if pause == paused

      listener.public_send(pause ? :pause : :start)
      UI.info "File event handling has been #{pause ? 'paused' : 'resumed'}"
    end
517968
def watch(directory=None, auto_clear=False, extensions=[]):
    """"""
    if directory and not os.path.isdir(directory):
        raise ValueError('Directory not found: ' + directory)
    directory = os.path.abspath(directory)

    # Initial run
    event_handler = ChangeHandler(directory, auto_clear, extensions)
    event_handler.run()

    # Setup watchdog
    observer = Observer()
    observer.schedule(event_handler, path=directory, recursive=True)
    observer.start()

    # Watch and run tests until interrupted by user
    try:
        while True:
            time.sleep(1)
    except KeyboardInterrupt:
        observer.stop()
    observer.join()
278679
def pause_all(self):
        """"""
        for alias, service in self._service_objects.items():
            with expects.expect_no_raises(
                    'Failed to pause service "%s".' % alias):
                service.pause()
1189189
public function pause()
    {
        $this->paused = true;

        if($this->getProcess()->getPid() == getmypid()) {
            $this->getLogger()->notice('SIGUSR2 received; pausing job processing');
        }else{
            $this->getProcess()->kill(SIGUSR2);
        }

    }
1215021
def evt_toggle_pause(self, *args):  # pylint: disable=unused-argument
        """"""
        if self.event_source._timer is None:  # noqa: e501 pylint: disable=protected-access
            self.event_source.start()
        else:
            self.event_source.stop()
583453
function pause () {
        triggerEvent('pause');
        stopLoop(animationId);
        pausedAfter = startTime - performance.now();
        startTime = undefined;
        return self;
      }
1294448
def pause(self, uuid):
        
        args = {
            'uuid': uuid,
        }
        self._domain_action_chk.check(args)

        self._client.sync('kvm.pause', args)
1175047
def mute():
	'''
	'''

	# NOTE: mute != 0 volume

	if system.get_name() == 'windows':
		# TODO: Implement volume for Windows. Looks like WinAPI is the
		# solution...
		pass

	elif system.get_name() == 'mac':
		sp.Popen(['osascript', '-e', 'set volume output muted true']).wait()

	else:
		# Linux/Unix
		if unix_is_pulseaudio_server():
			sp.Popen(['amixer', '--quiet', '-D', 'pulse', 'sset',
					  'Master', 'mute']).wait()  # sset is *not* a typo

		else:
			sp.Popen(['amixer', '--quiet', 'sset', 'Master', 'mute']).wait()
848552
def resume(self):
        """"""
        directive = self._play_directive('REPLACE_ALL')
        directive['audioItem'] = self._audio_item()
        self._response['directives'].append(directive)
        return self
38801
async function pause() {
  if (gT.cLParams.selActsDelay) {
    await gT.u.promise.delayed(gT.cLParams.selActsDelay);
  }
}
46207
async def pause(self, pause: bool = True):
        
        self._paused = pause
        await self.node.pause(self.channel.guild.id, pause)
1320789
function watchFile(file, cb, partial) {
    setAbsolutePath(file);
    storeDirectory(file);
    if (!watched_files[file.fullPath]) {
      if (use_fs_watch) {
        (function() {
          watched_files[file.fullPath] = fs.watch(file.fullPath, function() {
            typeof cb === "function" && cb(file);
          });
          partial && cb(file);
        })(file, cb);
      } else {
        (function(file, cb) {
          watched_files[file.fullPath] = true;
          fs.watchFile(file.fullPath, {interval: 150}, function() {
            typeof cb === "function" && cb(file);
          });
          partial && cb(file);
        })(file, cb);
      }
    }
  }
1098015
public void pause() {
        checkState();
        if (mState == STATE_PLAYING) {
            PlaybackService.pause(getContext(), mClientKey);
            mState = STATE_PAUSED;
        }
    }
983834
def pause(env, identifier):
    """"""

    vsi = SoftLayer.VSManager(env.client)
    vs_id = helpers.resolve_id(vsi.resolve_ids, identifier, 'VS')

    if not (env.skip_confirmations or
            formatting.confirm('This will pause the VS with id %s. Continue?'
                               % vs_id)):
        raise exceptions.CLIAbort('Aborted.')

    env.client['Virtual_Guest'].pause(id=vs_id)
295130
public void onShutdown() {
        for (String listenerName : registeredFileListeners.keySet()) {
            logger.info("Deregistering File Listener: " + listenerName);
            FileListener listener = registeredFileListeners.get(listenerName);
            listener.stopListening();
        }
    }
567022
def play(self):
        """"""
        if self._proc.state() == QProcess.Running:
            if self.isPlaying is False:
                self._execute("pause")
                self._changePlayingState(True)
        elif self._filePath is not None:
            self._kill()
            self._run(self._filePath)
            self._changePlayingState(True)
514249
def handle_play_pause_clicked(self):
        
        if self.__hardware_source:
            if self.is_playing:
                self.__hardware_source.stop_playing()
            else:
                self.__hardware_source.start_playing()