<commit_before># -*- coding: utf-8 -*-

'''
Download the f2e libs from internet.
'''

import os
import zipfile
import urllib.request

den_dir = './static/f2elib'

if os.path.exists(den_dir):
    pass
else:
    os.mkdir(den_dir)


def fetch_file(url, filename):
    '''
    Feting the file.
    :param url:
    :param filename:
    :return:
    '''
    outfile = os.path.join(den_dir, filename)
    if os.path.exists(outfile):
        # print('Exists: ', outfile)
        return True
    print('fetch ...')
    print(' ' * 4 + url)

    urllib.request.urlretrieve(url, outfile)
    zip_file = outfile
    f = zipfile.ZipFile(zip_file, 'r')
    for zfile in f.namelist():
        f.extract(zfile, den_dir)


def get_jquery():
    jquery_url = 'http://r.osgeo.cn/f2elib/jquery.zip'
    qian, hou = os.path.split(jquery_url)
    fetch_file(jquery_url, hou)


def get_leaflet():
    leaflet_url = 'http://r.osgeo.cn/f2elib/leaflet_1.0.1.zip'
    qian, hou = os.path.split(leaflet_url)
    fetch_file(leaflet_url, hou)


def get_bootstrap():
    leaflet_url = 'http://r.osgeo.cn/f2elib/bootstrap_3.3.7.zip'
    qian, hou = os.path.split(leaflet_url)
    fetch_file(leaflet_url, hou)


def get_js_valid():
    leaflet_url = 'http://r.osgeo.cn/f2elib/jquery-validation_1.15.0.zip'
    qian, hou = os.path.split(leaflet_url)
    fetch_file(leaflet_url, hou)


def get_codemirror():
    leaflet_url = 'http://r.osgeo.cn/f2elib/codemirror_5.19.0.zip'
    qian, hou = os.path.split(leaflet_url)
    fetch_file(leaflet_url, hou)


def get_jqueryui():
    leaflet_url = 'http://r.osgeo.cn/f2elib/jqueryui_1.12.1.zip'
    qian, hou = os.path.split(leaflet_url)
    fetch_file(leaflet_url, hou)


def get_rating():
    leaflet_url = 'http://r.osgeo.cn/f2elib/bootstrap-star-rating-master.zip'
    qian, hou = os.path.split(leaflet_url)
    fetch_file(leaflet_url, hou)


def get_magnific():
    leaflet_url = 'http://r.osgeo.cn/f2elib/magnific-popup_1.1.0.zip'
    qian, hou = os.path.split(leaflet_url)
    fetch_file(leaflet_url, hou)

<commit_msg>modify the f2elib version.<commit_after># -*- coding: utf-8 -*-

'''
Download the f2e libs from internet.
'''

import os
import zipfile
import urllib.request

den_dir = './static/f2elib'

if os.path.exists(den_dir):
    pass
else:
    os.mkdir(den_dir)


def fetch_file(url, filename):
    '''
    Feting the file.
    :param url:
    :param filename:
    :return:
    '''
    outfile = os.path.join(den_dir, filename)
    if os.path.exists(outfile):
        # print('Exists: ', outfile)
        return True
    print('fetch ...')
    print(' ' * 4 + url)

    urllib.request.urlretrieve(url, outfile)
    zip_file = outfile
    f = zipfile.ZipFile(zip_file, 'r')
    for zfile in f.namelist():
        f.extract(zfile, den_dir)


def get_jquery():
    jquery_url = 'http://r.osgeo.cn/f2elib/jquery.zip'
    qian, hou = os.path.split(jquery_url)
    fetch_file(jquery_url, hou)


def get_leaflet():
    leaflet_url = 'http://r.osgeo.cn/f2elib/leaflet_1.0.3.zip'
    qian, hou = os.path.split(leaflet_url)
    fetch_file(leaflet_url, hou)


def get_bootstrap():
    leaflet_url = 'http://r.osgeo.cn/f2elib/bootstrap_3.3.7.zip'
    qian, hou = os.path.split(leaflet_url)
    fetch_file(leaflet_url, hou)


def get_js_valid():
    leaflet_url = 'http://r.osgeo.cn/f2elib/jquery-validation_1.15.0.zip'
    qian, hou = os.path.split(leaflet_url)
    fetch_file(leaflet_url, hou)


def get_codemirror():
    leaflet_url = 'http://r.osgeo.cn/f2elib/codemirror_5.25.0.zip'
    qian, hou = os.path.split(leaflet_url)
    fetch_file(leaflet_url, hou)


def get_jqueryui():
    leaflet_url = 'http://r.osgeo.cn/f2elib/jqueryui_1.12.1.zip'
    qian, hou = os.path.split(leaflet_url)
    fetch_file(leaflet_url, hou)


def get_rating():
    leaflet_url = 'http://r.osgeo.cn/f2elib/bootstrap-star-rating-master.zip'
    qian, hou = os.path.split(leaflet_url)
    fetch_file(leaflet_url, hou)


def get_magnific():
    leaflet_url = 'http://r.osgeo.cn/f2elib/magnific-popup_1.1.0.zip'
    qian, hou = os.path.split(leaflet_url)
    fetch_file(leaflet_url, hou)


{'fraction_non_alphanumeric': 0.1497182063219799, 'fraction_numerical': 0.016417544719431514, 'mean_word_length': 3.178096212896622, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6067342', 'n_tokens_mistral': 1738, 'n_tokens_neox': 1696, 'n_words': 265}