TODO: refactor to use listImages, as the code is a copy-paste with minor changes.
193198
private @Nonnull List<MachineImage> listIsos(@Nullable ImageFilterOptions options) throws CloudException, InternalException {
        APITrace.begin(getProvider(), "Image.listIsos");
        try {
            final CSMethod method = new CSMethod(getProvider());
            final String accountNumber = (options == null ? null : options.getAccountNumber());
            final List<Param> params = new ArrayList<Param>();
            params.add(new Param("zoneId", getContext().getRegionId()));
            params.add(new Param("bootable", "true"));
            params.add(new Param("pagesize", "500"));
            final Param pageParam = new Param("page", "1");
            params.add(pageParam);

            if( accountNumber == null || getProvider().getServiceProvider().equals(CSServiceProvider.DATAPIPE) ) {
                params.add(new Param("isoFilter", "selfexecutable"));
            }
            else {
                params.add(new Param("isoFilter", "executable"));
            }

            Document doc = method.get(LIST_ISOS, params);

            final List<MachineImage> templates = new ArrayList<MachineImage>();

            int numPages = 1;
            NodeList nodes = doc.getElementsByTagName("count");
            Node n = nodes.item(0);
            if (n != null) {
                String value = n.getFirstChild().getNodeValue().trim();
                int count = Integer.parseInt(value);
                numPages = count/500;
                int remainder = count % 500;
                if (remainder > 0) {
                    numPages++;
                }
            }

            for (int page = 1; page <= numPages; page++) {
                if (page > 1) {
                    String nextPage = String.valueOf(page);
                    pageParam.setValue(nextPage);
                    doc = method.get(LIST_ISOS, params);
                }
                NodeList matches = doc.getElementsByTagName("iso");

                for( int i=0; i<matches.getLength(); i++ ) {
                    MachineImage image = toImage(matches.item(i), false, getProvider().getZoneHypervisors(getContext().getRegionId()));


                    if( image != null && (options == null || options.matches(image)) ) {
                        image.setTag("isISO", "true");
                        templates.add(image);
                    }
                }
            }

            return templates;
        }
        finally {
            APITrace.end();
        }
    }
