Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(7)  |  Derive(1)  |  Import(0)

src/p/y/Pythagora-HEAD/models/playlists.py   Pythagora(Download)
    def __iter__(self):
        return (mpdlibrary.Song(song, self._library) for song in self._songs)
 
    def __getitem__(self, index):
        return mpdlibrary.Song(self._songs[index], self._library)

src/p/y/Pythagora-HEAD/models/playqueue.py   Pythagora(Download)
class PlayQueueSong(mpdlibrary.Song, QObject):
    def __init__(self, song, library):
        QObject.__init__(self)
        mpdlibrary.Song.__init__(self, song, library)
        self.iconPath = None

src/p/y/Pythagora-HEAD/tests/test_mpdlibrary.py   Pythagora(Download)
def test_song_attrs():
    for item in test_list:
        song = mpdlibrary.Song(item, library)
        _test_song_attrs(song, item)
 
def _test_artist(_name):
    name = _deduplicate(_name)
    artist = mpdlibrary.Artist(name, library)
    assert artist == name
    expect = sorted(mpdlibrary.Song(song, library) for song in test_list if song.get('artist') == _name)
def _test_album(_name):
    name = _deduplicate(_name)
    album = mpdlibrary.Album(name, library)
    assert album == name
    expect = sorted(mpdlibrary.Song(song, library) for song in test_list if song.get('album') == _name)
def test_genre_single():
    genre = mpdlibrary.Genre('Rock', library)
    assert genre == 'Rock'
    expect = sorted(mpdlibrary.Song(song, library) for song in test_list if song.get('genre') == 'Rock')
    assert sorted(genre.songs) == expect
def test_genre_multiple():
    genre = mpdlibrary.Genre(['Electronic', 'Electronic'], library)
    assert genre == 'Electronic'
    expect = sorted(mpdlibrary.Song(song, library) for song in test_list if 'Electronic' in song.get('genre', []))
    assert sorted(genre.songs) == expect