sad but faster than slice...
505453
function arrayCopyChildNodes(parent) {
    var copy=[], i=0;
    for (var n=parent.firstChild; n; n=n.nextSibling) {
      copy[i++] = n;
    }
    return copy;
  }
487579
def _decompose_slice(key, size):
    
    start, stop, step = key.indices(size)
    if step > 0:
        # If key already has a positive step, use it as is in the backend
        return key, slice(None)
    else:
        # determine stop precisely for step > 1 case
        # e.g. [98:2:-2] -> [98:3:-2]
        stop = start + int((stop - start - 1) / step) * step + 1
        start, stop = stop + 1, start + 1
        return slice(start, stop, -step), slice(None, None, -1)
1323422
def getbyteslice(self, start, end):
        """"""
        c = self._rawarray[start:end]
        return c
363399
def slicedIterator(sourceList, sliceSize):
    
    start = 0
    end = 0

    while len(sourceList) > end:
        end = start + sliceSize
        yield sourceList[start: end]
        start = end
553666
function slice(start, end) {
      if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix
      var len = anObject(this).byteLength;
      var first = toAbsoluteIndex(start, len);
      var final = toAbsoluteIndex(end === undefined ? len : end, len);
      var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(final - first));
      var viewS = new $DataView(this);
      var viewT = new $DataView(result);
      var index = 0;
      while (first < final) {
        viewT.setUint8(index++, viewS.getUint8(first++));
      }return result;
    }
1110331
function slice (ar, start, end) {
    return Array.prototype.slice.call(ar, start, end)
  }
1160829
def slice_on_length(self, data_len, *addSlices):
        '''
        
        '''
        if len(self.ordered_ranges) + len(addSlices) == 0:
            return slice(None,None,None)
        ranges = self.ordered_ranges
        if len(addSlices) > 0:
            ranges = ranges + DimensionRange(*addSlices).ordered_ranges
        return self._combine_lists_of_ranges_on_length(data_len, *ranges)
1000325
def slice_slice(old_slice, applied_slice, size):
    
    step = (old_slice.step or 1) * (applied_slice.step or 1)

    # For now, use the hack of turning old_slice into an ndarray to reconstruct
    # the slice start and stop. This is not entirely ideal, but it is still
    # definitely better than leaving the indexer as an array.
    items = _expand_slice(old_slice, size)[applied_slice]
    if len(items) > 0:
        start = items[0]
        stop = items[-1] + int(np.sign(step))
        if stop < 0:
            stop = None
    else:
        start = 0
        stop = 0
    return slice(start, stop, step)
1103757
public int compareTo(Slice that)
    {
        if (this == that) {
            return 0;
        }
        if (this.data == that.data && length == that.length && offset == that.offset) {
            return 0;
        }

        int minLength = Math.min(this.length, that.length);
        for (int i = 0; i < minLength; i++) {
            int thisByte = 0xFF & this.data[this.offset + i];
            int thatByte = 0xFF & that.data[that.offset + i];
            if (thisByte != thatByte) {
                return (thisByte) - (thatByte);
            }
        }
        return this.length - that.length;
    }
1175612
def slice_by_size(seq, size):
    """"""
    filling = null
    for it in zip(*(itertools_chain(seq, [filling] * size),) * size):
        if filling in it:
            it = tuple(i for i in it if i is not filling)
        if it:
            yield it
762603
def _iterslice(self, slice):
        """"""
        indices = range(*slice.indices(len(self._records)))
        if self.is_attached():
            rows = self._enum_attached_rows(indices)
            if slice.step is not None and slice.step < 0:
                rows = reversed(list(rows))
        else:
            rows = zip(indices, self._records[slice])

        fields = self.fields
        for i, row in rows:
            yield Record._make(fields, row, self, i)
849540
def slice(self, start=None, end=None, step=None):
        """"""
        return self.childs[start:end:step]
1143698
public Slice slice(int index, int length)
    {
        if (index == 0 && length == this.length) {
            return this;
        }

        checkPositionIndexes(index, index + length, this.length);
        if (index >= 0 && length == 0) {
            return Slices.EMPTY_SLICE;
        }
        return new Slice(data, offset + index, length);
    }
