Get the slice of this object by the value or values of the cardinal
        dimension.
775374
def slice_cardinal(self, key):
        
        cls = self.__class__
        key = check_key(self, key, cardinal=True)
        return cls(self[self[self._cardinal[0]].isin(key)])
732361
def from_slice(cls, coord):
        """"""
        if coord.step is not None:
            raise NotImplementedError('no slice step support')
        elif coord.start is not None and coord.stop is not None:
            return DoubleSlice.from_slice(coord)
        elif coord.start is not None:
            xcol, xrow, col, row = cls._parse(coord.start)
            if xcol is not None:
                return StartCell(cls._cint(xcol), cls._rint(xrow))
            elif col is not None:
                return StartCol(cls._cint(col))
            return StartRow(cls._rint(row))
        elif coord.stop is not None:
            xcol, xrow, col, row = cls._parse(coord.stop)
            if xcol is not None:
                return StopCell(cls._cint(xcol) + 1, cls._rint(xrow) + 1)
            elif col is not None:
                return StopCol(cls._cint(col) + 1)
            return StopRow(cls._rint(row) + 1)
        return cls()
402229
def get_dimension_array(array):
    
    if all(isinstance(el, list) for el in array):
        result = [len(array), len(max([x for x in array], key=len,))]

    # elif array and isinstance(array, list):
    else:
        result = [len(array), 1]

    return result
86247
def visit_Slice(self, node: ast.Slice) -> slice:
        """"""
        lower = None  # type: Optional[int]
        if node.lower is not None:
            lower = self.visit(node=node.lower)

        upper = None  # type: Optional[int]
        if node.upper is not None:
            upper = self.visit(node=node.upper)

        step = None  # type: Optional[int]
        if node.step is not None:
            step = self.visit(node=node.step)

        result = slice(lower, upper, step)

        self.recomputed_values[node] = result
        return result
665331
function getDimension (collection, dimension) {
		const first = collection[0];
		if (first && typeof first.getBoundingClientRect === "function") {
			return first.getBoundingClientRect()[dimension];
		}
	}
6120
def multiget_slice(self, keys, column_parent, predicate, consistency_level):
    
    self._seqid += 1
    d = self._reqs[self._seqid] = defer.Deferred()
    self.send_multiget_slice(keys, column_parent, predicate, consistency_level)
    return d
1095457
def get_X_slice(self, rmind):
        ''''''
        if self.forest.optimize_memory_use:
            return self.forest.X[:, rmind][self.subsample]
        else:
            return self.X[:, rmind]
1018877
def visit_ExtSlice(self, node: ast.ExtSlice) -> Tuple[Any, ...]:
        """"""
        result = tuple(self.visit(node=dim) for dim in node.dims)

        self.recomputed_values[node] = result
        return result
752495
def _slice_datasets(self, dataset_ids, slice_key, new_area, area_only=True):
        """"""
        new_datasets = {}
        datasets = (self[ds_id] for ds_id in dataset_ids)
        for ds, parent_ds in dataset_walker(datasets):
            ds_id = DatasetID.from_dict(ds.attrs)
            # handle ancillary variables
            pres = None
            if parent_ds is not None:
                pres = new_datasets[DatasetID.from_dict(parent_ds.attrs)]
            if ds_id in new_datasets:
                replace_anc(ds, pres)
                continue
            if area_only and ds.attrs.get('area') is None:
                new_datasets[ds_id] = ds
                replace_anc(ds, pres)
                continue

            if not isinstance(slice_key, dict):
                # match dimension name to slice object
                key = dict(zip(ds.dims, slice_key))
            else:
                key = slice_key
            new_ds = ds.isel(**key)
            if new_area is not None:
                new_ds.attrs['area'] = new_area

            new_datasets[ds_id] = new_ds
            if parent_ds is None:
                # don't use `__setitem__` because we don't want this to
                # affect the existing wishlist/dep tree
                self.datasets[ds_id] = new_ds
            else:
                replace_anc(new_ds, pres)