104341
@Override
    public void printColumns(Collection<String> list) {
        String[] newList = new String[list.size()];
        list.toArray(newList);
        try {
            console.pushToConsole(org.jboss.jreadline.util.Parser.formatCompletions(newList, console.getTerminalHeight(),
                    console.getTerminalWidth()));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
94067
function() {
				var i, len;
				if (selectedElement != null) {
					switch (selectedElement.tagName) {
					case 'use':
					case 'image':
					case 'foreignObject':
						break;
					case 'g':
					case 'a':
						// Look for common styles
						var gWidth = null;
						var childs = selectedElement.getElementsByTagName('*');
						for (i = 0, len = childs.length; i < len; i++) {
							var swidth = childs[i].getAttribute('stroke-width');

							if (i === 0) {
								gWidth = swidth;
							} else if (gWidth !== swidth) {
								gWidth = null;
							}
						}

						$('#stroke_width').val(gWidth === null ? '' : gWidth);

						paintBox.fill.update(true);
						paintBox.stroke.update(true);

						break;
					default:
						paintBox.fill.update(true);
						paintBox.stroke.update(true);

						$('#stroke_width').val(selectedElement.getAttribute('stroke-width') || 1);
						$('#stroke_style').val(selectedElement.getAttribute('stroke-dasharray') || 'none');

						var attr = selectedElement.getAttribute('stroke-linejoin') || 'miter';

						if ($('#linejoin_' + attr).length != 0) {
							setStrokeOpt($('#linejoin_' + attr)[0]);
						}

						attr = selectedElement.getAttribute('stroke-linecap') || 'butt';

						if ($('#linecap_' + attr).length != 0) {
							setStrokeOpt($('#linecap_' + attr)[0]);
						}
					}
				}

				// All elements including image and group have opacity
				if (selectedElement != null) {
					var opac_perc = ((selectedElement.getAttribute('opacity')||1.0)*100);
					$('#group_opacity').val(opac_perc);
					$('#opac_slider').slider('option', 'value', opac_perc);
					$('#elem_id').val(selectedElement.id);
				}

				updateToolButtonState();
			}
676356
def avail_images():
    '''
    
    '''
    response = _query('grid', 'image/list')

    ret = {}
    for item in response['list']:
        name = item['friendlyName']
        ret[name] = item

    return ret
1250724
def parent_images(self):
        
        parents = []
        for instr in self.structure:
            if instr['instruction'] != 'FROM':
                continue
            image, _ = image_from(instr['value'])
            if image is not None:
                parents.append(image)
        return parents
1286044
function imageBounding(image) {
  var imageObj = element_object(image);
  if (!imageObj) return null;

  if (!imageObj.transform) imageObj.transform = 'matrix(1 0 0 1 0 0)';
  var matrix = helper.matrixStrToArr(imageObj.transform.trim());
  var width = imageObj.width;
  var height = imageObj.height;

  // The matrix variable contains 6 numbers, let's call them
  // a, b, c, d, e, f
  var a = matrix[0];
  var b = matrix[1];
  var c = matrix[2];
  var d = matrix[3];
  var e = matrix[4];
  var f = matrix[5];

  // The original top left point of the image is unknown. The e and f
  // in the matrix is the transformed top left point.
  // Now assume translate is applied to the image first, we have the
  // following points: (e, f), (e+w, f), (e+w, f+h), (e, f+h)
  var points1 = [e, f, e + width, f, e + width, f + height, e, f + height];

  // Then apply trasform matrix (a b c d 0 0) to these points, the
  // formula is newX = a*x + c*y, newY = b*x + d*y
  var points2 = [];
  for (var i = 0; i < points1.length; i += 2) {
    points2[i] = a * points1[i] + c * points1[i + 1];
    points2[i + 1] = b * points1[i] + d * points1[i + 1];
  }

  // Find the delta of the top left point and apply it to all the points
  var dx = points2[0] - points1[0];
  var dy = points2[1] - points1[1];
  var points = [e, f];
  for (var i = 2; i < points1.length; i += 2) {
    points[i] = points2[i] - dx;
    points[i + 1] = points2[i + 1] - dy;
  }

  var left = Number.POSITIVE_INFINITY;
  var right = Number.NEGATIVE_INFINITY;
  var top = Number.POSITIVE_INFINITY;
  var bottom = Number.NEGATIVE_INFINITY;

  for (var i = 0; i < points.length; i += 2) {
    if (points[i] < left) left = points[i];
    if (points[i] > right) right = points[i];
    if (points[i + 1] < top) top = points[i + 1];
    if (points[i + 1] > bottom) bottom = points[i + 1];
  }

  return {
    left: left,
    right: right,
    top: top,
    bottom: bottom,
    width: right - left,
    height: bottom - top
  };
}
409772
private static void processBufferedImage(BufferedImage buffimage,
            String formatName, NodeList nodes) throws Exception {
        HashMap<Object, Object> bandMap = new HashMap<Object, Object>();

        for (int i = 0; i < nodes.getLength(); i++) {
            Node node = nodes.item(i);
            if (node.getNodeType() == Node.ELEMENT_NODE) {
                if (node.getLocalName().equals("subimage")) {
                    Element e = (Element) node;
                    int x = Integer.parseInt(e.getAttribute("x"));
                    int y = Integer.parseInt(e.getAttribute("y"));
                    int w = Integer.parseInt(e.getAttribute("width"));
                    int h = Integer.parseInt(e.getAttribute("height"));
                    processBufferedImage(buffimage.getSubimage(x, y, w, h),
                            formatName, e.getChildNodes());
                } else if (node.getLocalName().equals("checksum")) {
                    CRC32 checksum = new CRC32();
                    Raster raster = buffimage.getRaster();
                    DataBufferByte buffer;
                    if (node.getParentNode().getLocalName().equals("subimage")) {
                        WritableRaster outRaster = raster
                                .createCompatibleWritableRaster();
                        buffimage.copyData(outRaster);
                        buffer = (DataBufferByte) outRaster.getDataBuffer();
                    } else {
                        buffer = (DataBufferByte) raster.getDataBuffer();
                    }
                    int numbanks = buffer.getNumBanks();
                    for (int j = 0; j < numbanks; j++) {
                        checksum.update(buffer.getData(j));
                    }
                    Document doc = node.getOwnerDocument();
                    node.appendChild(doc.createTextNode(Long.toString(checksum
                            .getValue())));
                } else if (node.getLocalName().equals("count")) {
                    String band = ((Element) node).getAttribute("bands");
                    String sample = ((Element) node).getAttribute("sample");
                    if (sample.equals("all")) {
                        bandMap.put(band, null);
                    } else {
                        HashMap<Object, Object> sampleMap = (HashMap<Object, Object>) bandMap
                                .get(band);
                        if (sampleMap == null && !bandMap.containsKey(band)) {
                            sampleMap = new HashMap<Object, Object>();
                            bandMap.put(band, sampleMap);
                        }
                        sampleMap.put(Integer.decode(sample), new Integer(0));
                    }
                } else if (node.getLocalName().equals("transparentNodata")) { // 2011-08-24
                                                                              // PwD
                    String transparentNodata = checkTransparentNodata(
                            buffimage, node);
                    node.setTextContent(transparentNodata);
                }
            }
        }

        Iterator bandIt = bandMap.keySet().iterator();
        while (bandIt.hasNext()) {
            String band_str = (String) bandIt.next();
            int[] band_indexes;
            if (buffimage.getType() == BufferedImage.TYPE_BYTE_BINARY
                    || buffimage.getType() == BufferedImage.TYPE_BYTE_GRAY) {
                band_indexes = new int[1];
                band_indexes[0] = 0;
            } else {
                band_indexes = new int[band_str.length()];
                for (int i = 0; i < band_str.length(); i++) {
                    if (band_str.charAt(i) == 'A')
                        band_indexes[i] = 3;
                    if (band_str.charAt(i) == 'B')
                        band_indexes[i] = 2;
                    if (band_str.charAt(i) == 'G')
                        band_indexes[i] = 1;
                    if (band_str.charAt(i) == 'R')
                        band_indexes[i] = 0;
                }
            }

            Raster raster = buffimage.getRaster();
            java.util.HashMap sampleMap = (java.util.HashMap) bandMap
                    .get(band_str);
            boolean addall = (sampleMap == null);
            if (sampleMap == null) {
                sampleMap = new java.util.HashMap();
                bandMap.put(band_str, sampleMap);
            }

            int minx = raster.getMinX();
            int maxx = minx + raster.getWidth();
            int miny = raster.getMinY();
            int maxy = miny + raster.getHeight();
            int[][] bands = new int[band_indexes.length][raster.getWidth()];

            for (int y = miny; y < maxy; y++) {
                for (int i = 0; i < band_indexes.length; i++) {
                    raster.getSamples(minx, y, maxx, 1, band_indexes[i],
                            bands[i]);
                }
                for (int x = minx; x < maxx; x++) {
                    int sample = 0;
                    for (int i = 0; i < band_indexes.length; i++) {
                        sample |= bands[i][x] << ((band_indexes.length - i - 1) * 8);
                    }

                    Integer sampleObj = new Integer(sample);

                    boolean add = addall;
                    if (!addall) {
                        add = sampleMap.containsKey(sampleObj);
                    }
                    if (add) {
                        Integer count = (Integer) sampleMap.get(sampleObj);
                        if (count == null) {
                            count = new Integer(0);
                        }
                        count = new Integer(count.intValue() + 1);
                        sampleMap.put(sampleObj, count);
                    }
                }
            }
        }

        Node node = nodes.item(0);
        while (node != null) {
            if (node.getNodeType() == Node.ELEMENT_NODE && node.getLocalName().equals("count")) {
                String band = ((Element) node).getAttribute("bands");
                String sample = ((Element) node).getAttribute("sample");
                HashMap sampleMap = (HashMap) bandMap.get(band);
                Document doc = node.getOwnerDocument();
                if (sample.equals("all")) {
                    Node parent = node.getParentNode();
                    Node prevSibling = node.getPreviousSibling();
                    Iterator sampleIt = sampleMap.keySet().iterator();
                    Element countnode = null;
                    int digits;
                    String prefix;
                    switch (buffimage.getType()) {
                    case BufferedImage.TYPE_BYTE_BINARY:
                        digits = 1;
                        prefix = "";
                        break;
                    case BufferedImage.TYPE_BYTE_GRAY:
                        digits = 2;
                        prefix = "0x";
                        break;
                    default:
                        prefix = "0x";
                        digits = band.length() * 2;
                    }
                    while (sampleIt.hasNext()) {
                        countnode = doc.createElementNS(
                                node.getNamespaceURI(), "count");
                        Integer sampleInt = (Integer) sampleIt.next();
                        Integer count = (Integer) sampleMap.get(sampleInt);
                        if (band.length() > 0) {
                            countnode.setAttribute("bands", band);
                        }
                        countnode.setAttribute("sample", prefix
                                + HexString(sampleInt.intValue(), digits));
                        Node textnode = doc
                                .createTextNode(count.toString());
                        countnode.appendChild(textnode);
                        parent.insertBefore(countnode, node);
                        if (sampleIt.hasNext() && prevSibling != null && prevSibling.getNodeType() == Node.TEXT_NODE) {
                            parent.insertBefore(
                                    prevSibling.cloneNode(false), node);
                        }
                    }
                    parent.removeChild(node);
                    // Fortify Mod: If the Iterator sampleIt is empty, then countnode will never be set.
                    // This will result in a null derefernce of node at the end of the loop.  Test for this
                    // case and mitigate the damage.
                    if( countnode == null ) {
                        countnode = (Element) node;
                        jlogger.log(Level.SEVERE, "Error processing image node");
                    }
                    node = countnode;
                } else {
                    Integer count = (Integer) sampleMap.get(Integer
                            .decode(sample));
                    if (count == null)
                        count = new Integer(0);
                    Node textnode = doc.createTextNode(count.toString());
                    node.appendChild(textnode);
                }
            }
            node = node.getNextSibling();
        }
    }
57952
def _array2image_list(self, array):
        
        image_list = []
        k = 0
        for i in range(self._num_bands):
            if self._compute_bool[i] is True:
                num_data = self.num_response_list[i]
                array_i = array[k:k + num_data]
                image_i = self._imageModel_list[i].ImageNumerics.array2image(array_i)
                image_list.append(image_i)
                k += num_data
        return image_list
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;
    }
1247609
def pictures(self):
        """"""

        return [b for b in self.metadata_blocks if b.code == Picture.code]
968899
def [](*args)
      a = @images[*args]
      if a.respond_to?(:each)
        ilist = self.class.new
        a.each { |image| ilist << image }
        a = ilist
      end
      a
    end
886913
private ImageFormat getFormat(List<ImageFormat> l, String n){
		for(ImageFormat f:l)
			if(f.getName().equals(n))
				return f;
		return null;
	}
210570
def stack_images(image_list, wht_list, sigma_list):
    
    image_stacked = np.zeros_like(image_list[0])
    wht_stacked = np.zeros_like(image_stacked)
    sigma_stacked = 0.
    for i in range(len(image_list)):
        image_stacked += image_list[i]*wht_list[i]
        sigma_stacked += sigma_list[i]**2 * np.median(wht_list[i])
        wht_stacked += wht_list[i]
    image_stacked /= wht_stacked
    sigma_stacked /= np.median(wht_stacked)
    wht_stacked /= len(wht_list)
    return image_stacked, wht_stacked, np.sqrt(sigma_stacked)
114260
function TexImage () {
    TexFlags.call(this)

    this.xOffset = 0
    this.yOffset = 0

    // data
    this.data = null
    this.needsFree = false

    // html element
    this.element = null

    // copyTexImage info
    this.needsCopy = false
  }
44351
public static List<double[]> histogramGray( List<File> images ) {
		List<double[]> points = new ArrayList<>();

		GrayU8 gray = new GrayU8(1,1);
		for( File f : images ) {
			BufferedImage buffered = UtilImageIO.loadImage(f.getPath());
			if( buffered == null ) throw new RuntimeException("Can't load image!");

			gray.reshape(buffered.getWidth(), buffered.getHeight());
			ConvertBufferedImage.convertFrom(buffered, gray, true);

			TupleDesc_F64 imageHist = new TupleDesc_F64(150);
			HistogramFeatureOps.histogram(gray, 255, imageHist);

			UtilFeature.normalizeL2(imageHist); // normalize so that image size doesn't matter

			points.add(imageHist.value);
		}

		return points;
	}
1467
@Override
    public InsertTrans insert(List<Image> imageList, Map<String, String> customParams) {
        return dataOperations.insert(imageList, customParams);
    }
533973
protected void buildList()
	{
		listParams = new LinkedList<>();
		listParams.add(renderAllFaces);
		listParams.add(useBlockBounds);
		listParams.add(renderBounds);
		listParams.add(useCustomTexture);
		listParams.add(applyTexture);
		listParams.add(icon);
		listParams.add(iconProvider);
		listParams.add(useWorldSensitiveIcon);
		listParams.add(useTexture);
		listParams.add(interpolateUV);
		listParams.add(rotateIcon);
		listParams.add(calculateAOColor);
		listParams.add(calculateBrightness);
		listParams.add(usePerVertexColor);
		listParams.add(usePerVertexAlpha);
		listParams.add(usePerVertexBrightness);
		listParams.add(useEnvironmentBrightness);
		listParams.add(useNormals);
		listParams.add(colorMultiplier);
		listParams.add(colorFactor);
		listParams.add(brightness);
		listParams.add(alpha);
		listParams.add(direction);
		listParams.add(textureSide);
		listParams.add(aoMatrix);
		listParams.add(flipU);
		listParams.add(flipV);
		listParams.add(deductParameters);
	}