Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def image(url, force=False):
if force or not os.path.exists(files.get_image_path(url)):
response = requests.get(url, stream=True)
path = files.save_image(response, url)
del response
return path
else:
return files.get_image_path(url)