<commit_before>#!/QOpenSys/pkgs/bin/python2.7
import socket;
import ssl;
import locale;
from traceback import print_exc;
from os.path import exists;

locale.setlocale(locale.LC_ALL, 'EN_US.UTF-8');

hostname='public.dhe.ibm.com'
ip='172.16.58.3'
timeout=30

def check_alternative_protos():
  print 'Checking if alternative protocols might work...'
  try:
    socket.create_connection((hostname,80), timeout)
    print 'HTTP protocol should work!'
    print 'To try it, run:'
    if exists('/QOpenSys/etc/yum/repos.d/ibmi-release-unsecure.repo'):
      print '    /QOpenSys/pkgs/bin/yum-config-manager --enable-repo=ibmi-base'
      print '    /QOpenSys/pkgs/bin/yum-config-manager --enable-repo=ibmi-release'
    else:
      print '    /QOpenSys/pkgs/bin/yum-config-manager  --setopt=ibm.baseurl=http://public.dhe.ibm.com/software/ibmi/products/pase/rpms/repo'
  except:
    try:
      socket.create_connection((hostname,21), timeout)
      print 'FTP should work!'
      return<commit_msg>Fixup command for enabling unsecure repos<commit_after>#!/QOpenSys/pkgs/bin/python2.7
import socket;
import ssl;
import locale;
from traceback import print_exc;
from os.path import exists;

locale.setlocale(locale.LC_ALL, 'EN_US.UTF-8');

hostname='public.dhe.ibm.com'
ip='172.16.58.3'
timeout=30

def check_alternative_protos():
  print 'Checking if alternative protocols might work...'
  try:
    socket.create_connection((hostname,80), timeout)
    print 'HTTP protocol should work!'
    print 'To try it, run:'
    if exists('/QOpenSys/etc/yum/repos.d/ibmi-release-unsecure.repo'):
      print '    /QOpenSys/pkgs/bin/yum-config-manager --enable-repo=ibmi-base-unsecure'
      print '    /QOpenSys/pkgs/bin/yum-config-manager --enable-repo=ibmi-release-unsecure'
    else:
      print '    /QOpenSys/pkgs/bin/yum-config-manager  --setopt=ibm.baseurl=http://public.dhe.ibm.com/software/ibmi/products/pase/rpms/repo'
  except:
    try:
      socket.create_connection((hostname,21), timeout)
      print 'FTP should work!'
      return
{'fraction_non_alphanumeric': 0.13919052319842054, 'fraction_numerical': 0.01678183613030602, 'mean_word_length': 3.6490825688073394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2799979', 'n_tokens_mistral': 739, 'n_tokens_neox': 721, 'n_words': 130}