get the Redis instance
497421
def redis
      redis_master_source = @config.redis_server =~ /^\S+\:\d+$/ ? "server_string" : "master_file"
      _eigenclass_.class_eval <<-EVALS, __FILE__, __LINE__
        def redis
          redis_master_from_#{redis_master_source}
        end
      EVALS
      redis
    end
359633
public function get() : string
        {
                $result = $this->_redis->get($this->_key);
                return !empty($result)?$result:'';
        }
160130
def get_storage(self):
        '''
        '''

        if self.storage:
            return self.storage
        self.storage = self.reconnect_redis()

        return self.storage
717870
public IRedisClient getRedisClient(String host, int port, String username, String password) {
        return getRedisClient(host, port, username, password, null);
    }
1086454
public static RedisClusterManager getInstance(String host, int port, String password) {
        return getInstance(buildRedisConfig(host, port, password));
    }
653432
public static RedisClusterManager getInstance(RedisBaseConfig redisBaseConfig) {
        if (!CACHE.containsKey(redisBaseConfig)) {
            synchronized (lock) {
                if (!CACHE.containsKey(redisBaseConfig)) {
                    CACHE.put(redisBaseConfig, newInstance(redisBaseConfig));
                }
            }
        }

        return CACHE.get(redisBaseConfig);
    }
58809
function() {
      return Promise.retry(function() {
        log.debug(format('Connecting to redis on %s:%s', REDIS_IP, REDIS_PORT));
        return redis.createClient(REDIS_PORT, REDIS_IP);
      });
    }
1359149
def show_instance(name, call=None):
    '''
    
    '''
    node = get_node(name)
    ret = query(command='my/machines/{0}'.format(node['id']),
                location=node['location'], method='GET')

    return ret
973372
function initRedis(config, callback) {

  var self = this;

  protos.util.checkLocalPort(config.port, function(err) {

    if (err) {
      app.log("RedisTransport [%s:%s] %s", config.host, config.port, err.code);
    } else {

      // Set redis client
      self.client = redis.createClient(config.port, config.host, self.options);

      // Handle error event
      self.client.on('error', function(err) {
        callback.call(self, err);
      });

      // Authenticate if password provided
      if (typeof config.password == 'string') {
        self.client.auth(config.password, function(err, res) {
          if (err) {
            app.log("RedisTransport: [%s:%s] %s", config.host, config.port, err.code);
          } else if (typeof config.db == 'number' && config.db !== 0) {
            self.client.select(config.db, function(err, res) {
              if (err) callback.call(self, err);
              else callback.call(self, null);
            });
          } else {
            callback.call(self, null);
          }
        });
      } else if (typeof config.db == 'number' && config.db !== 0) {
        self.client.select(config.db, function(err, res) {
          callback.call(self, err);
        });
      } else {
        callback.call(self, null);
      }

    }
  });

}
833326
function getRedisOptions() {
    var defaults = {
      debug: false,
      certExpiry: 100 * 60 * 60 * 24, // all cert data expires after 100 days
      redisOptions: {
        db: 3,
        retry_strategy: function(options) {
          // reconnect after 60 seconds, keep trying forever
          return 60 * 1000;
        }
      }
    };
    var mergedOptions = _.merge(defaults, options);

    _debug('le-store-redis.getRedisOptions', mergedOptions);

    return mergedOptions;
  }
1040172
def _get_dicts_from_redis(self, name, index_name, redis_prefix, item):
        
        r = self._redis
        data_dict = {}
        data_index_dict = {}

        if redis_prefix is None:
            raise KeyError ("redis_prefix is missing")

        if r.scard(redis_prefix + index_name + str(item)) > 0:
            data_index_dict[str(item)] = r.smembers(redis_prefix + index_name + str(item))

            for i in data_index_dict[item]:
                json_data = r.get(redis_prefix + name + str(int(i)))
                data_dict[i] = self._deserialize_data(json_data)

            return (data_dict, data_index_dict)

        raise KeyError ("No Data found in Redis for "+ item)
939702
function get(req) {
        var cache = caches[this.name];
        var returnVal = null;

        if (cache && !redisOffline) {
            try {
                returnVal = cache.get(req.key);
            }
            catch (err) {
                console.log('redis get err: ' + err);
            }
        }

        return new Q(returnVal);
    }
712761
function initRedis() {
    return when.promise((resolve, reject) => {
      redis.get(name, (err, res) => {
        if(err) {
          memStore = {};
        } else if(res) {
          memStore = JSON.parse(res);
        } else {
          memStore = {};
        }
        resolve(true);
      });
    });
  }
541774
def dump(self, name):
        
        with self.pipe as pipe:
            return pipe.dump(self.redis_key(name))
805990
def llen(self, name):
        
        with self.pipe as pipe:
            return pipe.llen(self.redis_key(name))
1291756
def _redis_connection_settings(self):
        
        return {config.HOST: self.settings.get(config.HOST, self._REDIS_HOST),
                config.PORT: self.settings.get(config.PORT, self._REDIS_PORT),
                'selected_db': self.settings.get(config.DB, self._REDIS_DB)}
1180108
def used
      return 0 if max.zero?
      amount = redis.get(key) || 0
      [amount.to_i, max].min
    end