What images does this one require

        Taking into account parent image, and those in link and volumes.share_with options
961098
def dependency_images(self, for_running=False):
        
        candidates = []
        detach = dict((candidate, not options.attached) for candidate, options in self.dependency_options.items())

        for link in self.links:
            if link.container:
                candidates.append(link.container.name)

        if not for_running:
            for content, _ in self.commands.extra_context:
                if type(content) is dict or (hasattr(content, "is_dict") and content.is_dict) and "image" in content:
                    if not isinstance(content["image"], six.string_types):
                        candidates.append(content["image"].name)

        candidates.extend(list(self.shared_volume_containers()))

        done = []
        for candidate in candidates:
            if candidate not in done:
                done.append(candidate)
                yield candidate, detach.get(candidate, True)
1142274
function mergeAssets (
  parentVal,
  childVal,
  vm,
  key
) {
  var res = Object.create(parentVal || null);
  if (childVal) {
    assertObjectType(key, childVal, vm);
    return extend(res, childVal)
  } else {
    return res
  }
}
152058
def upload_image(vol, img, offset, parallel=1, 
  manual_shared_memory_id=None, manual_shared_memory_bbox=None, manual_shared_memory_order='F'):
  """"""
  global NON_ALIGNED_WRITE

  if not np.issubdtype(img.dtype, np.dtype(vol.dtype).type):
    raise ValueError('The uploaded image data type must match the volume data type. volume: {}, image: {}'.format(vol.dtype, img.dtype))

  (is_aligned, bounds, expanded) = check_grid_aligned(vol, img, offset)

  if is_aligned:
    upload_aligned(vol, img, offset, parallel=parallel, 
      manual_shared_memory_id=manual_shared_memory_id, manual_shared_memory_bbox=manual_shared_memory_bbox,
      manual_shared_memory_order=manual_shared_memory_order)
    return
  elif vol.non_aligned_writes == False:
    msg = NON_ALIGNED_WRITE.format(mip=vol.mip, chunk_size=vol.chunk_size, offset=vol.voxel_offset, got=bounds, check=expanded)
    raise AlignmentError(msg)

  # Upload the aligned core
  retracted = bounds.shrink_to_chunk_size(vol.underlying, vol.voxel_offset)
  core_bbox = retracted.clone() - bounds.minpt

  if not core_bbox.subvoxel():
    core_img = img[ core_bbox.to_slices() ] 
    upload_aligned(vol, core_img, retracted.minpt, parallel=parallel, 
      manual_shared_memory_id=manual_shared_memory_id, manual_shared_memory_bbox=manual_shared_memory_bbox,
      manual_shared_memory_order=manual_shared_memory_order)

  # Download the shell, paint, and upload
  all_chunks = set(chunknames(expanded, vol.bounds, vol.key, vol.underlying))
  core_chunks = set(chunknames(retracted, vol.bounds, vol.key, vol.underlying))
  shell_chunks = all_chunks.difference(core_chunks)

  def shade_and_upload(img3d, bbox):
    # decode is returning non-writable chunk
    # we're throwing them away so safe to write
    img3d.setflags(write=1) 
    shade(img3d, bbox, img, bounds)
    single_process_upload(vol, img3d, (( Vec(0,0,0), Vec(*img3d.shape[:3]), bbox.minpt, bbox.maxpt),), n_threads=0)

  download_multiple(vol, shell_chunks, fn=shade_and_upload)
774255
def post_process_symbolizer_image_file(file_href, dirs):
    
    # support latest mapnik features of auto-detection
    # of image sizes and jpeg reading support...
    # http://trac.mapnik.org/ticket/508

    mapnik_auto_image_support = (MAPNIK_VERSION >= 701)
    mapnik_requires_absolute_paths = (MAPNIK_VERSION < 601)
    file_href = urljoin(dirs.source.rstrip('/')+'/', file_href)
    scheme, n, path, p, q, f = urlparse(file_href)
    if scheme in ('http','https'):
        scheme, path = '', locally_cache_remote_file(file_href, dirs.cache)
    
    if scheme not in ('file', '') or not systempath.exists(un_posix(path)):
        raise Exception("Image file needs to be a working, fetchable resource, not %s" % file_href)
        
    if not mapnik_auto_image_support and not Image:
        raise SystemExit('PIL (Python Imaging Library) is required for handling image data unless you are using PNG inputs and running Mapnik >=0.7.0')

    img = Image.open(un_posix(path))
    
    if mapnik_requires_absolute_paths:
        path = posixpath.realpath(path)
    
    else:
        path = dirs.output_path(path)

    msg('reading symbol: %s' % path)

    image_name, ext = posixpath.splitext(path)
    
    if ext in ('.png', '.tif', '.tiff'):
        output_ext = ext
    else:
        output_ext = '.png'
    
    # new local file name
    dest_file = un_posix('%s%s' % (image_name, output_ext))
    
    if not posixpath.exists(dest_file):
        img.save(dest_file,'PNG')

    msg('Destination file: %s' % dest_file)

    return dest_file, output_ext[1:], img.size[0], img.size[1]
