def GetHttpResource(host, path='/', port=80, redir=False):
  if port != 80:
    port_str = ':%d' % port
  else:
    port_str = ''
  url = 'http://%s%s' % (host, port_str)
  url = urlparse.urljoin(url, path)
  try:
    response = requests.get(url, allow_redirects=redir)
    code = response.status_code
    body = response.text
    return code, body
  except requests.RequestException as e:
    return -1, str(e)
Connect to Redis, and set up cache backend.
dataset/ETHPy150Open google/simian/src/simian/mac/client/network_detect.py/GetHttpResource--crossover with--dataset/ETHPy150Open sebleier/django-redis-cache/redis_cache/backends/base.py/BaseRedisCache.__init__