Hydrates the model by pulling data from Redis
765114
private function hydrate()
    {
        $key = $this->queue->generateListKey();
        $job = $this->queue->getClient()->getRedis()->hGetAll("$key:" . $this->id);

        if (empty($job)) {
            throw new JobNotFoundException('Unable to fetch job details from Redis.');
        }

        $this->workerClass = $job['workerClass'];
        $this->args = \json_decode($job['args'], true);
        $this->priority = $job['priority'];

        $r = \explode(':', $job['retry']);
        if ($r[0] === 'boolean') {
            $this->retry = (bool)$r[1];
        } elseif ($r[0] === 'integer') {
            $this->retry = (int)$r[1];
        }
    }
293574
def fetch(bank, key):
    '''
    
    '''
    redis_server = _get_redis_server()
    redis_key = _get_key_redis_key(bank, key)
    redis_value = None
    try:
        redis_value = redis_server.get(redis_key)
    except (RedisConnectionError, RedisResponseError) as rerr:
        mesg = 'Cannot fetch the Redis cache key {rkey}: {rerr}'.format(rkey=redis_key,
                                                                        rerr=rerr)
        log.error(mesg)
        raise SaltCacheError(mesg)
    if redis_value is None:
        return {}
    return __context__['serial'].loads(redis_value)
261939
def limits_hydrate(db, lims):
    

    return [limits.Limit.hydrate(db, lim) for lim in lims]
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)
502340
def hgetall(self, name):
        
        with self.pipe as pipe:
            f = Future()
            res = pipe.hgetall(self.redis_key(name))

            def cb():
                data = {}
                m_decode = self.memberparse.decode
                v_decode = self._value_decode
                for k, v in res.result.items():
                    k = m_decode(k)
                    v = v_decode(k, v)
                    data[k] = v
                f.set(data)

            pipe.on_execute(cb)
            return f
849796
def load_model_data(self, path, model):
        
        if os.path.isdir(path):
            # try find a model data collection
            if os.path.isfile(os.path.join(path, '_all.yml')):
                self.load_model_data_collection(path, model)
            self.load_model_data_from_files(path, model)
            self.session.commit()
450971
def hydrate(self, values):
        

        def hydrate_(obj):
            if isinstance(obj, Structure):
                try:
                    f = self.hydration_functions[obj.tag]
                except KeyError:
                    # If we don't recognise the structure type, just return it as-is
                    return obj
                else:
                    return f(*map(hydrate_, obj.fields))
            elif isinstance(obj, list):
                return list(map(hydrate_, obj))
            elif isinstance(obj, dict):
                return {key: hydrate_(value) for key, value in obj.items()}
            else:
                return obj

        return tuple(map(hydrate_, values))
1102995
def fetch(self):
        
        LOGGER.debug('Fetching session data: %s', self.id)
        result = yield gen.Task(RedisSession._redis_client.get, self._key)
        if result:
            self.loads(result)
            raise gen.Return(True)
        else:
            raise gen.Return(False)
1035107
protected function hydrateRequestData()
    {
        $request = Request::getInstance();
        $this->query = array_merge($this->query, $request->getQueryParams());
        $this->data = array_merge($this->data, $request->getRawData());
    }
233800
def clone(client):
        ''''''
        kwargs = client.redis.connection_pool.connection_kwargs
        kwargs['parser_class'] = redis.connection.PythonParser
        pool = redis.connection.ConnectionPool(**kwargs)
        return redis.Redis(connection_pool=pool)
1269472
def get(self, **kwargs):
        '''  '''
        redis = type(self.obj).get_redis()
        related = list(map(
            lambda id : self.model().get(debyte_string(id)),
            self.get_related_ids(redis, **kwargs)
        ))

        return related
220591
public function hydrateRow()
    {
        $row = $this->_stmt->fetch(PDO::FETCH_ASSOC);

        if ( ! $row) {
            $this->cleanup();

            return false;
        }

        $result = array();

        $this->hydrateRowData($row, $result);

        return $result;
    }
246723
def load(self):
        
        with switch_db(StreamDefinitionModel, 'hyperstream'):
            self.mongo_model = StreamDefinitionModel.objects.get(__raw__=self.stream_id.as_raw())
            self._calculated_intervals = self.mongo_model.get_calculated_intervals()
436299
def setup(self, settings):
        '''
        
        '''
        self.extract = tldextract.TLDExtract()
        self.redis_conn = redis.Redis(host=settings['REDIS_HOST'],
                                      port=settings['REDIS_PORT'],
                                      db=settings.get('REDIS_DB'))

        try:
            self.redis_conn.info()
            self.logger.debug("Connected to Redis in ZookeeperHandler")
        except ConnectionError:
            self.logger.error("Failed to connect to Redis in ZookeeperHandler")
            # plugin is essential to functionality
            sys.exit(1)
223757
def _execute_model(self, feed_dict, out_dict):
        
        network_out = self.sess.run(list(out_dict.values()), feed_dict=feed_dict)
        run_out = dict(zip(list(out_dict.keys()), network_out))
        return run_out
587034
function RedisPool(opts) {

    if (!(this instanceof RedisPool)) {
        return new RedisPool(opts);
    }

    EventEmitter.call(this);

    opts = opts || {};
    var defaults = {
        host: '127.0.0.1',
        port: '6379',
        max: 50,
        idleTimeoutMillis: 10000,
        reapIntervalMillis: 1000,
        noReadyCheck: false,
        returnToHead: false,
        unwatchOnRelease: true,
        name: 'default',
        log: false,
        slowPool: {
            log: false,
            elapsedThreshold: 25
        },
        emitter: {
            statusInterval: 60000
        },
        commands: []
    };

    this.options = _.defaults(opts, defaults);
    this.pools = {};
    this.elapsedThreshold = this.options.slowPool.elapsedThreshold;

    // add custom Redis commands
    if (this.options.commands && this.options.commands.length) {
        this.options.commands.forEach(function(newCommand) {
            redis.add_command(newCommand);
        });
    }

    var self = this;
    setInterval(function() {
        Object.keys(self.pools).forEach(function(poolKey) {
            var pool = self.pools[poolKey];
            self.emit('status', {
                name: self.options.name,
                db: poolKey,
                count: pool.getPoolSize(),
                unused: pool.availableObjectsCount(),
                waiting:  pool.waitingClientsCount()
            });
        });
    }, this.options.emitter.statusInterval);
}
42251
def _serialize_items(self, serializer, kind, items):
        """"""
        if self.request and self.request.query_params.get('hydrate_{}'.format(kind), False):
            serializer = serializer(items, many=True, read_only=True)
            serializer.bind(kind, self)
            return serializer.data
        else:
            return [item.id for item in items]