def open_url(self, url, suffix='<STR_LIT>', dest=None):
if not url.endswith('<STR_LIT>'):<EOL><INDENT>try:<EOL><INDENT>return self.open_url(<EOL>url=url + '<STR_LIT>',<EOL>suffix=suffix,<EOL>dest=dest,<EOL>)<EOL><DEDENT>except RuntimeError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>full_url = posixpath.join(self.baseurl, url) + suffix<EOL>response = urllib.urlopen(full_url)<EOL>if response.code >= <NUM_LIT>:<EOL><INDENT>raise RuntimeError(<EOL>'<STR_LIT>' %<EOL>(full_url, response.code)<EOL>)<EOL><DEDENT>meta = response.info()<EOL>file_size_kb = int(meta.getheaders("<STR_LIT>")[<NUM_LIT:0>]) / <NUM_LIT><EOL>if file_size_kb > <NUM_LIT:0>:<EOL><INDENT>sys.stdout.write(<EOL>"<STR_LIT>" %<EOL>(file_size_kb, full_url)<EOL>)<EOL><DEDENT>def report(count, block_size, total_size):<EOL><INDENT>percent = (count * block_size * <NUM_LIT:100> / float(total_size))<EOL>sys.stdout.write(<EOL>"<STR_LIT>" % percent + "<STR_LIT>" %<EOL>(count * block_size / <NUM_LIT>) + "<STR_LIT>"<EOL>)<EOL>sys.stdout.flush()<EOL><DEDENT>if dest:<EOL><INDENT>response.close()<EOL>urllib.urlretrieve(full_url, dest, report)<EOL>sys.stdout.write("<STR_LIT:\n>")<EOL><DEDENT>return response<EOL>
Opens the given url, trying the compressed version first.
The compressed version url is generated adding the ``.xz`` extension
to the ``url`` and adding the given suffix **after** that ``.xz``
extension.
If dest passed, it will download the data to that path if able

Args:
    url (str): relative url from the ``self.baseurl`` to retrieve
    suffix (str): optional suffix to append to the url after adding
        the compressed extension to the path
    dest (str or None): Path to save the data to

Returns:
    urllib.addinfourl: response object to read from (lazy read), closed
        if no dest passed

Raises:
    RuntimeError: if the url gave http error when retrieving it