Returns the custom image associated with a given app. If there are
  multiple candidate images on disk, one is chosen arbitrarily.
5929
def get_custom_image(user_context, app_id):
  """"""
  possible_paths = _valid_custom_image_paths(user_context, app_id)
  existing_images = filter(os.path.exists, possible_paths)
  if len(existing_images) > 0:
    return existing_images[0]
1172706
def get_cover_image(self, size=SIZE_EXTRA_LARGE):
        
        if "image" not in self.info:
            self.info["image"] = _extract_all(
                self._request(self.ws_prefix + ".getInfo", cacheable=True), "image"
            )
        return self.info["image"][size]
508135
def find_image(self, image, configuration):
        """"""
        images = configuration["images"]
        available = list(images.keys())

        if not image:
            info = {}
            if available:
                info["available"] = available
            raise BadOption("Please use --image to specify an image", **info)

        if image not in images:
            raise BadOption("No such image", wanted=image, available=available)
56689
function (callback) {
        if (!self._image) {
          var paths = (process.env.PATH || '').split(delimiter);
          if (!_.find(paths, function(p) {
            if (fs.existsSync(p + '/imagecrunch')) {
              self._image = require('./lib/image/imagecrunch.js')();
              return true;
            }
            // Allow for Windows and Unix filenames for identify. Silly oversight
            // after getting delimiter right (:
            if (fs.existsSync(p + '/identify') || fs.existsSync(p + '/identify.exe')) {
              self._image = require('./lib/image/imagemagick.js')();
              return true;
            }
          })) {
            // Fall back to jimp, no need for an error
            self._image = require('./lib/image/jimp.js')();
          }
        }
        return callback(null);
      }
1261027
def get_image(conn, vm_):
    '''
    
    '''
    images = conn.list_images()
    vm_image = config.get_cloud_config_value('image', vm_, __opts__)

    if not six.PY3:
        vm_image = vm_image.encode('ascii', 'salt-cloud-force-ascii')

    for img in images:
        if isinstance(img.id, six.string_types) and not six.PY3:
            img_id = img.id.encode('ascii', 'salt-cloud-force-ascii')
        else:
            img_id = str(img.id)  # future lint: disable=blacklisted-function

        if isinstance(img.name, six.string_types) and not six.PY3:
            img_name = img.name.encode('ascii', 'salt-cloud-force-ascii')
        else:
            img_name = str(img.name)  # future lint: disable=blacklisted-function

        if vm_image and vm_image in (img_id, img_name):
            return img

    raise SaltCloudNotFound(
        'The specified image, \'{0}\', could not be found.'.format(vm_image)
    )
407231
public static String findIconUrl( AbstractApplication app ) {

		StringBuilder sb = new StringBuilder();
		File iconFile = findIcon( app );
		if( iconFile != null ) {
			sb.append( "/" );
			sb.append( app.getName());

			if( app instanceof ApplicationTemplate ) {
				sb.append( "/" );
				sb.append(((ApplicationTemplate) app).getVersion());
			}

			sb.append( "/" );
			sb.append( iconFile.getName());
		}

		return sb.toString();
	}
1308597
def large_image_url(self):
        """"""
        if self.application_id is None:
            return None

        try:
            large_image = self.assets['large_image']
        except KeyError:
            return None
        else:
            return 'https://cdn.discordapp.com/app-assets/{0}/{1}.png'.format(self.application_id, large_image)
883361
def _get_image(self):
        
        if not hasattr(self, '_image_cache'):
            from easy_thumbnails.source_generators import pil_image
            self.image = pil_image(self)
        return self._image_cache
1037652
def get_image(vm_):
    '''
    
    '''
    images = avail_images()
    vm_image = config.get_cloud_config_value(
        'image', vm_, __opts__, search_global=False
    )
    if not isinstance(vm_image, six.string_types):
        vm_image = six.text_type(vm_image)

    for image in images:
        if vm_image in (images[image]['name'],
                        images[image]['slug'],
                        images[image]['id']):
            if images[image]['slug'] is not None:
                return images[image]['slug']
            return int(images[image]['id'])
    raise SaltCloudNotFound(
        'The specified image, \'{0}\', could not be found.'.format(vm_image)
    )
1105262
def import_image(image_path, os_version):
    
    image_name = os.path.basename(image_path)
    print("Checking if image %s exists or not, import it if not exists" %
          image_name)
    image_info = sdk_client.send_request('image_query', imagename=image_name)
    if 'overallRC' in image_info and image_info['overallRC']:
        print("Importing image %s ..." % image_name)
        url = 'file://' + image_path
        ret = sdk_client.send_request('image_import', image_name, url,
                                {'os_version': os_version})
    else:
        print("Image %s already exists" % image_name)
584979
def processed_image(image, options = {})
      size = options[:size]
      upsample = !!options[:upsample]

      return image unless size.present? && has_convertible_format?

      if options[:crop]
        crop(size, options[:crop_from], options[:crop_size], upsample)
      else
        resize(size, upsample)
      end
    end
133445
def _app(self):
        
        if self.app is not None:
            return self.app

        ctx = _request_ctx_stack.top
        if ctx is not None:
            return ctx.app

        try:
            from flask import _app_ctx_stack
            app_ctx = _app_ctx_stack.top
            if app_ctx is not None:
                return app_ctx.app
        except ImportError:
            pass

        raise RuntimeError('assets instance not bound to an application, '+
                            'and no application in current context')
1151890
def fetch(self):
        
        api = self.doapi_manager
        return api._image(api.request(self.url)["image"])
1329473
def getAdditionalImages(self):
        '''
        
        '''

        self._additionalImages = self._client.getAdditionalImages(self.setID)
        return self._additionalImages
679661
def process_image(source, processor_options, processors=None):
    
    processor_options = ThumbnailOptions(processor_options)
    if processors is None:
        processors = [
            utils.dynamic_import(name)
            for name in settings.THUMBNAIL_PROCESSORS]
    image = source
    for processor in processors:
        image = processor(image, **processor_options)
    return image
759026
def get_image(width, height=None, background_color="cccccc", random_background_color=False):
    
    return Image(
        url=placeholdit.get_url(
            width,
            height=height,
            background_color=background_color,
            random_background_color=random_background_color
        ),
        credit="This is not an image credit",
        caption="This is not a caption"
    )
1089534
def non_object_image
      image = list_item.image

      return image.file.url if image.respond_to?(:file)
      return image if image.present?

      fallback_image
    end