def debug(): print "debug" global r global redis_graph r = redis.Redis(host='localhost', port=6379) redis_graph = client.RedisGraph(graph, r) PopulateGraph() run_queries()
def main(argv): global r global redis_graph if "-debug" in argv: debug() else: with _redis() as r: redis_graph = client.RedisGraph(graph, r) PopulateGraph() run_queries()