701201
function slice(v, start, end, step) {
  var r = [];
  var i = void 0;
  if (step > 0) {
    for (i = start; i < end; i += step) {
      r.push(v[i]);
    }
  } else {
    for (i = start; i > end; i += step) {
      r.push(v[i]);
    }
  }
  return r;
}
1130891
def slicing_singlevalue(arg, length):
    """"""
    if isinstance(arg, slice):
        start, stop, step = arg.indices(length)
        i = start
        if step > 0:
            while i < stop:
                yield i
                i += step
        else:
            while i > stop:
                yield i
                i += step
    else:
        try:
            i = arg.__index__()
        except AttributeError:
            raise TypeError("indices must be integers or slices, not " + arg.__class__.__name__)
        if i < 0:
            i += length
        yield i
784393
def _read_image_slice(self, arg):
        
        if 'ndims' not in self._info:
            raise ValueError("Attempt to slice empty extension")

        if isinstance(arg, slice):
            # one-dimensional, e.g. 2:20
            return self._read_image_slice((arg,))

        if not isinstance(arg, tuple):
            raise ValueError("arguments must be slices, one for each "
                             "dimension, e.g. [2:5] or [2:5,8:25] etc.")

        # should be a tuple of slices, one for each dimension
        # e.g. [2:3, 8:100]
        nd = len(arg)
        if nd != self._info['ndims']:
            raise ValueError("Got slice dimensions %d, "
                             "expected %d" % (nd, self._info['ndims']))

        targ = arg
        arg = []
        for a in targ:
            if isinstance(a, slice):
                arg.append(a)
            elif isinstance(a, int):
                arg.append(slice(a, a+1, 1))
            else:
                raise ValueError("arguments must be slices, e.g. 2:12")

        dims = self._info['dims']
        arrdims = []
        first = []
        last = []
        steps = []

        # check the args and reverse dimensions since
        # fits is backwards from numpy
        dim = 0
        for slc in arg:
            start = slc.start
            stop = slc.stop
            step = slc.step

            if start is None:
                start = 0
            if stop is None:
                stop = dims[dim]
            if step is None:
                step = 1
            if step < 1:
                raise ValueError("slice steps must be >= 1")

            if start < 0:
                start = dims[dim] + start
                if start < 0:
                    raise IndexError("Index out of bounds")

            if stop < 0:
                stop = dims[dim] + start + 1

            # move to 1-offset
            start = start + 1

            if stop < start:
                raise ValueError("python slices but include at least one "
                                 "element, got %s" % slc)
            if stop > dims[dim]:
                stop = dims[dim]

            first.append(start)
            last.append(stop)
            steps.append(step)
            arrdims.append(stop-start+1)

            dim += 1

        first.reverse()
        last.reverse()
        steps.reverse()
        first = numpy.array(first, dtype='i8')
        last = numpy.array(last, dtype='i8')
        steps = numpy.array(steps, dtype='i8')

        npy_dtype = self._get_image_numpy_dtype()
        array = numpy.zeros(arrdims, dtype=npy_dtype)
        self._FITS.read_image_slice(self._ext+1, first, last, steps, array)
        return array
390327
def split(self):
        
        x = self.__class__()
        y = self.__class__()
        for dim, val in self.items():
            if isinstance(val, tuple):
                x[dim] = val[0]
                y[dim] = val[1]
            else:
                x[dim] = val
                y[dim] = val
        return x, y
317860
def get_value(self, series, key):
        """"""
        if np.asarray(key).dtype == np.dtype(bool):
            return series.iloc[key]
        elif isinstance(key, slice):
            return series.iloc[self.slice_indexer(
                key.start, key.stop, key.step)]
        else:
            return series.iloc[self.get_loc(key)]
1230153
def depth_slice(self):
        

        if self.depth is not None:
            return self.depth

        from .depth import Depth
        self.depth = Depth(self)
        return self.depth
794597
def __slice_key_val(line):
        
        position = line.find(":")
        # If value is -1, that means the item was not found in the string.
        if position != -1:
            key = line[:position]
            value = line[position + 1:]
            value = value.lstrip()
            return key, value
        else:
            key = line
            value = None
            return key, value
87812
function slice(what, start) {
        for (var j = 0, i = start || 0, arr = []; i < what.length; i++) {
            arr[j++] = what[i];
        }
        return arr;
    }