code: def get_redis_connection():
      redis_conn = getattr(g, "_redis_connection", None)
      if redis_conn is None:
          redis_conn = Redis(
              app.config["REDIS_HOST"],
              app.config["REDIS_PORT"],
              app.config["REDIS_DB"],
          )
          g._redis_connection = redis_conn
      return redis_conn
  
imports: from __future__ import absolute_import, print_function, division, unicode_literals
  import os
  from flask import request, jsonify, send_from_directory, g
  from redis import Redis
  from rq import Connection
  from sqlalchemy import create_engine
  from sklearn.model_selection import ParameterGrid
  from sklearn.model_selection import ParameterSampler
  from xcessiv import app, functions, exceptions, models, rqtasks
  from xcessiv.presets import learnersetting, metricsetting, cvsetting
  import six
label_desc: Use image node_id 2 for calling a global function with example usage: get_redis_connection() and returns: redis_conn