def _fetch(context, image_href, path, force_raw=False):
    path_tmp = "%s.part" % path
    images.fetch(context, image_href, path_tmp, force_raw=False)
    # Notes(yjiang5): If glance can provide the virtual size information,
    # then we can firstly clean cache and then invoke images.fetch().
    if force_raw:
        required_space = images.converted_size(path_tmp)
        directory = os.path.dirname(path_tmp)
        _clean_up_caches(directory, required_space)
        images.image_to_raw(image_href, path, path_tmp)
    else:
        os.rename(path_tmp, path)
Testing the PUT <URL> API
dataset/ETHPy150Open openstack/ironic/ironic/drivers/modules/image_cache.py/_fetch--crossover with--dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/webapi/tests/mixins_comment.py/BaseCommentItemMixin.test_put_with_text_type_markdown_and_not_text