code: def _request_filename(
      url: Url,
      url_info: checksums.UrlInfo,
      tqdm_bar: tqdm.tqdm,
  ) -> Filename:
      """Get filename of dataset at `url`."""
      if url_info.filename:
          # tqdm_bar.update(1)
          return Filename(url_info.filename)
      # Uses `_open_url` for drive urls compatibility
      downloader = tfds.core.download.downloader
      try:
          with downloader._open_url(url, verify=True, timeout=10.0) as (
              response,
              _,
          ):  # pylint: disable=protected-access
              filename = downloader._get_filename(
                  response
              )  # pylint: disable=protected-access
      except (
          requests.exceptions.RequestException,
          urllib.error.URLError,
          tfds.core.download.util.DownloadError,
      ) as e:
          tqdm.tqdm.write(f"Error for {url}: {e}")
          filename = None
      tqdm_bar.update(1)
      # logging.info(f'{url} -> {filename}')
      return Filename(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 2 for calling a global function with example usage: _request_filename(url, url_info, tqdm_bar) and returns: Filename, Filename