Get manifest for the images stored in journal nodes. An image is considered
valid if it appears in majority of the nodes, with a valid md5 sum. The
returned images are sorted according to their transaction id.
554634
@Override
  public RemoteImageManifest getImageManifest(long fromTxnId)
      throws IOException {
    QuorumCall<AsyncLogger, RemoteImageManifest> q = loggers
        .getImageManifest(fromTxnId);
    Map<AsyncLogger, RemoteImageManifest> resps = loggers
        .waitForReadQuorumWithAllResponses(q, getImageManifestTimeoutMs,
            "getImageManifest");
    return createImageManifest(resps.values());
  }
481164
def images(self):
        """"""
        if self._images is not None:
            return self._images

        paths = [
            "metadata/images.json",
            "metadata/image-manifest.json",
        ]
        self._images = self._load_metadata(paths, productmd.images.Images)
        return self._images
19829
def used_images
      result = content.scan(/!\[.*\]\(.*\/image\/(\d.*)\/.*\)/)
      image_ids = result.nil? ? nil : result.map{ |i| i[0].to_i }.uniq
      image_ids
    end
1223536
def list_images(self):
        
        images = []
        for image in (yield from self.query("GET", "images/json", params={"all": 0})):
            if image['RepoTags']:
                for tag in image['RepoTags']:
                    if tag != "<none>:<none>":
                        images.append({'image': tag})
        return sorted(images, key=lambda i: i['image'])
43010
def get_images(self, obj):
        """"""
        return {str(i.tag): i.image.url for i in obj.images.all()}
197531
private Asset getAsset(Entity entity) {
        return getAsset(entity.getInstanceKey(), getAssetTypeToken(entity.getClass()));
    }
1127268
def _get_image_information(self):
        
        result = yield from self.manager.query("GET", "images/{}/json".format(self._image))
        return result
389817
private static Journal getStorage(ServletContext context,
      UploadImageParam params) throws IOException {
    final Journal journal = JournalNodeHttpServer
        .getJournalFromContextIfExists(context, params.journalId);
    if (journal == null) {
      throwIOException("Journal: " + params.journalId + " does not exist");
    }
    final JNStorage storage = journal.getImageStorage();

    // check namespace metadata
    storage.checkConsistentNamespace(params.getStorageInfo());

    // check if this is the active writer
    if (!journal.checkWriterEpoch(params.epoch)) {
      throwIOException("This is not the active writer");
    }
    return journal;
  }
676356
def avail_images():
    '''
    
    '''
    response = _query('grid', 'image/list')

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

    return ret
846138
def get(cls, rkey):
        

        if rkey in cls._cached:
            logger.info('Resource %s is in cache.' % rkey)
            return cls._cached[rkey]
        if rkey in cls._stock:
            img = cls._load_image(rkey)
            return img
        else:
            raise StockImageException('StockImage: %s not registered.' % rkey)
1094444
def get_image_digests(self, image):
        
        image_name_tag = self._key(image)
        image_digests = self._images_digests.get(image_name_tag)
        if image_digests is None:
            raise KeyError('Image {} has no digest records'.format(image_name_tag))
        return image_digests
