@protocol.commands.add('list')
def list_(context, *args):
    params = list(args)
    if not params:
        raise exceptions.MpdArgError('incorrect arguments')

    field = params.pop(0).lower()
    field = _LIST_MAPPING.get(field)
    if field is None:
        raise exceptions.MpdArgError('incorrect arguments')

    query = None
    if len(params) == 1:
        if field != 'album':
            raise exceptions.MpdArgError('should be "Album" for 3 arguments')
        if params[0].strip():
            query = {'artist': params}
    else:
        try:
            query = _query_from_mpd_search_parameters(params, _LIST_MAPPING)
        except exceptions.MpdArgError as e:
            e.message = 'not able to parse args'
            raise
        except ValueError:
            return

    name = _LIST_NAME_MAPPING[field]
    result = context.core.library.get_distinct(field, query)
    return [(name, value) for value in result.get()]
The raw data response
dataset/ETHPy150Open mopidy/mopidy/mopidy/mpd/protocol/music_db.py/list_--crossover with--dataset/ETHPy150Open project-fondue/python-yql/yql/__init__.py/YQLObj.raw