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

All Samples(32)  |  Call(30)  |  Derive(0)  |  Import(2)

src/m/p/mpdc-HEAD/mpdc/libs/parser.py   mpdc(Download)
 
from mpdc.initialize import mpd, collectionsmanager, lastfm, enable_command
from mpdc.libs.utils import format_mpc_output, warning, OrderedSet
 
 
def p_expression_collection(p):
    'expression : COLLECTION'
    p[0] = OrderedSet()
    if p[1] in collectionsmanager.c:
        collection = collectionsmanager.c[p[1]]
        if 'expression' in collection:
            p[0] |= parser.parse(collection['expression'],
                    lexer=lex.lex(debug=0, reflags=re.UNICODE|re.IGNORECASE))
        if 'songs' in collection:
            p[0] |= OrderedSet(collection['songs'])
                output = subprocess.check_output(collection['command'],
                                                 shell=True)
                p[0] |= OrderedSet(format_mpc_output(output.decode()))
            except subprocess.CalledProcessError:
                warning('Error while executing `command` in collection [{}]'.
            p[0] = mpd.set_sort(p[0])
    elif p[1] == 'all':
        p[0] = OrderedSet(mpd.get_all_songs())
    elif p[1] == 'c':
        p[0] = OrderedSet(mpd.get_playlist_songs())

src/m/p/mpdc-HEAD/mpdc/libs/mpdhelper.py   mpdc(Download)
 
from mpdc.initialize import cache
from mpdc.libs.utils import format_mpc_output, OrderedSet
 
 
    def set_sort(self, songs_files):
        all_songs = self.get_all_songs()
        return OrderedSet([song for song in all_songs if song in songs_files])
 
    def update_cache(self):