code: def put(self, filename, handle):
          
          file_in_cache = os.path.join(self.config.binary_cache, filename)
          logger.debug("Storing distribution archive in local cache: %s", file_in_cache)
          makedirs(os.path.dirname(file_in_cache))
          # Stream the contents of the distribution archive to a temporary file
          # to avoid race conditions (e.g. partial reads) between multiple
          # processes that are using the local cache at the same time.
          with AtomicReplace(file_in_cache) as temporary_file:
              with open(temporary_file, 'wb') as temporary_file_handle:
                  shutil.copyfileobj(handle, temporary_file_handle)
          logger.debug("Finished caching distribution archive in local cache.")
docs: Store a distribution archive in the local cache.
  
          :param filename: The filename of the distribution archive (a string).
          :param handle: A file-like object that provides access to the
                         distribution archive.