Return a generator for the indices of the unavailable region of
        ``_reference_queue``.
430358
def _unavailable_range(self):
        
        with self._lock:
            i = self._resource_end
            j = self._resource_start
            if j < i or self.empty():
                j += self.maxsize

            for k in range(i, j):
                yield k % self.maxsize
89495
def get_variants_in_region(self, chrom, start, end):
        """"""
        bim = self.bim.loc[
            (self.bim["chrom"] == CHROM_STR_TO_INT[chrom]) &
            (start <= self.bim["pos"]) &
            (self.bim["pos"] <= end)
        ]
        for i, g in enumerate(self.bed.iter_geno_marker(bim.index)):
            info = bim.iloc[i, :]
            name, geno = g
            yield Genotypes(
                Variant(info.name, CHROM_INT_TO_STR[info.chrom],
                        info.pos, [info.a1, info.a2]),
                self._normalize_missing(geno),
                reference=info.a2,
                coded=info.a1,
                multiallelic=info.multiallelic
            )
626349
def available_services_regions(self):
        """"""
        regions = []
        if self.service_catalog:
            for service in self.service_catalog:
                service_type = service.get('type')
                if service_type is None or service_type == 'identity':
                    continue
                for endpoint in service.get('endpoints', []):
                    region = utils.get_endpoint_region(endpoint)
                    if region not in regions:
                        regions.append(region)
        return regions
618749
def fetch(self, x, y, w, h):
        

        if not at_least_libvips(8, 8):
            raise Error('libvips too old')

        psize = ffi.new('size_t *')
        pointer = vips_lib.vips_region_fetch(self.pointer, x, y, w, h, psize)
        if pointer == ffi.NULL:
            raise Error('unable to fetch from region')

        pointer = ffi.gc(pointer, glib_lib.g_free)
        return ffi.buffer(pointer, psize[0])
316809
def pickle_with_weak_refs( o ):
    
    if isinstance(o, types.GeneratorType):
        o = [i for i in o]
    walk = dict([ (path,val) for path, val in objwalk(o)])
    for path, val in walk.items():
        if len(path) > MAX_DEPTH or is_lambda(val):
            truncate_attr_at_path(o, path)
        if isinstance(val, weakref.ref):
            setattr_at_path( o, path, val() ) # Resolve weak references
    return pickle.dumps(o)
198474
def getIndices(self):
        """"""
        for indexName in self.neograph.nodes.indexes.keys():
            indexObject = self.neograph.nodes.indexes.get(indexName)
            yield Index(indexName, "vertex", "manual", indexObject)
        for indexName in self.neograph.relationships.indexes.keys():
            indexObject = self.neograph.relationships.indexes.get(indexName)
            yield Index(indexName, "edge", "manual", indexObject)
