Stop the stream and terminate PyAudio
355760
def stop(self):
        """"""
        self.prestop()
        if not self._graceful:
            self._graceful = True
        self.stream.stop_stream()
        self.audio.terminate()
        msg = 'Stopped'
        self.verbose_info(msg, log=False)
        # Log 'Stopped' anyway
        if self.log:
            self.logging.info(msg)
        if self.collect:
            if self._data:
                print('Collected result:')
                print('    min: %10d' % self._data['min'])
                print('    max: %10d' % self._data['max'])
                print('    avg: %10d' % int(self._data['avg']))
        self.poststop()
578340
function() {
      var self = this;
      var limit = self._pool;
      var cnt = 0;
      var i = 0;

      // If there are less sounds than the max pool size, we are done.
      if (self._sounds.length < limit) {
        return;
      }

      // Count the number of inactive sounds.
      for (i=0; i<self._sounds.length; i++) {
        if (self._sounds[i]._ended) {
          cnt++;
        }
      }

      // Remove excess inactive sounds, going in reverse order.
      for (i=self._sounds.length - 1; i>=0; i--) {
        if (cnt <= limit) {
          return;
        }

        if (self._sounds[i]._ended) {
          // Disconnect the audio source when using Web Audio.
          if (self._webAudio && self._sounds[i]._node) {
            self._sounds[i]._node.disconnect(0);
          }

          // Remove sounds until we have the pool size.
          self._sounds.splice(i, 1);
          cnt--;
        }
      }
    }
572682
def stop(self):
        """"""

        if self._disconnector:
            self._disconnector.stop()

        self.client.disconnect()
1108601
def stop_listener_thread(self):
        
        if self.sync_thread:
            self.should_listen = False
            self.sync_thread.join()
            self.sync_thread = None
285022
def __stop(self):  # pragma: no cover
        """"""

        if not self._listener_thread:
            return

        logger.info('Stopping listener')
        self._celery_receiver.should_stop = True
        self._listener_thread.join()
        self._listener_thread = self._celery_receiver = None
946125
def stop_capture(self):
        
        if self._process is None:
            raise sniffer.InvalidOperationError(
                                      "Trying to stop a non-started process")
        utils.stop_standing_subprocess(self._process, kill_signal=signal.SIGINT)
        self._post_process()
261690
def stop_receive(self, stream):
        
        _vv and IOLOG.debug('%r.stop_receive(%r)', self, stream)
        self.defer(self.poller.stop_receive, stream.receive_side.fd)
1010316
def close(self):
        

        self._no_mute_on_stop_playback()

        # First close the subprocess
        self._stop()

        # Here is fallback solution and cleanup
        if self.connection_timeout_thread is not None:
            self.connection_timeout_thread.cancel()
        if self.delay_thread is not None:
            self.delay_thread.cancel()
        if self.process is not None:
            os.kill(self.process.pid, 15)
            self.process.wait()
        self.process = None
11032
def terminate(self):
        
        try:
            self.send_signal(signal.SIGTERM)
        except pyuv.error.ProcessError as e:
            if e.args[0] != pyuv.errno.UV_ESRCH:
                raise
834591
function stopAudioCapture() {

        // Disconnect media source node from script processor
        if (source)
            source.disconnect();

        // Disconnect associated script processor node
        if (processor)
            processor.disconnect();

        // Stop capture
        if (mediaStream) {
            var tracks = mediaStream.getTracks();
            for (var i = 0; i < tracks.length; i++)
                tracks[i].stop();
        }

        // Remove references to now-unneeded components
        processor = null;
        source = null;
        mediaStream = null;

        // End stream
        writer.sendEnd();

    }
954533
def stop(self):
        '''
        
        '''
        assert(self.model)
        assert(self.user_interface)
        assert(self.target)
        self.user_interface.stop()
        self.target.teardown()
        self.dataman.submit_task(None)
        self._un_set_signal_handler()
861772
def close(self):
        """"""
        if not self.closed:
            check(_coreaudio.ExtAudioFileDispose(self._obj))
            self.closed = True
1180217
def stop(self):
        
        should_sleep = self._is_running
        super(Sensor, self).stop()
        if should_sleep:
            # Make sure everything has enough time to exit
            time.sleep(max(self._select_timeout, self._retransmit_timeout) + 1)
        if self._listen_socket is not None:
            self._shutdown_listen_socket()
137613
def stop(self):
        '''
        
        '''
        log.info('Stopping te kafka listener class')
        self.consumer.unsubscribe()
        self.consumer.close()
124605
def stop(self, dummy_signum=None, dummy_frame=None):
        
        logging.info('Shutting down ...')
        self.socket.close()
        sys.exit(0)
1247756
async def stop(self):
        """"""
        await self._command_task.future_command(['_set_mode', 0, 0])  # Disable advertising
        await self._cleanup_old_connections()

        self._command_task.stop()
        self._stream.stop()
        self._serial_port.close()

        await super(BLED112Server, self).stop()
427667
def stop(self):
        
        # check that everything is running
        if not self._running:
            logging.warning('Realsense not running. Aborting stop.')
            return False

        self._pipe.stop()
        self._running = False
        return True