Gets the closest available image.

@param {Boolean} isUndo If `true`, it will return the previous image.
@returns {CKEDITOR.plugins.undo.Image} Next image or `null`.
768560
function( isUndo ) {
			var snapshots = this.snapshots,
				currentImage = this.currentImage,
				image, i;

			if ( currentImage ) {
				if ( isUndo ) {
					for ( i = this.index - 1; i >= 0; i-- ) {
						image = snapshots[ i ];
						if ( !currentImage.equalsContent( image ) ) {
							image.index = i;
							return image;
						}
					}
				} else {
					for ( i = this.index + 1; i < snapshots.length; i++ ) {
						image = snapshots[ i ];
						if ( !currentImage.equalsContent( image ) ) {
							image.index = i;
							return image;
						}
					}
				}
			}

			return null;
		}
5723
private void getNextFile(final InputStream is) throws IOException {
    if (is instanceof  java.util.zip.ZipInputStream) {
      ZipEntry ze = ((ZipInputStream) is).getNextEntry();
      while (ze != null && ze.isDirectory())
        ze = ((ZipInputStream) is).getNextEntry();
    }
  }
589057
function nextObject(cursor, callback) {
  const Cursor = require('../cursor');

  if (cursor.s.state === Cursor.CLOSED || (cursor.isDead && cursor.isDead()))
    return handleCallback(
      callback,
      MongoError.create({ message: 'Cursor is closed', driver: true })
    );
  if (cursor.s.state === Cursor.INIT && cursor.s.cmd.sort) {
    try {
      cursor.s.cmd.sort = formattedOrderClause(cursor.s.cmd.sort);
    } catch (err) {
      return handleCallback(callback, err);
    }
  }

  // Get the next object
  cursor._next((err, doc) => {
    cursor.s.state = Cursor.OPEN;
    if (err) return handleCallback(callback, err);
    handleCallback(callback, null, doc);
  });
}
769483
function() {
        $.console.error("drawer.getOpacity is deprecated. Use tiledImage.getOpacity instead.");
        var world = this.viewer.world;
        var maxOpacity = 0;
        for (var i = 0; i < world.getItemCount(); i++) {
            var opacity = world.getItemAt( i ).getOpacity();
            if ( opacity > maxOpacity ) {
                maxOpacity = opacity;
            }
        }
        return maxOpacity;
    }
684499
def get_previous_instance(self, obj):
        
        ordered_siblings = obj.get_siblings().filter(placeholder=obj.placeholder).order_by('position')
        pos = list(ordered_siblings).index(obj.cmsplugin_ptr)
        if pos > 0:
            prev_sibling = ordered_siblings[pos - 1]
            return prev_sibling.get_bound_plugin()
321805
function restoreImage (image) {
  if (image.restore && (typeof image.restore === 'function')) {
    image.restore();

    return true;
  }

  return false;
}
49426
public function GetLogo($bReturnDefaultImageIfNoneSet = false)
    {
        $oLogo = $this->GetFromInternalCache('oLogo');
        if (is_null($oLogo)) {
            $oLogo = $this->GetImage(1, 'cms_media_id', $bReturnDefaultImageIfNoneSet);
            if (is_null($oLogo)) {
                $oLogo = $this->GetIcon($bReturnDefaultImageIfNoneSet);
            }
            if (is_null($oLogo)) {
                $oLogo = false;
            }
            $this->SetInternalCache('oLogo', $oLogo);
        }

        return $oLogo;
    }
912421
def first_image(obj, options = {})
      opts = {
        collection: :images,
        method: :image,
        style: :thumbnail,
        default: image_path('noimage.jpg')
      }.merge(options.symbolize_keys!)

      image = obj.send(opts[:collection]).first
      image ? image.send(opts[:method]).url(opts[:style]) : opts[:default]
    end
966294
function getSourceAnchor(linkView, opt) {

        if (linkView.sourceAnchor) return linkView.sourceAnchor;

        // fallback: center of bbox
        var sourceBBox = getSourceBBox(linkView, opt);
        return sourceBBox.center();
    }
1043656
public E next() {
		if(!hasNext()) {
			throw new NoSuchElementException();
		}
		E retObject = next;
		next = null;
		return retObject;
	}
752996
def next_previous(self, options=None, **kwds):
        
        return self._client.photo.next_previous(self, options, **kwds)
