@param Slice $slice

@return Image
439869
public function apply(Slice $slice): Image
    {
        $image = $this->image();
        $sizes = $this->received($image, $slice);

        return $this->handler($image, $sizes);
    }
784088
public function image()
    {
        if (!\count($this)) {
            throw new \InvalidArgumentException('The current node list is empty.');
        }

        $node = $this->getNode(0);

        if (!$node instanceof \DOMElement) {
            throw new \InvalidArgumentException(sprintf('The selected node should be instance of DOMElement, got "%s".', \get_class($node)));
        }

        return new Image($node, $this->baseHref);
    }
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;
	  }
74537
public function slice(int $offset, int $length = null)
    {
        $actions = $this->internalDataListActions;
        $actions[] = ['slice', $offset, $length];
        $data = $this->internalDataListUpdateData($this->internalDataListData, $actions);
        $slice = array_slice($data, $offset, $length);
        $className = get_class($this);
        $list = new $className();
        foreach ($slice as $object) {
            $list->push($object);
        }
        return $list;
    }
798989
public function displayImage($which = 'main') {
		$js = '	if(isCertifColorboxActive == 0) { 
					activatecertifcolorbox();
					isCertifColorboxActive = 1;
				}
		';
		
		$script = '';
		$controller = Globals::getController();
		if($controller && !($controller instanceof IndividualController)){
			$controller->addInlineJavascript('$(document).ready(function() { '.$js.' });');
		} else {
			$script = '<script>' . $js . '</script>';
		}
		
		if ($which == 'icon' || !file_exists($this->getServerFilename())) {
			// Use an icon
			$image =
			'<i dir="auto" class="icon-maj-certificate margin-h-2"' .
			' title="' . strip_tags($this->getFullName()) . '"' .
			'></i>';
		} else {
			$imgsize = getimagesize($this->getServerFilename());
			$image =
			'<img' .
			' class ="'. 'certif_image'					 	. '"' .
			' dir="'   . 'auto'                           	. '"' . // For the tool-tip
			' src="'   . $this->getHtmlUrlDirect() 			. '"' .
			' alt="'   . strip_tags($this->getFullName()) 	. '"' .
			' title="' . strip_tags($this->getFullName()) 	. '"' .
			$imgsize[3] . // height="yyy" width="xxx"
			'>';
		}	
		return
		'<a' .
		' class="'          . 'certgallery'                          . '"' .
		' href="'           . $this->getHtmlUrlDirect()    		 . '"' .
		' type="'           . $this->mimeType()                  . '"' .
		' data-obje-url="'  . $this->getHtmlUrl()                . '"' .
		' data-title="'     . strip_tags($this->getFullName())   . '"' .
		'>' . $image . '</a>'.$script;
	}
357622
public function slice($offset, $length = null): CollectionInterface
    {
        if ($length < 0) {
            throw new InvalidArgumentException('Negative slice lengths are not supported');
        }

        $result = $this;
        if ($offset < 0) {
            $result = $this->take($offset);
        } elseif ($offset > 0) {
            $result = $this->offset($offset);
        }

        if ($length !== null) {
            $result = $result->take($length);
        }

        return $result;
    }
901869
protected function update($slice): self
    {
        if (is_array($slice))
        {
            $slice = new Slice($slice);
        }

        $this->expire   = $slice->getData('expire', $this->expire);
        $this->domain   = $slice->getData('domain', $this->domain);
        $this->secure   = $slice->getData('secure', $this->secure);
        $this->path     = $slice->getData('path', $this->path);
        $this->httpOnly = $slice->getData('httpOnly', $this->httpOnly);

        if ($this->expire instanceof Carbon)
        {
            $this->expire = $this->expire->timestamp;
        }

        if ($this->expire > \time())
        {
            $this->expire -= \time();
        }

        return $this;
    }
1210025
def slices(img, shape=[3, 4]):
    
    sh = np.asarray(shape)
    i_max = np.prod(sh)
    allimg = np.zeros(img.shape[-2:] * sh)

    for i in range(0, i_max):
        # i = 0
        islice = round((img.shape[0] / float(i_max)) * i)
        #         print(islice)
        imgi = img[islice, :, :]
        coords = index_to_coords(i, sh)
        aic = np.asarray(img.shape[-2:]) * coords

        allimg[aic[0]:aic[0] + imgi.shape[-2], aic[1]:aic[1] + imgi.shape[-1]] = imgi

    #     plt.imshow(imgi)
    #     print(imgi.shape)
    #     print(img.shape)
    return allimg
888626
def slice!(slice = nil)
      raise(Exception, "Slicing unavailable!") unless sliced?
      if slice.present?
        if slice.to_i.in?(1..slice_number)
          @current_slice = slice.to_i
        else
          raise(ArgumentError, "Slice number must be Integer in (1..#{slice_number}). #{slice.inspect} passed.")
        end
      end
      self
    end
