code: def __connect():
      
      global redis_instance
      if use_tcp_socket:
          redis_instance = redis.StrictRedis(host=hostname, port=port)
      else:
          redis_instance = redis.StrictRedis(unix_socket_path=unix_socket)
docs: Connect to a redis instance.