Create an ImageManager that downloads an image from a URL and returns it from cache if it was downloaded previously.
Asked in the technical phone screen stage. CoderPad; discussed concurrency, edge cases, and cache memory issues.
Implement get_image(url, cache, downloads). url is a string, cache is a mutable dictionary mapping URLs to image data, and downloads is a dictionary simulating the downloader. Return the cached value when present; otherwise read downloads[url], store it in cache, and return it. Assume the URL exists in downloads.
def get_image(url, cache, downloads):