def build_image_from_path(self, path, image, stream=False, use_cache=False, remove_im=True):
        """
        build image from provided path and tag it

        this operation is asynchronous and you should consume returned generator in order to wait
        for build to finish

        :param path: str
        :param image: ImageName, name of the resulting image
        :param stream: bool, True returns generator, False returns str
        :param use_cache: bool, True if you want to use cache
        :param remove_im: bool, remove intermediate containers produced during docker build
        :return: generator
        """
        logger.info("building image '%s' from path '%s'", image, path)
        try:
            response = self.d.build(path=path, tag=image.to_str(), stream=stream, nocache=not use_cache,
                                    rm=remove_im, pull=False)  # returns generator
        except __HOLE__:
            # because changing api is fun
            response = self.d.build(path=path, tag=image.to_str(), stream=stream, nocache=not use_cache,
                                    rm=remove_im)  # returns generator
        return response
dataset/ETHPy150Open projectatomic/atomic-reactor/atomic_reactor/core.py/DockerTasker.build_image_from_path