<commit_before>
import random
import sys

def subnet_calc():
    try:
        print("\n")
        
        #Get IP address and check if valid
        while True:
            ip_address = input("Enter an IP address: ")
            
            #evaluate each octet
            a = ip_address.split('.')
                        
            if (len(a) == 4) and (1 <= int(a[0]) <= 223) and (int(a[0]) != 127) and (int(a[0]) != 169 or int(a[1]) != 254) and (0 <= int(a[1]) <= 255 and 0 <= int(a[2]) <= 255 and 0 <= int(a[3]) <= 255):
                break
            
            else:
                print ("\nINVALID IP address. Please retry!\n")
                continue
        
        masks = [255, 254, 252, 248, 240, 224, 192, 128, 0]
        
        #Validate subnet mask
        while True:
            subnet_mask = input("Enter a subnet mask: ")
            
            #Check octets
            b = subnet_mask.split('.')
            
            if (len(b) == 4) and (int(b[0]) == 255) and (int(b[1]) in masks) and (int(b[2]) in masks) and (int(b[3]) in masks) and (int(b[0]) >= int(b[1]) >= int(b[2]) >= int(b[3])):
                break
            
            else:
                print("\nThe subnet mask is INVALID! Please retry!\n")
                continue
         

        #Subnet identification
        
        #Convert mask to binary string
        mask_octets_padded = []
        mask_octets_decimal = subnet_mask.split(".")
        #print mask_octets_decimal<commit_msg>python3 adjustments Tested in Python 3.5.1<commit_after>
import random
import sys

def subnet_calc():
    try:
        print("\n")
        
        #Get IP address and check if valid
        while True:
            ip_address = input("Enter an IP address: ")
            
            #evaluate each octet
            a = ip_address.split('.')
                        
            if (len(a) == 4) and (1 <= int(a[0]) <= 223) and (int(a[0]) != 127) and (int(a[0]) != 169 or int(a[1]) != 254) and (0 <= int(a[1]) <= 255 and 0 <= int(a[2]) <= 255 and 0 <= int(a[3]) <= 255):
                break
            
            else:
                print ("\nINVALID IP address. Please check your values and retry!\n")
                continue
        
        masks = [255, 254, 252, 248, 240, 224, 192, 128, 0]
        
        #Validate subnet mask
        while True:
            subnet_mask = input("Enter a subnet mask: ")
            
            #Check octets
            b = subnet_mask.split('.')
            
            if (len(b) == 4) and (int(b[0]) == 255) and (int(b[1]) in masks) and (int(b[2]) in masks) and (int(b[3]) in masks) and (int(b[0]) >= int(b[1]) >= int(b[2]) >= int(b[3])):
                break
            
            else:
                print("\nThe subnet mask is INVALID! One sample is 255.255.255.0 for a common /24 subnet.  Please retry!\n")
                continue
         

        #Subnet identification
        
        #Convert mask to binary string
        mask_octets_padded = []
        mask_octets_decimal = subnet_mask.split(".")
        #print mask_octets_decimal
{'fraction_non_alphanumeric': 0.13605660984239304, 'fraction_numerical': 0.05017690575747829, 'mean_word_length': 1.4623911322248615, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '2294736', 'n_tokens_mistral': 1071, 'n_tokens_neox': 946, 'n_words': 285}