# Path: compmusic/dunya/conn.py
# HOSTNAME = "https://dunya.compmusic.upf.edu"
# TOKEN = None
#     HOSTNAME = hostname
#     TOKEN = token
# class HTTPError(Exception):
# class ConnectionError(Exception):
# def set_hostname(hostname):
# def set_token(token):
# def _get_paged_json(path, **kwargs):
# def _dunya_url_query(url, extra_headers=None):
# def _dunya_post(url, data=None, files=None):
# def _make_url(path, **kwargs):
# def _dunya_query_json(path, **kwargs):
# def _dunya_query_file(path, **kwargs):


import errno
import logging
import os
import compmusic.dunya.docserver
from compmusic.dunya import conn
    if not isinstance(collections, list):
        raise ValueError('`collections` must be a list')
    COLLECTIONS = collections


def _get_collections():
    extra_headers = None
    if COLLECTIONS:
        extra_headers = {}
        extra_headers['Dunya-Collection'] = ','.join(COLLECTIONS)
    return extra_headers


def get_recordings(recording_detail=False):
    """ Get a list of carnatic recordings in the database.
    This function will automatically page through API results.

    :param recording_detail: if True, return full details for each recording like :func:`get_recording`

    :returns: A list of dictionaries containing recording information::

        {"mbid": MusicBrainz recording ID, "title": Title of the recording}

    For additional information about each recording use :func:`get_recording`.

    """
    extra_headers = _get_collections()
    args = {}
    if recording_detail:
        args['detail'] = '1'

# Path: compmusic/dunya/conn.py
# HOSTNAME = "https://dunya.compmusic.upf.edu"
# TOKEN = None
#     HOSTNAME = hostname
#     TOKEN = token
# class HTTPError(Exception):
# class ConnectionError(Exception):
# def set_hostname(hostname):
# def set_token(token):
# def _get_paged_json(path, **kwargs):
# def _dunya_url_query(url, extra_headers=None):
# def _dunya_post(url, data=None, files=None):
# def _make_url(path, **kwargs):
# def _dunya_query_json(path, **kwargs):
# def _dunya_query_file(path, **kwargs):


# Path: compmusic/dunya/carnatic.py
import errno
import logging
import os
import compmusic.dunya.docserver
from compmusic.dunya import conn

    if not isinstance(collections, list):
        raise ValueError('`collections` must be a list')
    COLLECTIONS = collections


def _get_collections():
    extra_headers = None
    if COLLECTIONS:
        extra_headers = {}
        extra_headers['Dunya-Collection'] = ','.join(COLLECTIONS)
    return extra_headers


def get_recordings(recording_detail=False):
    """ Get a list of carnatic recordings in the database.
    This function will automatically page through API results.

    :param recording_detail: if True, return full details for each recording like :func:`get_recording`

    :returns: A list of dictionaries containing recording information::

        {"mbid": MusicBrainz recording ID, "title": Title of the recording}

    For additional information about each recording use :func:`get_recording`.

    """
    extra_headers = _get_collections()
    args = {}
    if recording_detail:
        args['detail'] = '1'

    return conn._get_paged_json("api/carnatic/recording", extra_headers=extra_headers, **args)