<commit_before>from socket import *

class Scanner:

    def scan(self, ip, port):
        ping_result = self.scanPort(ip, port)
        result = ""
        if (ping_result):
            result= ""
            host = gethostbyaddr(ip)[0]
            if host != None:
                result += "Resolved hostname to " + host + "\n"
            result += str(ip)+":"+str(port)+" >>> OPEN <<<"
        else:
            result = str(ip)+":"+str(port)+" closed"
        return result
    
    def scanPort(self, ip, port):
        connSkt = socket(AF_INET, SOCK_STREAM)
        connSkt.settimeout(1)
        try:
            connSkt.connect((ip, int(port)))
            return True
        except:
            return False
        finally:
            connSkt.close()
            
    def getIpAddressesFromRange(start_ip_address, end_ip_address):
        start_address_elements = start_ip_address.split('.')
        end_address_elements = end_ip_address.split('.')
        ip_list = []
        for a in range(int(start_address_elements[0]), int(end_address_elements[0])+1):
            for b in range(int(start_address_elements[1]), int(end_address_elements[1])+1):
                for c in range(int(start_address_elements[2]), int(end_address_elements[2])+1):
                    for d in range(int(start_address_elements[3]), int(end_address_elements[3])+1):
                        ip_list.append(str(a)+"."+str(b)+"."+str(c)+"."+str(d))
        return ip_list<commit_msg>Fixed problem with method parameter when moved inside class<commit_after>from socket import *

class Scanner:

    def scan(self, ip, port):
        ping_result = self.scanPort(ip, port)
        result = ""
        if (ping_result):
            result= ""
            host = gethostbyaddr(ip)[0]
            if host != None:
                result += "Resolved hostname to " + host + "\n"
            result += str(ip)+":"+str(port)+" >>> OPEN <<<"
        else:
            result = str(ip)+":"+str(port)+" closed"
        return result
    
    def scanPort(self, ip, port):
        connSkt = socket(AF_INET, SOCK_STREAM)
        connSkt.settimeout(1)
        try:
            connSkt.connect((ip, int(port)))
            return True
        except:
            return False
        finally:
            connSkt.close()
            
    def getIpAddressesFromRange(self, start_ip_address, end_ip_address):
        start_address_elements = start_ip_address.split('.')
        end_address_elements = end_ip_address.split('.')
        ip_list = []
        for a in range(int(start_address_elements[0]), int(end_address_elements[0])+1):
            for b in range(int(start_address_elements[1]), int(end_address_elements[1])+1):
                for c in range(int(start_address_elements[2]), int(end_address_elements[2])+1):
                    for d in range(int(start_address_elements[3]), int(end_address_elements[3])+1):
                        ip_list.append(str(a)+"."+str(b)+"."+str(c)+"."+str(d))
        return ip_list
{'fraction_non_alphanumeric': 0.13375583722481654, 'fraction_numerical': 0.009339559706470981, 'mean_word_length': 2.1904255319148938, 'pattern_counts': {'":': 4, '<': 9, '<?xml version=': 0, '>': 9, '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': '4508472', 'n_tokens_mistral': 931, 'n_tokens_neox': 918, 'n_words': 178}