:class:`Song` object of next song to play
968469
def song(self):
        
        song = self._connection.request(
            'autoplayGetSong',
            {'weightModifierRange': [-9, 9],
             'seedArtists': dict([(artist, 'p') for artist in self._artists]),
             'tagID': self._radio,
             'recentArtists': self._recent_artists,
             'songQueueID': self._connection.session.queue,
             'secondaryArtistWeightModifier': 0.75,
             'country': self._connection.session.country,
             'seedArtistWeightRange': [110, 130],
             'songIDsAlreadySeen': self._songs_already_seen,
             'maxDuration': 1500,
             'minDuration': 60,
             'frowns': []},
            self._connection.header('autoplayGetSong', 'jsqueue'))[1]
        return Song(
            song['SongID'], song['SongName'], song['ArtistID'],
            song['ArtistName'], song['AlbumID'], song['AlbumName'],
            song['CoverArtUrl'], None, song['EstimateDuration'], None,
            self._connection)
423351
def run_mp(songs):
    
    stats = Stats()
    if CONFIG['debug']:
        good = open('found', 'w')
        bad = open('notfound', 'w')

    logger.debug('Launching a pool of %d processes\n', CONFIG['jobcount'])
    chunksize = math.ceil(len(songs) / os.cpu_count())
    try:
        with Pool(CONFIG['jobcount']) as pool:
            for result in pool.imap_unordered(get_lyrics, songs, chunksize):
                if result is None:
                    continue

                for source, runtime in result.runtimes.items():
                    stats.add_result(source, result.source == source, runtime)

                found = process_result(result)
                if CONFIG['debug']:
                    if found:
                        good.write(f'{id_source(source)}: {result.song}\n')
                        good.flush()
                    else:
                        bad.write(str(result.song) + '\n')
                        bad.flush()

    finally:
        if CONFIG['debug']:
            good.close()
            bad.close()

    return stats
287035
def _next_class(cls):
        
        return next(
            class_
            for class_ in cls.__mro__
            if not issubclass(class_, Multi)
        )
644053
def next(self):
        """"""
        self._response['shouldEndSession'] = True
        self._response['action']['audio']['interface'] = 'next'
        self._response['action']['audio']['sources'] = []
        return self
858596
def playlist
      @_playlist ||= if playlists.any?
                       key, value = playlists.first
                       value
                     else
                       Playlist.new("Default")
                     end
    end
1013856
def songs(self, *, uploaded=True, purchased=True):
		

		if not uploaded and not purchased:
			raise ValueError("'uploaded' and 'purchased' cannot both be False.")

		if purchased and uploaded:
			song_list = []
			for chunk in self.songs_iter(export_type=1):
				song_list.extend(chunk)
		elif purchased:
			song_list = []
			for chunk in self.songs_iter(export_type=2):
				song_list.extend(chunk)
		elif uploaded:
			purchased_songs = []
			for chunk in self.songs_iter(export_type=2):
				purchased_songs.extend(chunk)

			song_list = [
				song
				for chunk in self.songs_iter(export_type=1)
				for song in chunk
				if song not in purchased_songs
			]

		return song_list
858940
function play(name) {
        if (name === 'list') {
            return Object.keys(audio);
        }
        if (!(name in audio)) {
            d.error("Invalid audio name:", name);
            return;
        }

        audio[name].play();
    }
1057263
def _new_song(self):
        '''
        
        '''
        # We'll need this later
        s = self.song
        
        if self.shuffle:
            # If shuffle is on, we need to (1) get a random song that 
            # (2) accounts for weighting. This line does both.
            self.song = self.shuffles[random.randrange(len(self.shuffles))]
        else:
            # Nice and easy, just get the next song...
            self.song += 1
            # But wait! need to make sure it exists!
            if self.song >= len(self.loop):
                # It doesn't, so start over at the beginning.
                self.song = 0
        # Set flag if we have the same song as we had before.
        self.dif_song = s != self.song
        # Reset the position within the metasong
        self.pos = 0