1130919
def avail_images(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_images function must be called with '
            '-f or --function, or with the --list-images option'
        )
    compconn = get_conn(client_type='compute')
    region = get_location()
    publishers = []
    ret = {}

    def _get_publisher_images(publisher):
        '''
        Get all images from a specific publisher
        '''
        data = {}
        try:
            offers = compconn.virtual_machine_images.list_offers(
                location=region,
                publisher_name=publisher,
            )
            for offer_obj in offers:
                offer = offer_obj.as_dict()
                skus = compconn.virtual_machine_images.list_skus(
                    location=region,
                    publisher_name=publisher,
                    offer=offer['name'],
                )
                for sku_obj in skus:
                    sku = sku_obj.as_dict()
                    results = compconn.virtual_machine_images.list(
                        location=region,
                        publisher_name=publisher,
                        offer=offer['name'],
                        skus=sku['name'],
                    )
                    for version_obj in results:
                        version = version_obj.as_dict()
                        name = '|'.join((
                            publisher,
                            offer['name'],
                            sku['name'],
                            version['name'],
                        ))
                        data[name] = {
                            'publisher': publisher,
                            'offer': offer['name'],
                            'sku': sku['name'],
                            'version': version['name'],
                        }
        except CloudError as exc:
            __utils__['azurearm.log_cloud_error']('compute', exc.message)
            data = {publisher: exc.message}

        return data

    try:
        publishers_query = compconn.virtual_machine_images.list_publishers(
            location=region
        )
        for publisher_obj in publishers_query:
            publisher = publisher_obj.as_dict()
            publishers.append(publisher['name'])
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('compute', exc.message)

    pool = ThreadPool(cpu_count() * 6)
    results = pool.map_async(_get_publisher_images, publishers)
    results.wait()

    ret = {k: v for result in results.get() for k, v in six.iteritems(result)}

    return ret
84628
def get_image_hash(image):
    '''
    
    '''
    md5 = hashlib.md5()
    try:
        for chunk in image.file.chunks():
            md5.update(chunk)
        return md5.hexdigest()
    # this should only occur in tests
    except ValueError:
        # see link below for why we try not to use .open()
        # https://docs.djangoproject.com/en/1.9/ref/files/uploads/#django.core.files.uploadedfile.UploadedFile.chunks  # noqa
        image.file.open()

        for chunk in image.file.chunks():
            md5.update(chunk)
        return md5.hexdigest()
    finally:
        image.file.close()
613783
def image_get(request, image_id):
    """"""
    image = glanceclient(request).images.get(image_id)
    return Image(image)
688051
public function getImages()
    {
        $images = array();

        $nodes = $this->html->findTags('img');
        foreach ($nodes as $node) {
            $source = trim($node->getAttribute('src'));

            if (empty($source)) {
                continue;
            }

            $url = $this->getAbsoluteUrl($source);
            $size = $this->getImageSize($url);

            if (is_array($size)) {
                list($width, $height) = $size;
            } else {
                continue;
            }

            if ($this->isImageAccepted($url, $width, $height)) {
                $images[] = array(
                    'url'    => $url,
                    'width'  => $width,
                    'height' => $height,
                    'area'   => ($width * $height)
                );
            }
        }

        return $images;
    }
506386
def GetScriptHashesForVerifying(self):
        
        if not self.References and len(self.Attributes) < 1:
            return []

        hashes = set()
        for coinref, output in self.References.items():
            hashes.add(output.ScriptHash)

        for attr in self.Attributes:
            if attr.Usage == TransactionAttributeUsage.Script:
                if type(attr.Data) is UInt160:
                    hashes.add(attr.Data)
                else:
                    hashes.add(UInt160(data=attr.Data))

        for key, group in groupby(self.outputs, lambda p: p.AssetId):
            if self.raw_tx:
                asset = Helper.StaticAssetState(key)
            else:
                asset = GetBlockchain().GetAssetState(key.ToBytes())
            if asset is None:
                raise Exception("Invalid operation")

            if asset.AssetType == AssetType.DutyFlag:
                for p in group:
                    hashes.add(p.ScriptHash)

        hashlist = list(hashes)
        hashlist.sort()
        return hashlist
443705
def get_manifest(self, asset_xml):
        
        # pylint: disable=E1101
        manifest = '<?xml version="1.0" encoding="utf-8"?>'
        manifest += '<publisher-upload-manifest publisher-id="%s" ' % \
            self.publisher_id
        manifest += 'preparer="%s" ' % self.preparer
        if self.report_success:
            manifest += 'report-success="TRUE">\n'
        for notify in self.notifications:
            manifest += '<notify email="%s"/>' % notify
        if self.callback:
            manifest += '<callback entity-url="%s"/>' % self.callback
        manifest += asset_xml
        manifest += '</publisher-upload-manifest>'
        return manifest