class Scanner:
    def __init__(self):
        pass

    def scanip(self, ip):
        pass

    def scanport(self, ip, port):
        pass

@@ -1,8 +1,24 @@
+import socket%0A%0A%0A
 class Sc
@@ -48,36 +48,48 @@
 (self):%0A        
-pass
+self.timeout = 1
 %0A%0A    def scanip
@@ -108,20 +108,304 @@
         
-pass
+try:%0A            socket.gethostbyaddr(ip)%0A        except socket.herror:%0A            return False%0A        return True%0A%0A    def scanport(self, ip, port):%0A        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)%0A        sock.settimeout(0.1)%0A        return sock.connect_ex((ip, port))
 %0A%0A    de
@@ -406,32 +406,33 @@
     def scanport
+s
 (self, ip, port)
@@ -428,26 +428,632 @@
 , ip
-, port):%0A        pass
+=%22127.0.0.1%22, ports=%220-65535%22):%0A        assert ports.count('-') == 1%0A        src_port, dst_port = map(lambda x: int(x), ports.split('-'))%0A%0A        if not self.scanip(ip):%0A            self.report = %7B%22success%22: False, %22ports%22: %7B%7D%7D%0A%0A        self.report = %7B%22success%22: True, %22ports%22: %7B%7D%7D%0A%0A        for port in range(src_port, dst_port):%0A            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)%0A            sock.settimeout(0.1)%0A            if sock.connect_ex((ip, port)) == 0:%0A                self.report%5B%22ports%22%5D%5Bport%5D = True%0A            else:%0A                self.report%5B%22ports%22%5D%5Bport%5D = False%0A%0A            sock.close()%0A
 %0A

Complete basic PyCat scanner class