code: def dup(self):
          
          fd = dup(self.fileno())
          sock = self.__class__(self.family, self.type, self.proto, fileno=fd)
          sock.settimeout(self.gettimeout())
          return sock
docs: dup() -> socket object
  
          Return a new socket object connected to the same system resource.