600394
def iterplayables():
    '''  '''
    ls = DirScanner(stripdot=True)
    ## filter out just mp3 files (and dirs to support recursion)
    filt = lambda x: ( os.path.isdir(x) or x[-4:].lower() in ALLOWED_TYPES )
    ## take the last two segments of the path as the label
    func = lambda x: '/'.join(x.split('/')[-2:])
    ## iterate over all the files (excluding dirs), filtering for .mp3 and .m4a
    for x,y in ls.iteritems(want_files=True, want_dirs=False, func=func, filt=filt):
        yield {      'name': x.decode('utf-8'),
                'file_name': escape_utf8(y)     }
397647
def select_one_playlist(playlists):
        

        if len(playlists) == 1:
            select_i = 0
        else:
            table = PrettyTable(['Sequence', 'Name'])
            for i, playlist in enumerate(playlists, 1):
                table.add_row([i, playlist['name']])
            click.echo(table)

            select_i = click.prompt('Select one playlist', type=int, default=1)
            while select_i < 1 or select_i > len(playlists):
                select_i = click.prompt('Error Select! Select Again', type=int)

        playlist_id = playlists[select_i-1]['id']
        playlist_name = playlists[select_i-1]['name']
        playlist = Playlist(playlist_id, playlist_name)
        return playlist
256105
def play_Composition(self, composition, channels=None, bpm=120):
        """"""
        self.notify_listeners(self.MSG_PLAY_COMPOSITION, {'composition'
                              : composition, 'channels': channels, 'bpm': bpm})
        if channels == None:
            channels = map(lambda x: x + 1, range(len(composition.tracks)))
        return self.play_Tracks(composition.tracks, channels, bpm)
773078
def splitSong(songToSplit, start1, start2):
    """"""
    print "start1 " + str(start1)
    print "start2 " + str(start2)
    # songs = [songToSplit[:start1+2000], songToSplit[start2-2000:]]
    songs = [songToSplit[:start1], songToSplit[start2:]]
    return songs
1113205
def op_music_to_playlist(self, mid, pid, op):
        
        url_add = uri + '/playlist/manipulate/tracks'
        trackIds = '["' + str(mid) + '"]'
        data_add = {
            'tracks': str(mid),  # music id
            'pid': str(pid),    # playlist id
            'trackIds': trackIds,  # music id str
            'op': op   # opation
        }
        data = self.request('POST', url_add, data_add)
        code = data.get('code')

        # 从歌单中成功的移除歌曲时，code 是 200
        # 当从歌单中移除一首不存在的歌曲时，code 也是 200
        # 当向歌单添加歌曲时，如果歌曲已经在列表当中，
        # 返回 code 为 502
        if code == 200:
            return 1
        elif code == 502:
            return -1
        else:
            return 0
821449
def _on_song_changed(self, song):
        
        logger.debug('Player received song changed signal')
        if song is not None:
            logger.info('Try to play song: %s' % song)
            if song.url:
                self.play(song.url)
            else:
                self._playlist.mark_as_bad(song)
                self.play_next()
        else:
            self.stop()
            logger.info('No good song in player playlist anymore.')
1248345
def tune(self):
        """"""
        if self._node.get('activities'):
            tune = self._node['activities'].get('tune')
            if type(tune) is collections.OrderedDict:
                return tune
            elif type(tune) is list:
                return tune[0]
            return tune
        return None
1098960
def from_string(cls, name, separator='-', reverse=False):
        
        recv = [t.strip() for t in name.split(separator)]
        if len(recv) < 2:
            logger.error('Wrong format!')
            return None

        if reverse:
            title = recv[0]
            artist = ''.join(recv[1:])
        else:
            artist = recv[0]
            title = ''.join(recv[1:])

        if not artist or not title:
            logger.error('Wrong format!')
            return None

        song = cls(artist, title)
        return song
1317263
def judge(text)
      Song.new(parser.parse(text), exactly: true, rule: @rule).valid?
    end