Open a volafile room and start listening to it
507825
def listen(room):
    """"""
    def onmessage(m):
        """Print the new message and respond to it."""
        print(m)
        if m.admin or m.nick == r.user.name:
            return
        if "parrot" in m.msg.lower():
            r.post_chat("ayy lmao")
        elif m.msg.lower() in ("lol", "lel", "kek"):
            r.post_chat("*kok")
        else:
            r.post_chat(re.sub(r"\blain\b", "purpleadmin", m.msg, re.I))

    with Room(room) as r:
        r.user.change_nick("DumbParrot")
        r.add_listener("chat", onmessage)
        r.listen()
1211990
def start(self):
        """"""
        self._lc = LoopingCall(self._download)
        # Run immediately, and then every 30 seconds:
        self._lc.start(30, now=True)
505242
async def vafter(self):
        """"""
        self.logger.debug("Finished playing a song")
        if self.state != 'ready':
            self.logger.debug("Returning because player is in state {}".format(self.state))
            return

        self.pause_time = None

        if self.vclient_task:
            loop = asyncio.get_event_loop()
            loop.call_soon(self.vclient_task.cancel)
            self.vclient_task = None

        try:
            if self.streamer is None:
                await self.stop()
                return

            if self.streamer.error is None:
                await self.vplay()
            else:
                self.statuslog.error(self.streamer.error)
                await self.destroy()
        except Exception as e:
            logger.exception(e)
            try:
                await self.destroy()
            except Exception as e:
                logger.exception(e)
914765
void onJoinStart()
  {
    //long now = CurrentTime.getCurrentTime();
    ArrayList<UpdatePod> updatePods = new ArrayList<>();
    
    updateClusterRoot();

    /*
    for (UpdatePod updatePod : _podUpdateMap.values()) {
      if (updatePod.getSequence() == 0) {
        updatePods.add(new UpdatePod(updatePod, now));
      }
    }
    */
    
    /*
    for (UpdatePod updatePod : updatePods) {
      updatePod(updatePod);
    }
    */
    
    updatePods.addAll(_podUpdateMap.values());
    
    for (UpdatePod updatePod : updatePods) {
      updatePod(updatePod);
    }
    
    // XXX:
  }
222009
def start(self):
        
        plugins = voltron.plugin.pm.web_plugins
        self.app = DispatcherMiddleware(
            RootFlaskApp(),
            {
                "/api": APIFlaskApp(server=self),
                "/view": SharedDataMiddleware(
                    None,
                    {'/{}'.format(n): os.path.join(p._dir, 'static') for (n, p) in six.iteritems(plugins)}
                ),
                "/ui": ui_app
            }
        )

        def run_listener(name, cls, arg):
            # with pysigset.suspended_signals(signal.SIGCHLD):
            log.debug("Starting listener for {} socket on {}".format(name, str(arg)))
            s = cls(*arg)
            t = threading.Thread(target=s.serve_forever)
            t.daemon = True
            t.start()
            self.threads.append(t)
            self.listeners.append(s)

        if voltron.config.server.listen.tcp:
            run_listener('tcp', ThreadedVoltronWSGIServer, list(voltron.config.server.listen.tcp) + [self.app])

        if voltron.config.server.listen.domain and sys.platform != 'win32':
            path = os.path.expanduser(str(voltron.config.server.listen.domain))
            try:
                os.unlink(path)
            except:
                pass
            run_listener('domain', ThreadedUnixWSGIServer, [path, self.app])

        self.is_running = True
292848
def rooms(status=None):
    """"""

    room_query = VCRoom.find(type='vidyo')
    table_data = [['ID', 'Name', 'Status', 'Vidyo ID', 'Extension']]

    if status:
        room_query = room_query.filter(VCRoom.status == VCRoomStatus.get(status))

    for room in room_query:
        table_data.append([unicode(room.id), room.name, room.status.name,
                           unicode(room.data['vidyo_id']), unicode(room.vidyo_extension.extension)])

    table = AsciiTable(table_data)
    for col in (0, 3, 4):
        table.justify_columns[col] = 'right'
    print table.table
774068
def Start(self):
    """"""
    if self._heapy:
      self._heapy.setrelheap()

      try:
        os.remove(self._sample_file)
      except OSError:
        pass
516932
def enter_room(self, sid, namespace, room):
        """"""
        if namespace not in self.rooms:
            self.rooms[namespace] = {}
        if room not in self.rooms[namespace]:
            self.rooms[namespace][room] = {}
        self.rooms[namespace][room][sid] = True
1328068
function() {
		var api_url,
			self = this;

		// Create Dom element
		this._el.content_item	= TL.Dom.create("div", "tl-media-item tl-media-iframe tl-media-soundcloud tl-media-shadow", this._el.content);

		// Get Media ID
		this.media_id = this.data.url;

		// API URL
		api_url = "https://soundcloud.com/oembed?url=" + this.media_id + "&format=js&callback=?"

		// API Call
		TL.getJSON(api_url, function(d) {
			TL.Load.js("https://w.soundcloud.com/player/api.js", function() {//load soundcloud api for pausing.
				self.createMedia(d);
			});
		});

	}
