def _download_file(url, outfile):
    """Downloads the MCEq database from github"""
    from tqdm import tqdm
    import requests
    import math
    r = requests.get(url, stream=True)
    total_size = int(r.headers.get('content-length', 0))
    block_size = 1024 * 1024
    wrote = 0
    with open(outfile, 'wb') as f:
        for data in tqdm(r.iter_content(block_size), total=math.ceil(
            total_size // block_size), unit='MB', unit_scale=True):
            wrote = wrote + len(data)
            f.write(data)
    if total_size != 0 and wrote != total_size:
        raise Exception('ERROR, something went wrong')
