code: def create_socket (family, socktype, proto=0, timeout=60):
      
      sock = socket.socket(family, socktype, proto=proto)
      sock.settimeout(timeout)
      socktypes_inet = [socket.AF_INET]
      if has_ipv6:
          socktypes_inet.append(socket.AF_INET6)
      if family in socktypes_inet and socktype == socket.SOCK_STREAM:
          # disable NAGLE algorithm, which means sending pending data
          # immediately, possibly wasting bandwidth but improving
          # responsiveness for fast networks
          sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
      return sock
docs: Create a socket with given family and type. If SSL context
      is given an SSL socket is created.