code: def download(path, default_ext=None):
      
      key = "DOWNLOAD:{}".format(path)
      if not config.UPDATE and FILECACHE.get(key):
          return FILECACHE.get(key).decode('utf-8')
  
      config.LOGGER.info("\tDownloading {}".format(path))
  
      # Write file to temporary file
      with tempfile.TemporaryFile() as tempf:
          hash = write_and_get_hash(path, tempf)
          tempf.seek(0)
  
          # Get extension of file or default if none found
          extension = os.path.splitext(path)[1][1:].lower()
          if extension not in [key for key, value in file_formats.choices]:
              if default_ext:
                  extension = default_ext
              else:
                  raise IOError("No extension found: {}".format(path))
  
          filename = '{0}.{ext}'.format(hash.hexdigest(), ext=extension)
  
          copy_file_to_storage(filename, tempf)
  
          FILECACHE.set(key, bytes(filename, "utf-8"))
  
          return filename
docs: download: downloads file
          Args: None
          Returns: filename