844845
public function slice(int $offset, ?int $length = null, bool $preserveKeys = false): self
    {
        return new static(array_slice($this->storage, $offset, $length, $preserveKeys));
    }
447737
function(sliceCode,data){
    	console.log(_outSpritePath);
        var _slice;
        for(var key in sliceCode){
            _slice = sliceCode[key];
            var _code = "background-image: url(.";
                _code += _outSpritePath.slice(_outSpritePath.lastIndexOf("/"),_outSpritePath.length);
                _code += "/";
                _code += _outSpriteName;
                _code += ");";
                _code += "background-position: -";
                _code += _slice.x;
                _code += "px -";
                _code += _slice.y;
                _code += "px;";
            data = data.replace(_slice.code,_code);
        }
        return data;
    }
929320
public function slice(int $count) : self
    {
        $list = $this->list;
        $listCount = $list->count();
        $new = new \SplFixedArray($listCount - $count);

        foreach ($new as $index => $val) {
            $new[$index] = $list[($index + $count)];
        }

        return new static($new);
    }
880852
public function apply( $image ) {
        $image->getCore()->blurImage(1 * $this->amount, 0.5 * $this->amount);
        return $image;
    }
432245
public function getImages(ImagesQuery $query = null) {
        if (!$query) {
            $query = new ImagesQuery();
        }

        $params = array(
            'user' => $this->getUser(),
            'page' => $query->page(),
            'limit' => $query->limit(),
        );

        if ($query->metadata()) {
            $params['metadata'] = true;
        }

        if ($from = $query->from()) {
            $params['from'] = $from;
        }

        if ($to = $query->to()) {
            $params['to'] = $to;
        }

        if ($fields = $query->fields()) {
            $params['fields'] = $fields;
        }

        if ($sort = $query->sort()) {
            $params['sort'] = $sort;
        }

        if ($ids = $query->ids()) {
            $params['ids'] = $ids;
        }

        if ($checksums = $query->checksums()) {
            $params['checksums'] = $checksums;
        }

        if ($originalChecksums = $query->originalChecksums()) {
            $params['originalChecksums'] = $originalChecksums;
        }

        $response = $this->getCommand('GetImages', $params)->execute();
        $response['images'] = array_map(
            array('ImboClient\Helper\PublicKeyFallback', 'fallback'),
            $response['images']
        );

        return $response;
    }
1052496
public static function upload_slice_impl($filePath, $bucket, $fileid, $userid = 0, $magicContext, $sliceSize, $session, $params) {
         $filePath = realpath($filePath);
         
         if (!file_exists($filePath)) {
             self::setMessageInfo(-1, "file not exixts");                        
             return false;
         }
         
         $fileSize = filesize($filePath);  
         
        $expired = time() + self::EXPIRED_SECONDS;
        $url = self::generateResUrl($bucket, $userid, $fileid);
        $sign = Auth::getAppSignV2($bucket, $fileid, $expired);
        if(false === $sign)
        {
            return false;
        }
        
        $sha1 = hash_file('sha1', $filePath);

        $info = self::upload_slice_init(
               $url, $sign,$sha1,
                 $fileSize,$sliceSize,$session,$magicContext);
        if(false === $info)
        {
            return false;
        }
        
        if(isset($info['slice_size']))
        {
            self::$_sliceSize = $info['slice_size'];
        }
        else
        {
            self::$_sliceSize = $sliceSize;
        }
        
        $retryTimes = 0;
        $newInfo = array();
        while(!isset($info['url']) && isset($info['session']))
        {  
            $newInfo = self::upload_slice_data($filePath, $info, $sign, $url);
            if(false === $newInfo)
            { 
                $retryTimes++;
                if($retryTimes >= self::MAX_RETRY_TIMES)
                {
                    $info = false;
                    break;
                }
                continue;
            }                                  

            $retryTimes = 0;

            $info = $newInfo;
            if(isset($newInfo['offset']))
            {
                $info['offset'] = $newInfo['offset'] + self::$_sliceSize;
            }                      
        }
        
        $messageInfo = self::getMessageInfo();
        
        if(false === $info)
        {
            return false;
        }
        
        $data = array(
                'url' => $info['url'],
                'downloadUrl' => $info['download_url'],
                'fileid' => $info['fileid'],
            );
          
        self::setMessageInfo(0, "upload slice success");

        return $data;
        
    }
333578
protected function slice($file)
    {
        if (empty($this->storage[$file]))
        {
            $require = $this->requireFile($file);

            $this->storage[$file] = $this->make($require);
        }

        return $this->storage[$file];
    }
535369
public function slice($field, $limit, $skip = null)
    {
        $limit  = (int) $limit;
        $skip   = (int) $skip;

        if ($skip) {
            $this->projection[$field] = array('$slice' => array($skip, $limit));
        } else {
            $this->projection[$field] = array('$slice' => $limit);
        }

        $this->skipDocumentPool();

        return $this;
    }