95214
function(index) {
    var self = this;
    var sound;

    index = typeof index === 'number' ? index : self.index;
    var data = self.playlist[index];

    // If we already loaded this track, use the current one.
    // Otherwise, setup and load a new Howl.
    if (data.howl) {
      sound = data.howl;
    } else {
      sound = data.howl = new Howl({
        src: ['./audio/' + data.file + '.webm', './audio/' + data.file + '.mp3'],
        html5: true, // Force to HTML5 so that the audio can stream in (best for large files).
        onplay: function() {
          // Display the duration.
          duration.innerHTML = self.formatTime(Math.round(sound.duration()));

          // Start upating the progress of the track.
          requestAnimationFrame(self.step.bind(self));

          // Start the wave animation if we have already loaded
          wave.container.style.display = 'block';
          bar.style.display = 'none';
          pauseBtn.style.display = 'block';
        },
        onload: function() {
          // Start the wave animation.
          wave.container.style.display = 'block';
          bar.style.display = 'none';
          loading.style.display = 'none';
        },
        onend: function() {
          // Stop the wave animation.
          wave.container.style.display = 'none';
          bar.style.display = 'block';
          self.skip('next');
        },
        onpause: function() {
          // Stop the wave animation.
          wave.container.style.display = 'none';
          bar.style.display = 'block';
        },
        onstop: function() {
          // Stop the wave animation.
          wave.container.style.display = 'none';
          bar.style.display = 'block';
        },
        onseek: function() {
          // Start upating the progress of the track.
          requestAnimationFrame(self.step.bind(self));
        }
      });
    }

    // Begin playing the sound.
    sound.play();

    // Update the track display.
    track.innerHTML = (index + 1) + '. ' + data.title;

    // Show the pause button.
    if (sound.state() === 'loaded') {
      playBtn.style.display = 'none';
      pauseBtn.style.display = 'block';
    } else {
      loading.style.display = 'block';
      playBtn.style.display = 'none';
      pauseBtn.style.display = 'none';
    }

    // Keep track of the index we are currently playing.
    self.index = index;
  }
1147473
def start(self):
        

        # Spawn the listening thread
        self.listen_thread = eventlet.spawn_n(self.listen)

        # Now do the initial load
        self.reload()
126113
def set_volume(self, volume):
        """"""
        if volume > 100 or volume < 0:
            raise Exception('Bad request to volume control. '
                            'Must be between 0 and 100')
        params = ('<InstanceID>0</InstanceID><Channel>Master</Channel>'
                  '<DesiredVolume>{}</DesiredVolume>').format(volume)
        self.soap_request(URL_CONTROL_DMR, URN_RENDERING_CONTROL,
                          'SetVolume', params)
242427
private void playTrack(SoundCloudTrack track) {
        pauseTimer();
        try {
            // acquire lock on wifi.
            mWifiLock.acquire();

            mIsPaused = false;
            mIsPausedAfterAudioFocusChanged = false;
            mHasAlreadyPlayed = true;

            // 1 - UPDATE ALL VISUAL CALLBACK FIRST TO IMPROVE USER EXPERIENCE

            updateNotification();
            // update playback state as well as meta data.
            mMediaSession.setPlaybackState(MediaSessionWrapper.PLAYBACK_STATE_PLAYING);
            // start loading of the artwork.
            loadArtwork(this,
                    SoundCloudArtworkHelper.getArtworkUrl(track, SoundCloudArtworkHelper.XXXLARGE));
            // broadcast events
            Intent intent = new Intent(PlaybackListener.ACTION_ON_TRACK_PLAYED);
            intent.putExtra(PlaybackListener.EXTRA_KEY_TRACK, track);
            mLocalBroadcastManager.sendBroadcast(intent);
            Intent bufferingStart = new Intent(PlaybackListener.ACTION_ON_BUFFERING_STARTED);
            mLocalBroadcastManager.sendBroadcast(bufferingStart);

            // 2 - THEN PREPARE THE TRACK STREAMING

            // set media player to stop state in order to be able to call prepare.
            mMediaPlayer.reset();

            // set new data source
            mMediaPlayer.setDataSource(track.getStreamUrl() + SOUND_CLOUD_CLIENT_ID_PARAM
                    + mSoundCloundClientId);

            // Try to gain the audio focus before preparing and starting the media player.
            if (mAudioManager.requestAudioFocus(this, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN)
                    == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
                // prepare asynchronously the stream to be able to handle new action on the
                // service thread such as a pause command.
                mIsPreparing = true;
                mMediaPlayer.prepareAsync();
            }

        } catch (IOException e) {
            Log.e(TAG, "File referencing not exist : " + track);
        }
    }
995857
def run(self):
		
		if not hasattr(self, 'queue'):
			raise RuntimeError("Audio queue is not intialized.")

		chunk = None
		channel = None
		self.keep_listening = True
		while self.keep_listening:
			if chunk is None:
				try:
					frame = self.queue.get(timeout=queue_timeout)
					chunk = pygame.sndarray.make_sound(frame)
				except Empty:
					continue

			if channel is None:
				channel = chunk.play()
			else:
				if not channel.get_queue():	
					channel.queue(chunk)
					chunk = None
			time.sleep(0.005)
		
		if not channel is None and pygame.mixer.get_init():
			channel.stop()
			pygame.mixer.quit()
25551
def room(id, &callback)
      http(:get, "/room/#{id}.json") do |data, http|
        Firering::Room.instantiate(self, data, :room, &callback)
      end
    end
1272343
def play_next(self, stream_url=None, offset=0, opaque_token=None):
        """"""

        directive = self._play_directive('REPLACE_ENQUEUED')
        directive['audioItem'] = self._audio_item(stream_url=stream_url, offset=offset, opaque_token=opaque_token)
        self._response['directives'].append(directive)
        return self
506801
def listen(self, markAlive=None):
        
        if markAlive is not None:
            self.setActiveStatus(markAlive)

        self.startListening()
        self.onListening()

        while self.listening and self.doOneListen():
            pass

        self.stopListening()