487689
function (arrayish, begin, end) {
            return Array.prototype.slice.call(arrayish, begin, end);
        }
1106326
function slice(start, end) {
	    if ($slice !== undefined && end === undefined) return $slice.call(_anObject(this), start); // FF fix
	    var len = _anObject(this).byteLength;
	    var first = _toAbsoluteIndex(start, len);
	    var fin = _toAbsoluteIndex(end === undefined ? len : end, len);
	    var result = new (_speciesConstructor(this, $ArrayBuffer))(_toLength(fin - first));
	    var viewS = new $DataView(this);
	    var viewT = new $DataView(result);
	    var index = 0;
	    while (first < fin) {
	      viewT.setUint8(index++, viewS.getUint8(first++));
	    }return result;
	  }
1343647
function slice(input, begin=0, end=Infinity) {
  if (isStream(input)) {
    if (begin >= 0 && end >= 0) {
      let bytesRead = 0;
      return transformRaw(input, {
        transform(value, controller) {
          if (bytesRead < end) {
            if (bytesRead + value.length >= begin) {
              controller.enqueue(slice(value, Math.max(begin - bytesRead, 0), end - bytesRead));
            }
            bytesRead += value.length;
          } else {
            controller.terminate();
          }
        }
      });
    }
    if (begin < 0 && (end < 0 || end === Infinity)) {
      let lastBytes = [];
      return transform(input, value => {
        if (value.length >= -begin) lastBytes = [value];
        else lastBytes.push(value);
      }, () => slice(concat(lastBytes), begin, end));
    }
    if (begin === 0 && end < 0) {
      let lastBytes;
      return transform(input, value => {
        const returnValue = lastBytes ? concat([lastBytes, value]) : value;
        if (returnValue.length >= -end) {
          lastBytes = slice(returnValue, end);
          return slice(returnValue, begin, end);
        } else {
          lastBytes = returnValue;
        }
      });
    }
    console.warn(`stream.slice(input, ${begin}, ${end}) not implemented efficiently.`);
    return fromAsync(async () => slice(await readToEnd(input), begin, end));
  }
  if (input[externalBuffer]) {
    input = concat(input[externalBuffer].concat([input]));
  }
  if (isUint8Array(input) && !(NodeBuffer && NodeBuffer.isBuffer(input))) {
    if (end === Infinity) end = input.length;
    return input.subarray(begin, end);
  }
  return input.slice(begin, end);
}
1209218
private static function upload_slice(
        $bucketName, $srcPath, $dstPath,
        $bizAttr = null, $sliceSize = null, $insertOnly = null)
    {
        $srcPath = realpath($srcPath);
        $fileSize = filesize($srcPath);
        $dstPath = self::cosUrlEncode($dstPath);

        $expired = self::time() + self::EXPIRED_SECONDS;
        $url = self::generateResUrl($bucketName, $dstPath);
        $sign = Auth::appSign($expired, $bucketName);
        $sha1 = hash_file('sha1', $srcPath);

        $ret = self::upload_prepare(
                $fileSize, $sha1, $sliceSize,
                $sign, $url, $bizAttr, $insertOnly);

        if ($ret['code'] != 0) {
            return $ret;
        }

        if (isset($ret['data'])
                && isset($ret['data']['url'])) {
            //秒传命中，直接返回了url
            return $ret;
        }

        $sliceSize = $ret['data']['slice_size'];
        if ($sliceSize > self::SLICE_SIZE_3M ||
            $sliceSize <= 0) {
            $ret['code'] = self::COSAPI_PARAMS_ERROR;
            $ret['message'] = 'illegal slice size';

            return $ret;
        }

        $session = $ret['data']['session'];
        $offset = $ret['data']['offset'];

        $sliceCnt = ceil($fileSize / $sliceSize);
        // expired seconds for one slice mutiply by slice count
        // will be the expired seconds for whole file
        $expired = self::time() + (self::EXPIRED_SECONDS * $sliceCnt);
        $sign = Auth::appSign($expired, $bucketName);

        $ret = self::upload_data(
                $fileSize, $sha1, $sliceSize,
                $sign, $url, $srcPath,
                $offset, $session);

        return $ret;
    }