<commit_before>import logging

# import xml.etree.ElementTree as ET

from .api import BGGCommon
from .api import CacheBackendMemory
from .api import DEFAULT_REQUESTS_PER_MINUTE
from .api import BGGError
from .api import request_and_parse_xml
from .loaders import create_geeklist_from_xml, add_geeklist_items_from_xml

log = logging.getLogger("boardgamegeek.legacy_api")

API_ENDPOINT='http://www.boardgamegeek.com/xmlapi'

class BGGClientLegacy(BGGCommon):
    def __init__(self, cache=CacheBackendMemory(ttl=3600), timeout=15, retries=3, retry_delay=5, disable_ssl=False, requests_per_minute=DEFAULT_REQUESTS_PER_MINUTE):

        super(BGGClientLegacy, self).__init__(api_endpoint=API_ENDPOINT,
                                              cache=cache,
                                              timeout=timeout,
                                              retries=retries,
                                              retry_delay=retry_delay,
                                              requests_per_minute=requests_per_minute)
        self._search_api_url = None
        self._thing_api_url = None
        self._guild_api_url = None
        self._user_api_url = None
        self._plays_api_url = None
        self._hot_api_url = None
        self._collection_api_url = None
        self._geeklist_api_url = API_ENDPOINT + "/geeklist"


    def geeklist(self, listid, comments=False):
        if not listid:
            raise BGGError("List Id must be specified")
        log.debug("retrieving list {}".format(listid))

        params = {}
        if comments: params['comments']= 1
        url = "%s/%s" % (self._geeklist_api_url, listid)
        xml_root = request_and_parse_xml(self.requests_session,<commit_msg>fix(geeklist): fix exception type for parameters validation: BGGValueError<commit_after>import logging

# import xml.etree.ElementTree as ET

from .api import BGGCommon
from .api import CacheBackendMemory
from .api import DEFAULT_REQUESTS_PER_MINUTE
from .api import BGGValueError
from .api import request_and_parse_xml
from .loaders import create_geeklist_from_xml, add_geeklist_items_from_xml

log = logging.getLogger("boardgamegeek.legacy_api")

API_ENDPOINT='http://www.boardgamegeek.com/xmlapi'

class BGGClientLegacy(BGGCommon):
    def __init__(self, cache=CacheBackendMemory(ttl=3600), timeout=15, retries=3, retry_delay=5, disable_ssl=False, requests_per_minute=DEFAULT_REQUESTS_PER_MINUTE):

        super(BGGClientLegacy, self).__init__(api_endpoint=API_ENDPOINT,
                                              cache=cache,
                                              timeout=timeout,
                                              retries=retries,
                                              retry_delay=retry_delay,
                                              requests_per_minute=requests_per_minute)
        self._search_api_url = None
        self._thing_api_url = None
        self._guild_api_url = None
        self._user_api_url = None
        self._plays_api_url = None
        self._hot_api_url = None
        self._collection_api_url = None
        self._geeklist_api_url = API_ENDPOINT + "/geeklist"


    def geeklist(self, listid, comments=False):
        # Parameter validation
        if not listid:
            raise BGGValueError("List Id must be specified")
        log.debug("retrieving list {}".format(listid))

        params = {}
        if comments: params['comments']= 1
        url = "%s/%s" % (self._geeklist_api_url, listid)
        xml_root = request_and_parse_xml(self.requests_session,
{'fraction_non_alphanumeric': 0.07560427206295672, 'fraction_numerical': 0.00505902192242833, 'mean_word_length': 2.367076631977294, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5033227', 'n_tokens_mistral': 1016, 'n_tokens_neox': 1003, 'n_words': 198}