Retrieves the indices for this window as a tuple of slices
505575
def indices(self, includeChannel=True):
		
		if self.dimOrder == DimOrder.HeightWidthChannel:
			
			# Equivalent to [self.y:self.y+self.h+1, self.x:self.x+self.w+1]
			return (
				slice(self.y, self.y+self.h),
				slice(self.x, self.x+self.w)
			)
			
		elif self.dimOrder == DimOrder.ChannelHeightWidth:
			
			if includeChannel is True:
				
				# Equivalent to [:, self.y:self.y+self.h+1, self.x:self.x+self.w+1]
				return (
					slice(None, None),
					slice(self.y, self.y+self.h),
					slice(self.x, self.x+self.w)
				)
				
			else:
				
				# Equivalent to [self.y:self.y+self.h+1, self.x:self.x+self.w+1]
				return (
					slice(self.y, self.y+self.h),
					slice(self.x, self.x+self.w)
				)
			
		else:
			raise Error('Unsupported order of dimensions: ' + str(self.dimOrder))
175441
def get_code_indices(s: Union[str, 'ChainedBase']) -> Dict[int, str]:
    
    indices = {}
    i = 0
    codes = get_codes(s)
    for code in codes:
        codeindex = s.index(code)
        realindex = i + codeindex
        indices[realindex] = code
        codelen = len(code)
        i = realindex + codelen
        s = s[codeindex + codelen:]
    return indices
459133
def slices(self):
        

        return (slice(self.iymin, self.iymax), slice(self.ixmin, self.ixmax))
733868
def get(self, *index):
        
        assert self.wrapFunction is not None
        if len(index) == 1 and isinstance(index[0], (tuple, list)):
            index = index[0]
        if len(index) == 0:
            return self.wrapFunction(self._impl.get())
        else:
            return self.wrapFunction(self._impl.get(Tuple(index)._impl))
824218
def width_aware_slice(self, index):
        """"""
        if wcswidth(self.s) == -1:
            raise ValueError('bad values for width aware slicing')
        index = normalize_slice(self.width, index)
        counter = 0
        parts = []
        for chunk in self.chunks:
            if index.start < counter + chunk.width and index.stop > counter:
                start = max(0, index.start - counter)
                end = min(index.stop - counter, chunk.width)
                if end - start == chunk.width:
                    parts.append(chunk)
                else:
                    s_part = width_aware_slice(chunk.s, max(0, index.start - counter), index.stop - counter)
                    parts.append(Chunk(s_part, chunk.atts))
            counter += chunk.width
            if index.stop < counter:
                break
        return FmtStr(*parts) if parts else fmtstr('')
848817
def []( *indices )
      if indices.empty?
        force
      else
        if indices.last.is_a? Range
          view = slice indices.last.min, indices.last.size
        else
          view = element indices.last
        end
        view[ *indices[ 0 ... -1 ] ]
      end
    end
908543
def get_lines(self, key):
        """"""
        if key in self._indices:
            return self._indices[key].values()
        else:
            return []
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)
451941
def _indexes(arr):
    
    myarr = np.array(arr)
    if myarr.ndim == 1:
        return list(range(len(myarr)))
    elif myarr.ndim == 2:
        return tuple(itertools.product(list(range(arr.shape[0])),
                                       list(range(arr.shape[1]))))
    else:
        raise NotImplementedError('Only supporting arrays of dimension 1 and 2 as yet.')
430934
def slices_to_global_coords(self, slices):
    
    bbox = self.bbox_to_mip(slices, self.mip, 0)
    return bbox.to_slices()
1162246
def normalize_tuple_slice(node):
    
    if not any(isinstance(elt, ast.Slice) for elt in node.elts):
        return ast.Index(value=node)

    return ast.ExtSlice(
        [
            # Wrap non-Slice nodes in Index nodes.
            elt if isinstance(elt, ast.Slice) else ast.Index(value=elt)
            for elt in node.elts
        ]
    )
1108173
def index_sets(self, as_set=False):
        """"""
        indexes = frozenset if as_set else tuple
        return [indexes(b.iter_set()) for b in self]
408686
function getIndices(x, y) {
         if (this.indices.length === 0) {
           var points = this.points;
           var data = []; // flatten the points vector array

           for (var i = 0; i < points.length; i++) {
             // XXX Optimize me
             data.push(points[i].x);
             data.push(points[i].y);
           }

           this.indices = earcut_1(data);
         }

         return this.indices;
       }
1124049
def toArray(self):
        
        arr = np.zeros((self.size,), dtype=np.float64)
        arr[self.indices] = self.values
        return arr
846252
def _get_points(self):
        
        return tuple([self._getitem__points(i)
                     for i in range(self._len__points())])
538444
def tuple_index(self, n):
        ''''''
        return n.args and n.args[-1].type == 'index' and general_type(n.args[-1].sequence.pseudo_type) == 'Tuple' and\
               n.args[-1].index.type == 'int' and\
               (n.args[-1].index.value == -1 or n.args[-1].index.value == len(n.args[-1].sequence.pseudo_type) - 2)
815798
def _slice(self, slicer):
        
        if isinstance(slicer, tuple):
            col, loc = slicer
            if not com.is_null_slice(col) and col != 0:
                raise IndexError("{0} only contains one item".format(self))
            return self.values[loc]
        return self.values[slicer]