140636
function(opts) {
    xml2js.opts = opts;
    return opts
      .option('-i, --inputdir [directory]', 'directory for xml files', __dirname + '/xml/mraa')
      .option('-c, --custom [file]', 'json for customizations')
      .option('-t, --typemaps [directory]', 'directory for custom pointer type maps')
      .option('-g, --imagedir [directory]', 'directory to link to where the images will be kept', '')
      .option('-s, --strict', 'leave out methods/variables if unknown type')
  }
547314
def parent_dirs(file)
      parent_dir = File.dirname(file)
      if parent_dir == site.dest
        []
      else
        [parent_dir] + parent_dirs(parent_dir)
      end
    end
606571
def images(args={})
      hashes = con.describe_images('Owner' => 'self').body['imagesSet'].collect do |hash|
        h = {}
        h[:image_id]  = hash['imageId']
        h[:name]  = hash['name']
        h[:rootDeviceType] = hash['rootDeviceType']
        h
      end 
      puts Formatador.display_table(hashes)
    end
1338724
def merge!(*args)
      val = args.pop
      keys = args.flatten
      StorageFile.merge!(path, [*@parents, *keys], val)
    end
1315583
def image(out = nil)
      splash_start
      splash_composite
      return img unless out
      FileUtils.mkdir_p File.dirname(out)
      img.write(out)
    rescue Errno::ENOENT
      YAMG.puts_and_exit("Path not found '#{out}'")
    end
946082
def avail_images(kwargs=None, call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_images function must be called with '
            '-f or --function, or with the --list-images option'
        )

    if not isinstance(kwargs, dict):
        kwargs = {}

    if 'owner' in kwargs:
        owner = kwargs['owner']
    else:
        provider = get_configured_provider()

        owner = config.get_cloud_config_value(
            'owner', provider, __opts__, default='amazon'
        )

    ret = {}
    params = {'Action': 'DescribeImages',
              'Owner': owner}
    images = aws.query(params,
                       location=get_location(),
                       provider=get_provider(),
                       opts=__opts__,
                       sigver='4')

    for image in images:
        ret[image['imageId']] = image
    return ret
590769
def _load(self, titles=[], descriptions=[], images=[], urls=[], **kwargs):
        
        enough = lambda items: items # len(items) >= MAX_ITEMS

        if config.GET_ALL_DATA or not enough(self.titles):
            titles = filter(None, map(self._clean_text, titles))
            self.titles.extend(titles)

        if config.GET_ALL_DATA or not enough(self.descriptions):
            descriptions = filter(None, map(self._clean_text, descriptions))
            self.descriptions.extend(descriptions)

        ## Never mind the urls, they can be bad not worth it
        # if config.GET_ALL_DATA or not enough(self.urls):
            # # urls = [self._clean_url(u) for u in urls]
            # urls = filter(None, map(self._clean_url, urls))
            # self.urls.extend(urls)

        if config.GET_ALL_DATA:
            # images = [i for i in [self._filter_image(i) for i in images] if i]
            images = filter(None, map(self._filter_image, images))
            self.images.extend(images)
        elif not enough(self.images):
            for i in images:
                image = self._filter_image(i)
                if image:
                    self.images.append(image)
                if enough(self.images):
                    break
930362
function image_local(&$content, $dir='')
	{
	    if(empty($dir)) $dir = UPLOAD_DIR.'/extend/'.date('Ym')."/".date("d");
		if(!file_exists($dir))
		{
			mkdir(WEBPATH.$dir,0777,true);
		}
		$chunklist = array ();
		$chunklist = explode("\n",$content);
		$links = array ();
		$regs = array ();
		$source = array();
		$i = 0;
		while(list ($id, $chunk) = each($chunklist))
		{
			if (strstr(strtolower($chunk),"img") && strstr(strtolower($chunk), "src"))
			{
				while (eregi("(img[^>]*src[[:blank:]]*)=[[:blank:]]*[\'\"]?(([[a-z]{3,5}://(([.a-zA-Z0-9-])+(:[0-9]+)*))*([+:%/?=&;\\\(\),._a-zA-Z0-9-]*))(#[.a-zA-Z0-9-]*)?[\'\" ]?", $chunk, $regs))
				{
					if($regs[2])
					{
						$i++;
						$source[$i] = $regs[2];
					}
					$chunk = str_replace($regs[0], "", $chunk);
				}
			}
		}
		$newImg = array();
		foreach($source as $uri)
		{
			if(!strstr(WEBROOT,$uri) and $uri{0}!='/')
			{
				$filename=substr(time(),6,-1).rand(100000,999999).".jpg";
				copy($uri,WEBPATH.$dir.'/'.$filename);
				$content = str_replace($uri,WEBROOT.$dir."/".$filename,$content);
			}
		}
	}
