code: def save_url_infos(
      path: epath.Path,
      url_infos: Dict[str, UrlInfo],
  ) -> None:
      """Store given checksums and sizes for specific dataset.
  
      Content of file is never disgarded, only updated. This is to ensure that if
      process is killed right after first download finishes, checksums registered
      during previous runs aren't lost.
  
      It is the responsibility of the caller not to call function multiple times in
      parallel for a given dataset.
  
      Only original file content is updated. This means the entire set of new sizes
      and checksums must be given at every call.
  
      Args:
        path: Path to the resources.
        url_infos: dict, {url: (size_in_bytes, checksum)}.
      """
      original_data = load_url_infos(path) if path.exists() else {}
      new_data = original_data.copy()
      new_data.update(url_infos)
      # Compare filenames separately, as filename field is eq=False
      if original_data == new_data and _filenames_equal(
          original_data, new_data
      ):
          return
      lines = [
          f"{url}\t{int(url_info.size)}\t{url_info.checksum}\t"
          f'{url_info.filename or ""}\n'
          for url, url_info in sorted(new_data.items())
      ]
      path.write_text("".join(lines), encoding="UTF-8")
  
file_path: datasets/tensorflow_datasets/core/download/checksums.py
imports: import dataclasses
  import hashlib
  import io
  from typing import Any, Dict, Iterable, Optional
  from absl import logging
  from etils import epath
  from tensorflow_datasets.core import utils
label_desc: Use image node_id 7 for calling a global function with example usage: save_url_infos(path, url_infos) without return types