code: def _update_url_info(
      url: Url,
      url_info: checksums.UrlInfo,
      new_filename: Filename,
  ) -> checksums.UrlInfo:
      """Update the `UrlInfo` with the filename."""
      old_filename = url_info.filename
      if new_filename is None:
          return url_info
      if old_filename and old_filename != new_filename:
          tqdm.tqdm.write(
              f"Filename for {url} already exist. Updating `{old_filename}` to "
              f"`{new_filename}`"
          )
      return dataclasses.replace(url_info, filename=new_filename)
  
file_path: datasets/tensorflow_datasets/scripts/cleanup/url_filename_recorder.py
imports: from concurrent import futures
  import dataclasses
  import itertools
  import typing
  from typing import Dict, NewType, Optional
  import urllib
  from absl import app
  from absl import logging
  import requests
  import tensorflow_datasets
  from tensorflow_datasets.core.download import checksums
  import tqdm
label_desc: Use image node_id 3 for calling a global function with example usage: _update_url_info(url, url_info, new_filename) and returns: dataclasses, url_info