def _create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT):

  msg = "getaddrinfo returns an empty list"
  host, port = address
  for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
    af, socktype, proto, canonname, sa = res
    sock = None
    try:
      sock = socket.socket(af, socktype, proto)
      if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
        sock.settimeout(timeout)
      sock.connect(sa)
      return sock

    except socket.error, msg:
      if sock is not None:
        sock.close()

  raise socket.error, msg
Login with email, password and get back a session cookie
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/fancy_urllib/fancy_urllib/__init__.py/_create_connection--crossover with--dataset/ETHPy150Open hfaran/piazza-api/piazza_api/rpc.py/PiazzaRPC.user_login