code: def _parse_url_infos(
      checksums_file: Iterable[str],
  ) -> Dict[str, UrlInfo]:
      """Returns {URL: (size, checksum)}s stored within given file."""
      url_infos = {}
      for line in checksums_file:
          line = line.strip()  # Remove the trailing '\r' on Windows OS.
          if not line or line.startswith("#"):
              continue
          values = line.split("\t")
          if (
              len(values) == 1
          ):  # not enough values to unpack (legacy files)
              # URL might have spaces inside, but size and checksum will not.
              values = line.rsplit(" ", 2)
          if len(values) == 4:
              url, size, checksum, filename = values
          elif len(values) == 3:
              url, size, checksum = values
              filename = None
          else:
              raise AssertionError(f"Error parsing checksums: {values}")
          url_infos[url] = UrlInfo(
              size=utils.Size(size),
              checksum=checksum,
              filename=filename,
          )
      return url_infos
  
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 4 for calling a global function with example usage: _parse_url_infos(checksums_file) and returns: url_infos