Pull the image digest.

        Args:
            platform (str): The platform to pull the image for.
            Default: ``None``

        Returns:
            (:py:class:`Image`): A reference to the pulled image.
776544
def pull(self, platform=None):
        
        repository, _ = parse_repository_tag(self.image_name)
        return self.collection.pull(repository, tag=self.id, platform=platform)
804987
def get_digests(self):
        

        digests = {}  # repository -> digest
        for registry in self.workflow.push_conf.docker_registries:
            for image in self.workflow.tag_conf.images:
                image_str = image.to_str()
                if image_str in registry.digests:
                    digest = registry.digests[image_str]
                    digests[image.to_str(registry=False)] = digest

        return digests
285141
def get_image(self, size=SIZE_EXTRA_LARGE):
        

        doc = self._request(self.ws_prefix + ".getInfo", True)

        return _extract_all(doc, "image")[size]
562771
def __pull_image_info(self, title, imageinfo, normalized):
        
        for info in imageinfo:
            info.update({'title': title})

            # get API normalized "from" filename for matching
            _from = None
            for norm in normalized:
                if title == norm['to']:
                    _from = norm['from']

            # let's put all "metadata" in one member
            info['metadata'] = {}
            extmetadata = info.get('extmetadata')
            if extmetadata:
                info['metadata'].update(extmetadata)
                del info['extmetadata']

            self.__insert_image_info(title, _from, info)
561462
def platform(self, with_prompt, platforms=None):
        """"""
        if platforms is None:
            platforms = self._dict['generic']['prompt_detection']

        for platform in platforms:
            pattern = self.pattern(platform, 'prompt')
            result = re.search(pattern, with_prompt)
            if result:
                return platform
        return None
591873
def get_image_entrypoint(image):
    ''''''
    info = docker_inspect_or_pull(image)
    try:
        return info['Config']['Entrypoint']
    except KeyError as ke:
        raise DockerError('Failed to inspect image: JSON result missing key {}'.format(ke))
367350
def get_image_tags(self):
        
        current_images = self.images()
        tags = {tag: i['Id'] for i in current_images for tag in i['RepoTags']}
        return tags
662535
def get_image(self, string, width, height, pad=0):
        
        hex_digest_byte_list = self._string_to_byte_list(string)
        matrix = self._create_matrix(hex_digest_byte_list)
        return self._create_image(matrix, width, height, pad)
282361
async def get_all_platforms(self) -> AsyncIterator[Platform]:
        

        for name in self._classes.keys():
            yield await self.get_platform(name)
641773
def _grab_raw_image(self):
        
        m = self.ale.getScreenRGB()
        return m.reshape((self.height, self.width, 3))
551200
async def get_image(
        self,
        input_source: str,
        output_format: str = IMAGE_JPEG,
        extra_cmd: Optional[str] = None,
        timeout: int = 15,
    ) -> Optional[bytes]:
        """"""
        command = ["-an", "-frames:v", "1", "-c:v", output_format]

        # open input for capture 1 frame
        is_open = await self.open(
            cmd=command,
            input_source=input_source,
            output="-f image2pipe -",
            extra_cmd=extra_cmd,
        )

        # error after open?
        if not is_open:
            _LOGGER.warning("Error starting FFmpeg.")
            return None

        # read image
        try:
            proc_func = functools.partial(self._proc.communicate, timeout=timeout)
            image, _ = await self._loop.run_in_executor(None, proc_func)
            return image

        except (subprocess.TimeoutExpired, ValueError):
            _LOGGER.warning("Timeout reading image.")
            self.kill()
            return None
770369
def get_image(name, **kwargs):
    
    if not name:
        return ""
    portal_url = api.get_url(api.get_portal())
    attr = render_html_attributes(**kwargs)
    html = '<img src="{}/++resource++bika.lims.images/{}" {}/>'
    return html.format(portal_url, name, attr)
546929
def grab(self, monitor):
        # type: (Monitor) -> ScreenShot
        

        # Convert PIL bbox style
        if isinstance(monitor, tuple):
            monitor = {
                "left": monitor[0],
                "top": monitor[1],
                "width": monitor[2] - monitor[0],
                "height": monitor[3] - monitor[1],
            }

        ximage = self.xlib.XGetImage(
            MSS.display,
            self.drawable,
            monitor["left"],
            monitor["top"],
            monitor["width"],
            monitor["height"],
            PLAINMASK,
            ZPIXMAP,
        )

        try:
            bits_per_pixel = ximage.contents.bits_per_pixel
            if bits_per_pixel != 32:
                raise ScreenShotError(
                    "[XImage] bits per pixel value not (yet?) implemented: {}.".format(
                        bits_per_pixel
                    )
                )

            raw_data = ctypes.cast(
                ximage.contents.data,
                ctypes.POINTER(
                    ctypes.c_ubyte * monitor["height"] * monitor["width"] * 4
                ),
            )
            data = bytearray(raw_data.contents)
        finally:
            # Free
            self.xlib.XDestroyImage(ximage)

        return self.cls_image(data, monitor)
691574
def getImage(path, dockerfile, tag):
    '''
    '''
    image = getImageByTag(tag)

    if not image:
        # Build an Image using the dockerfile in the path
        try:
            image = client.images.build(
              path=path,
              dockerfile=dockerfile,
              tag=tag
            )
        except BuildError as exc:
            eprint("Failed to build docker image")
            raise exc
        except TypeError as exc:
            eprint("You must give a path to the build environemnt.")
            raise exc
        except APIError as exc:
            eprint("Unhandled error while building image", tag)
            raise exc

    return image
1232445
def framework_version_from_tag(image_tag):
    
    tag_pattern = re.compile('^(.*)-(cpu|gpu)-(py2|py3)$')
    tag_match = tag_pattern.match(image_tag)
    return None if tag_match is None else tag_match.group(1)
1294674
def image_url(self):
        """"""
        return construct_api_url(self.input, 'image', self.resolvers, False, self.get3d, False, **self.kwargs)
862837
def pull(image, tag=None):
    
    if tag:
        image = ":".join([image, tag])

    utils.xrun("docker pull", [image])