parameters: (sock, addr, keepalive=None)
docstring: Return the client socket for the next connection.
docstring_summary: Return the client socket for the next connection.
docstring_tokens: Return the client socket for the next connection .
function: def connect(sock, addr, keepalive=None):
      """Return the client socket for the next connection."""
      if addr is None:
          if keepalive is None or keepalive is True:
              keepalive = KeepAlive()
          elif keepalive:
              keepalive = KeepAlive.from_raw(keepalive)
          client, _ = sock.accept()
          if keepalive:
              keepalive.apply(client)
          return client
      else:
          if keepalive:
              raise NotImplementedError
          sock.connect(addr)
          return sock
function_tokens: def connect ( sock , addr , keepalive = None ) : if addr is None : if keepalive is None or keepalive is True : keepalive = KeepAlive ( ) elif keepalive : keepalive = KeepAlive . from_raw ( keepalive ) client , _ = sock . accept ( ) if keepalive : keepalive . apply ( client ) return client else : if keepalive : raise NotImplementedError sock . connect ( addr ) return sock