<commit_before>import requests
import json
import time
import re as regex
from bs4 import BeautifulSoup
import urllib.request, urllib.error, ssl

URLS = {
    'login': '/htdocs/login/login.lua',
    'logout': '/htdocs/pages/main/logout.lsp',
    'factory_default': '/htdocs/pages/base/reset_cfg.lsp',
    'save_config': '/htdocs/lua/ajax/save_cfg.lua?save=1',
    'dashboard': '/htdocs/pages/base/dashboard.lsp',
    'mac_table': '/htdocs/pages/base/mac_address_table.lsp',
    'all_config': '/htdocs/pages/base/support.lsp',
    'port_status': '/htdocs/pages/base/port_summary.lsp?tg=switch_port_config&showtab=1',
    'vlan_status': '/htdocs/pages/switching/vlan_status.lsp',
    'add_vlan': '/htdocs/pages/switching/vlan_status_modal.lsp',
    'del_vlan': '/htdocs/pages/switching/vlan_status.lsp',
    'access_vlan': '/htdocs/pages/switching/vlan_per_port_modal.lsp',
    'set_sysinfo': '/htdocs/pages/base/dashboard.lsp',
    'set_network': '/htdocs/pages/base/network_ipv4_cfg.lsp',
    'set_timezone': '/htdocs/pages/base/timezone_cfg.lsp',
    'set_sntp': '/htdocs/pages/base/sntp_global_config.lsp',
    'set_account': '/htdocs/pages/base/user_accounts.lsp',
    'cert_state': '/htdocs/lua/ajax/https_cert_stat_ajax.lua',
    'https_config': '/htdocs/pages/base/https_cfg.lsp'
}
PROTOCAL_DELIMETER = "://"
protocal = ""
host = ""
session = requests.Session()

def testConnection(protocal, host):
    url = protocal + PROTOCAL_DELIMETER + host
    try:
        ctx = ssl.create_default_context()
        ctx.check_hostname = False
        ctx.verify_mode = ssl.CERT_NONE

        response = urllib.request.urlopen(url, timeout=5, context=ctx)
    except urllib.error.URLError as err:
        print("Cannot connect %s : %s" % (url, err.reason))
        return False

    return True
<commit_msg>Disable insecure HTTPS requests warning<commit_after>import requests
import json
import time
import re as regex
from bs4 import BeautifulSoup
import urllib.request, urllib.error, ssl

URLS = {
    'login': '/htdocs/login/login.lua',
    'logout': '/htdocs/pages/main/logout.lsp',
    'factory_default': '/htdocs/pages/base/reset_cfg.lsp',
    'save_config': '/htdocs/lua/ajax/save_cfg.lua?save=1',
    'dashboard': '/htdocs/pages/base/dashboard.lsp',
    'mac_table': '/htdocs/pages/base/mac_address_table.lsp',
    'all_config': '/htdocs/pages/base/support.lsp',
    'port_status': '/htdocs/pages/base/port_summary.lsp?tg=switch_port_config&showtab=1',
    'vlan_status': '/htdocs/pages/switching/vlan_status.lsp',
    'add_vlan': '/htdocs/pages/switching/vlan_status_modal.lsp',
    'del_vlan': '/htdocs/pages/switching/vlan_status.lsp',
    'access_vlan': '/htdocs/pages/switching/vlan_per_port_modal.lsp',
    'set_sysinfo': '/htdocs/pages/base/dashboard.lsp',
    'set_network': '/htdocs/pages/base/network_ipv4_cfg.lsp',
    'set_timezone': '/htdocs/pages/base/timezone_cfg.lsp',
    'set_sntp': '/htdocs/pages/base/sntp_global_config.lsp',
    'set_account': '/htdocs/pages/base/user_accounts.lsp',
    'cert_state': '/htdocs/lua/ajax/https_cert_stat_ajax.lua',
    'https_config': '/htdocs/pages/base/https_cfg.lsp'
}
PROTOCAL_DELIMETER = "://"
protocal = ""
host = ""
session = requests.Session()

def testConnection(protocal, host):
    url = protocal + PROTOCAL_DELIMETER + host
    try:
        ctx = ssl.create_default_context()
        ctx.check_hostname = False
        ctx.verify_mode = ssl.CERT_NONE
        requests.packages.urllib3.disable_warnings(requests.packages.urllib3.exceptions.InsecureRequestWarning)

        response = urllib.request.urlopen(url, timeout=5, context=ctx)
    except urllib.error.URLError as err:
        print("Cannot connect %s : %s" % (url, err.reason))
        return False

    return True

{'fraction_non_alphanumeric': 0.15205772314270444, 'fraction_numerical': 0.003206841261357563, 'mean_word_length': 3.984021304926764, 'pattern_counts': {'":': 2, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4160945', 'n_tokens_mistral': 1388, 'n_tokens_neox': 1392, 'n_words': 193}