961883
def segments(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.segments(index=self._name, **kwargs)
411989
private static List<QualityIndicator<List<PointSolution>, Double>> getAvailableIndicators(
      Front referenceFront) throws FileNotFoundException {

    List<QualityIndicator<List<PointSolution>, Double>> list = new ArrayList<>() ;
    list.add(new Epsilon<PointSolution>(referenceFront)) ;
    list.add(new PISAHypervolume<PointSolution>(referenceFront)) ;
    list.add(new GenerationalDistance<PointSolution>(referenceFront)) ;
    list.add(new InvertedGenerationalDistance<PointSolution>(referenceFront)) ;
    list.add(new InvertedGenerationalDistancePlus<PointSolution>(referenceFront)) ;
    list.add(new Spread<PointSolution>(referenceFront)) ;
    list.add(new GeneralizedSpread<PointSolution>(referenceFront)) ;
    //list.add(new R2<List<DoubleSolution>>(referenceFront)) ;
    list.add(new ErrorRatio<List<PointSolution>>(referenceFront)) ;

    return list ;
  }
783618
def atIndices(indexable, indices, default=__unique):
    
    """
    if default is __unique:
        return [indexable[i] for i in indices]
    else:
        res = []
        for i in indices:
            try:
                res.append(indexable[i])
            except (IndexError, KeyError):
                res.append(default)
        return res
784299
def hidden_indices(self):
        """"""
        return tuple(sorted(set(self.micro_indices) -
                            set(self.output_indices)))
294132
def get(self, timeout=None):
        """"""
        if timeout:
            try:
                result = self._queue.get(True, timeout)
            except multiprocessing.Queue.Empty:
                return(False, None)
            return(True, result)
        return self._queue.get()
912985
def list_(prefix='', region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    def extract_name(queue_url):
        # Note: this logic taken from boto, so should be safe
        return _urlparse(queue_url).path.split('/')[2]

    try:
        r = conn.list_queues(QueueNamePrefix=prefix)
        # The 'QueueUrls' attribute is missing if there are no queues
        urls = r.get('QueueUrls', [])
        return {'result': [extract_name(url) for url in urls]}
    except botocore.exceptions.ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}
494777
def _index_unknown_and_reserved_tokens(self, unknown_token, reserved_tokens):
        """"""

        self._unknown_token = unknown_token
        # Thus, constants.UNKNOWN_IDX must be 0.
        self._idx_to_token = [unknown_token]

        if reserved_tokens is None:
            self._reserved_tokens = None
        else:
            self._reserved_tokens = reserved_tokens[:]
            self._idx_to_token.extend(reserved_tokens)

        self._token_to_idx = {token: idx for idx, token in enumerate(self._idx_to_token)}
682110
def get_variants_in_region(self, chrom, start, end):
        """"""
        region = self.get_vcf()(
            "{}:{}-{}".format(chrom, start, end)
        )
        for v in region:
            for coded_allele, g in self._make_genotypes(v.ALT, v.genotypes):
                variant = Variant(
                    v.ID, v.CHROM, v.POS, [v.REF, coded_allele]
                )
                yield Genotypes(variant, g, v.REF, coded_allele,
                                multiallelic=len(v.ALT) > 1)
715454
def get_reserved_resources(role=None):
    
    rtype = 'reserved_resources'
    cpus = 0.0
    mem = 0.0
    summary = DCOSClient().get_state_summary()

    if 'slaves' in summary:
        agents = summary.get('slaves')
        for agent in agents:
            resource_reservations = agent.get(rtype)
            reservations = []
            if role is None or '*' in role:
                reservations = resource_reservations.values()
            elif role in resource_reservations:
                reservations = [resource_reservations.get(role)]
            for reservation in reservations:
                if reservation.get('cpus') is not None:
                    cpus += reservation.get('cpus')
                if reservation.get('mem') is not None:
                    mem += reservation.get('mem')

    return Resources(cpus, mem)
313599
public static Set<String> getAvailableIDs(SystemTimeZoneType type, String region, Integer rawOffset) {
        Set<String> baseSet = null;
        switch (type) {
        case ANY:
            baseSet = getSystemZIDs();
            break;
        case CANONICAL:
            baseSet = getCanonicalSystemZIDs();
            break;
        case CANONICAL_LOCATION:
            baseSet = getCanonicalSystemLocationZIDs();
            break;
        default:
            // never occur
            throw new IllegalArgumentException("Unknown SystemTimeZoneType");
        }

        if (region == null && rawOffset == null) {
            return baseSet;
        }

        if (region != null) {
            region = region.toUpperCase(Locale.ENGLISH);
        }

        // Filter by region/rawOffset
        Set<String> result = new TreeSet<String>();
        for (String id : baseSet) {
            if (region != null) {
                String r = getRegion(id);
                if (!region.equals(r)) {
                    continue;
                }
            }
            if (rawOffset != null) {
                // This is VERY inefficient.
                TimeZone z = getSystemTimeZone(id);
                if (z == null || !rawOffset.equals(z.getRawOffset())) {
                    continue;
                }
            }
            result.add(id);
        }
        if (result.isEmpty()) {
            return Collections.emptySet();
        }

        return Collections.unmodifiableSet(result);
    }
97370
def _chain_indices(self):
        """"""
        chain_indices = deque(range(len(self.connection_chains)))
        chain_indices.rotate(self._last_chain_index)
        return chain_indices