Internal helper that fetches the ring from Redis, including only active
        nodes/replicas. Returns a list of tuples (start, replica) (see
        _fetch_all docs for more details).
963617
def _fetch(self):
        
        now = time.time()
        expiry_time = now - NODE_TIMEOUT

        data = self.conn.zrangebyscore(self.key, expiry_time, 'INF')

        ring = []

        for node_data in data:
            start, replica = node_data.decode().split(':', 1)
            ring.append((int(start), replica))

        ring = sorted(ring, key=operator.itemgetter(0))

        return ring
187823
def _fetch(in_parsed, *keys):
    
    for ie in ('information_elements', 'beacon_ies'):
        target = in_parsed.get(ie, {})
        for key in keys:
            target = target.get(key, {})
        if target:
            return target
    return None
693827
def get_many(self, uris):
        
        cache_keys = dict((self._build_cache_key(uri), uri) for uri in uris)
        result = self._get_many(cache_keys)
        nodes = {}
        for cache_key in result:
            uri = cache_keys[cache_key]
            value = result[cache_key]
            node = self._decode_node(uri, value)
            if node:
                nodes[uri] = node
        return nodes
625447
def fetchone(self):
        
        self._assert_valid_result_set()
        result = self.result_set.fetch_row()
        if len(result) == 0:
            return None
        else:
            return result
942580
def get_all(self, attrs: Iterable[FetchAttribute]) \
            -> Sequence[Tuple[FetchAttribute, MaybeBytes]]:
        
        ret: List[Tuple[FetchAttribute, MaybeBytes]] = []
        for attr in attrs:
            try:
                ret.append((attr.for_response, self.get(attr)))
            except NotFetchable:
                pass
        return ret
999383
def _fetch(self):
        '''
        
        '''
        origin = self.repo.remotes[0]
        refs_pre = self.repo.listall_references()
        fetch_kwargs = {}
        # pygit2 radically changed fetchiing in 0.23.2
        if self.remotecallbacks is not None:
            fetch_kwargs['callbacks'] = self.remotecallbacks
        else:
            if self.credentials is not None:
                origin.credentials = self.credentials
        try:
            fetch_kwargs['prune'] = pygit2.GIT_FETCH_PRUNE
        except AttributeError:
            # pruning only available in pygit2 >= 0.26.2
            pass
        try:
            fetch_results = origin.fetch(**fetch_kwargs)
        except GitError as exc:
            exc_str = get_error_message(exc).lower()
            if 'unsupported url protocol' in exc_str \
                    and isinstance(self.credentials, pygit2.Keypair):
                log.error(
                    'Unable to fetch SSH-based %s remote \'%s\'. '
                    'You may need to add ssh:// to the repo string or '
                    'libgit2 must be compiled with libssh2 to support '
                    'SSH authentication.', self.role, self.id,
                    exc_info=True
                )
            elif 'authentication required but no callback set' in exc_str:
                log.error(
                    '%s remote \'%s\' requires authentication, but no '
                    'authentication configured', self.role, self.id,
                    exc_info=True
                )
            else:
                log.error(
                    'Error occurred fetching %s remote \'%s\': %s',
                    self.role, self.id, exc,
                    exc_info=True
                )
            return False
        try:
            # pygit2.Remote.fetch() returns a dict in pygit2 < 0.21.0
            received_objects = fetch_results['received_objects']
        except (AttributeError, TypeError):
            # pygit2.Remote.fetch() returns a class instance in
            # pygit2 >= 0.21.0
            received_objects = fetch_results.received_objects
        if received_objects != 0:
            log.debug(
                '%s received %s objects for remote \'%s\'',
                self.role, received_objects, self.id
            )
        else:
            log.debug('%s remote \'%s\' is up-to-date', self.role, self.id)
        refs_post = self.repo.listall_references()
        cleaned = self.clean_stale_refs(local_refs=refs_post)
        return True \
            if (received_objects or refs_pre != refs_post or cleaned) \
            else None
1296034
def fetch(self, origination_number=values.unset):
        
        return self._proxy.fetch(origination_number=origination_number, )
969856
def get_node(self, key):
        """"""
        pos = self._get_node_pos(key)
        if pos is None:
            return None
        return self._hashring[self._sorted_keys[pos]]
330250
def fetch(self):
        
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return InviteInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            channel_sid=self._solution['channel_sid'],
            sid=self._solution['sid'],
        )
1236061
def fetch(self, origination_number=values.unset):
        
        params = values.of({'OriginationNumber': origination_number, })

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return NumberInstance(
            self._version,
            payload,
            destination_number=self._solution['destination_number'],
        )
202335
def _get_replica_set_members(self, selector):
        """"""
        # Implemented here in Topology instead of MongoClient, so it can lock.
        with self._lock:
            topology_type = self._description.topology_type
            if topology_type not in (TOPOLOGY_TYPE.ReplicaSetWithPrimary,
                                     TOPOLOGY_TYPE.ReplicaSetNoPrimary):
                return set()

            return set([sd.address for sd in selector(self._new_selection())])
195357
def _get_redis_server(opts=None):
    '''
    
    '''
    global REDIS_SERVER
    if REDIS_SERVER:
        return REDIS_SERVER
    if not opts:
        opts = _get_redis_cache_opts()

    if opts['cluster_mode']:
        REDIS_SERVER = StrictRedisCluster(startup_nodes=opts['startup_nodes'],
                                          skip_full_coverage_check=opts['skip_full_coverage_check'])
    else:
        REDIS_SERVER = redis.StrictRedis(opts['host'],
                                   opts['port'],
                                   unix_socket_path=opts['unix_socket_path'],
                                   db=opts['db'],
                                   password=opts['password'])
    return REDIS_SERVER
728302
def get_replicas(self, keyspace, key):
        
        t = self.token_map
        if not t:
            return []
        try:
            return t.get_replicas(keyspace, t.token_class.from_key(key))
        except NoMurmur3:
            return []
263504
def fetch(self, failures=True, wait=0):
        
        if self.started:
            return fetch_group(self.group, failures=failures, wait=wait, count=self.length(), cached=self.cached)
168821
def get_nodes(cluster):
    
    gk = get_api_client()
    site = get_cluster_site(cluster)
    return gk.sites[site].clusters[cluster].nodes.list()
521569
def fetch(self):
        
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return SyncListItemInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            list_sid=self._solution['list_sid'],
            index=self._solution['index'],
        )
598649
def get(self, part):
        
        redis_key = ':'.join([self.namespace, self.key, part])

        objectType = self.conn.type(redis_key)
        if objectType == "string":
            self._data[part] = self.conn.get(redis_key)

        elif objectType == "list":
            self._data[part] = RedisList(redis_key, self.conn)

        else:
            raise RedisORMException("Other types besides string and list are unsupported at this time.")