540287
def get(img, cache_dir=CACHE_DIR, iterative=False):
    """"""
    if os.path.isfile(img):
        wal_img = img

    elif os.path.isdir(img):
        if iterative:
            wal_img = get_next_image(img)

        else:
            wal_img = get_random_image(img)

    else:
        logging.error("No valid image file found.")
        sys.exit(1)

    wal_img = os.path.abspath(wal_img)

    # Cache the image file path.
    util.save_file(wal_img, os.path.join(cache_dir, "wal"))

    logging.info("Using image \033[1;37m%s\033[0m.", os.path.basename(wal_img))
    return wal_img
298340
function (klass) {
      _emberMetalDebug.deprecate('nearestChildOf has been deprecated.', false, { id: 'ember-views.nearest-child-of', until: '3.0.0' });

      var view = _emberMetalProperty_get.get(this, 'parentView');

      while (view) {
        if (_emberMetalProperty_get.get(view, 'parentView') instanceof klass) {
          return view;
        }
        view = _emberMetalProperty_get.get(view, 'parentView');
      }
    }
793353
public T next() {
		if( loop ) {
			if( forwards ) {
				if( index >= fileNames.size() ) {
					index = fileNames.size()-1;
					forwards = false;
				}
			} else {
				if( index < 0 ) {
					index = 0;
					forwards = true;
				}
			}
		}

		if( forwards )
			imageGUI = UtilImageIO.loadImage(fileNames.get(index++));
		else
			imageGUI = UtilImageIO.loadImage(fileNames.get(index--));

		if( imageGUI == null )
			return null;

		image = type.createImage(imageGUI.getWidth(),imageGUI.getHeight());
		ConvertBufferedImage.convertFrom(imageGUI, image,true);

		// no changes needed so return the original
		if (scalefactor == 1)
			return image;

		// scale down the image
		int width = image.getWidth() / scalefactor;
		int height = image.getHeight() / scalefactor;

		if (scaled == null || scaled.getWidth() != width || scaled.getHeight() != height) {
			scaled = new BufferedImage(width, height, imageGUI.getType());
		}
		Graphics2D g2 = scaled.createGraphics();

		AffineTransform affine = new AffineTransform();
		affine.setToScale(1.0 / scalefactor, 1.0 / scalefactor);

		g2.drawImage(imageGUI, affine, null);
		imageGUI = scaled;

		return image;
	}
760884
private function findSibling(Collection $elements, SortableInterface $current, $next = false)
    {
        if ($next) {
            $sibling = $elements->filter(function (SortableInterface $s) use ($current) {
                return $s->getPosition() > $current->getPosition();
            })->first();
        } else {
            $sibling = $elements->filter(function (SortableInterface $s) use ($current) {
                return $s->getPosition() < $current->getPosition();
            })->last();
        }

        return $sibling ?: null;
    }
1372667
@Nullable
  public CloseableReference<CloseableImage> getCachedImage(@Nullable CacheKey cacheKey) {
    MemoryCache<CacheKey, CloseableImage> memoryCache = mBitmapMemoryCache;
    if (memoryCache == null || cacheKey == null) {
      return null;
    }
    CloseableReference<CloseableImage> closeableImage = memoryCache.get(cacheKey);
    if (closeableImage != null && !closeableImage.get().getQualityInfo().isOfFullQuality()) {
      closeableImage.close();
      return null;
    }
    return closeableImage;
  }
1257914
function getCheckStartEndBlockEvalFunction( isStart )
	{
		var hadBr = false, bookmarkEvaluator = CKEDITOR.dom.walker.bookmark( true );
		return function( node )
		{
			// First ignore bookmark nodes.
			if ( bookmarkEvaluator( node ) )
				return true;

			if ( node.type == CKEDITOR.NODE_TEXT )
			{
				// If there's any visible text, then we're not at the start.
				if ( node.hasAscendant( 'pre' ) || CKEDITOR.tools.trim( node.getText() ).length )
					return false;
			}
			else if ( node.type == CKEDITOR.NODE_ELEMENT )
			{
				// If there are non-empty inline elements (e.g. <img />), then we're not
				// at the start.
				if ( !inlineChildReqElements[ node.getName() ] )
				{
					// If we're working at the end-of-block, forgive the first <br /> in non-IE
					// browsers.
					if ( !isStart && !CKEDITOR.env.ie && node.getName() == 'br' && !hadBr )
						hadBr = true;
					else
						return false;
				}
			}
			return true;
		};
	}