361119
def setuptools_install_options(local_storage_folder):
    
    if local_storage_folder is None:
        return []
    # setuptools expects its find-links parameter to contain a list of link
    # sources (either local paths, file: URLs pointing to folders or URLs
    # pointing to a file containing HTML links) separated by spaces. That means
    # that, when specifying such items, whether local paths or URLs, they must
    # not contain spaces. The problem can be worked around by using a local
    # file URL, since URLs can contain space characters encoded as '%20' (for
    # more detailed information see below).
    #
    # Any URL referencing a folder needs to be specified with a trailing '/'
    # character in order for setuptools to correctly recognize it as a folder.
    #
    # All this has been tested using Python 2.4.3/2.4.4 & setuptools 1.4/1.4.2
    # as well as Python 3.4 & setuptools 3.3.
    #
    # Supporting paths with spaces - method 1:
    # ----------------------------------------
    # One way would be to prepare a link file and pass an URL referring to that
    # link file. The link file needs to contain a list of HTML link tags
    # (<a href="..."/>), one for every item stored inside the local storage
    # folder. If a link file references a folder whose name matches the desired
    # requirement name, it will be searched recursively (as described in method
    # 2 below).
    #
    # Note that in order for setuptools to recognize a local link file URL
    # correctly, the file needs to be named with the '.html' extension. That
    # will cause the underlying urllib2.open() operation to return the link
    # file's content type as 'text/html' which is required for setuptools to
    # recognize a valid link file.
    #
    # Supporting paths with spaces - method 2:
    # ----------------------------------------
    # Another possible way is to use an URL referring to the local storage
    # folder directly. This will cause setuptools to prepare and use a link
    # file internally - with its content read from a 'index.html' file located
    # in the given local storage folder, if it exists, or constructed so it
    # contains HTML links to all top-level local storage folder items, as
    # described for method 1 above.
    if " " in local_storage_folder:
        find_links_param = utility.path_to_URL(local_storage_folder)
        if find_links_param[-1] != "/":
            find_links_param += "/"
    else:
        find_links_param = local_storage_folder
    return ["-f", find_links_param, "--allow-hosts=None"]
649870
def ostemplates
      volumes = @compute_resource.images_by_storage('vztmpl',params[:storage])
      respond_to do |format|
        format.json { render :json => volumes }
      end
    end
1316216
def build_image_from_inherited_image(self, image_name: str, image_tag: str,
                                         repo_path: Path,
                                         requirements_option: RequirementsOptions):
        

        base_name, base_tag = self.get_inherit_image()

        if requirements_option == RequirementsOptions.no_requirements:
            image = self.get_image(base_name, base_tag)
            image.tag(image_name, image_tag)  # so ``build_image`` doesn't have to be called next time

            return image

        dockerfile = self.get_install_requirements_dockerfile(base_name, base_tag, repo_path, requirements_option)

        self.get_or_build_image(image_name, image_tag, dockerfile, build_context=repo_path.parent, pull=False)

        return self.get_image(image_name, image_tag)
794185
def avail_images(kwargs=None, call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_images function must be called with '
            '-f or --function, or with the --list-images option'
        )

    if not isinstance(kwargs, dict):
        kwargs = {}

    params = {
        'action': 'DescribeImages',
        'provider': 'system',
        'zone': _get_specified_zone(kwargs, get_configured_provider()),
    }
    items = query(params=params)

    result = {}
    for image in items['image_set']:
        result[image['image_id']] = {}
        for key in image:
            result[image['image_id']][key] = image[key]

    return result
770692
def post_process_images(self, doctree):
        """"""

        super(AbstractSlideBuilder, self).post_process_images(doctree)

        # figure out where this doctree is in relation to the srcdir
        relative_base = (
            ['..'] *
            doctree.attributes.get('source')[len(self.srcdir) + 1:].count('/')
        )

        for node in doctree.traverse(nodes.image):

            if node.get('candidates') is None:
                node['candidates'] = ('*',)

            # fix up images with absolute paths
            if node['uri'].startswith(self.outdir):
                node['uri'] = '/'.join(
                    relative_base + [
                        node['uri'][len(self.outdir) + 1:]
                    ]
                )