<commit_before>from maptilesourcehttp import MapTileSourceHTTP


class MapTileSourceHereDemo(MapTileSourceHTTP):

    _server = None

    def __init__(self, tileSize=256, parent=None):
        MapTileSourceHTTP.__init__(self, tileSize=tileSize, parent=parent)
        assert tileSize == 256 or tileSize == 512
        self._server = 0

    def url(self, x, y, zoom):
        self._server += 1
        if self._server > 4:
            self._server = 0
        url = "http://%d.base.maps.cit.api.here.com/maptile/2.1/maptile/" % self._server
        url += "newest/normal.day/%d/%d/%d/%d/png8" % (zoom, x, y, self._tileSize)
        url += '?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg'
        return url


class MapTileSourceHere(MapTileSourceHTTP):

    def __init__(self, tileSize=256, app_id=None, app_code=None, scheme=None, cit=True, parent=None):
        MapTileSourceHTTP.__init__(self, tileSize=tileSize, parent=parent)
        assert tileSize == 256 or tileSize == 512
        self._server = 0

        if app_id is None or app_code is None:
            self._app_id = 'DemoAppId01082013GAL'
            self._app_code = 'AJKnXv84fjrb0KIHawS0Tg'
        else:
            self._app_id = app_id
            self._app_code = app_code

        self._scheme = scheme if scheme is not None else 'normal.day'
        self._cit = '.cit' if cit else ''

    def url(self, x, y, zoom):
        self._server += 1
        if self._server > 4:
            self._server = 0

        url = "http://%d.base.maps%s.api.here.com/maptile/2.1/maptile/" % (self._server, self._cit)
        url += "newest/%s/%d/%d/%d/%d/png8" % (self._scheme, zoom, x, y, self._tileSize)
        url += '?app_id=%s&app_code=%s' % (self._app_id, self._app_code)
        return url<commit_msg>Imporved HERE tiles source class.<commit_after>from maptilesourcehttp import MapTileSourceHTTP


class MapTileSourceHereDemo(MapTileSourceHTTP):

    _server = None

    def __init__(self, tileSize=256, parent=None):
        MapTileSourceHTTP.__init__(self, tileSize=tileSize, parent=parent)
        assert tileSize == 256 or tileSize == 512
        self._server = 0

    def url(self, x, y, zoom):
        self._server += 1
        if self._server > 4:
            self._server = 0
        url = "http://%d.base.maps.cit.api.here.com/maptile/2.1/maptile/" % self._server
        url += "newest/normal.day/%d/%d/%d/%d/png8" % (zoom, x, y, self._tileSize)
        url += '?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg'
        return url


class MapTileSourceHere(MapTileSourceHTTP):

    def __init__(self, tileSize=256, app_id=None, app_code=None, scheme=None, cit=True, tileType=None, parent=None):
        MapTileSourceHTTP.__init__(self, tileSize=tileSize, parent=parent)
        assert tileSize == 256 or tileSize == 512
        self._server = 0

        if app_id is None or app_code is None:
            self._app_id = 'DemoAppId01082013GAL'
            self._app_code = 'AJKnXv84fjrb0KIHawS0Tg'
        else:
            self._app_id = app_id
            self._app_code = app_code

        self._tileType = tileType if tileType is not None else 'maptile'
        self._scheme = scheme if scheme is not None else 'normal.day'
        self._cit = '.cit' if cit else ''

    def url(self, x, y, zoom):
        self._server += 1
        if self._server > 4:
            self._server = 0

        url = "http://%d.base.maps%s.api.here.com/maptile/2.1/%s/" % (self._server, self._cit, self._tileType)
        url += "newest/%s/%d/%d/%d/%d/png8" % (self._scheme, zoom, x, y, self._tileSize)
        url += '?app_id=%s&app_code=%s' % (self._app_id, self._app_code)
        return url
{'fraction_non_alphanumeric': 0.12564590698939354, 'fraction_numerical': 0.03045961381561055, 'mean_word_length': 2.5570599613152805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3813096', 'n_tokens_mistral': 1367, 'n_tokens_neox': 1247, 'n_words': 272}