code: def get_redirected_url(url: str):
      """
      Given a URL, returns the URL it redirects to or the
      original URL in case of no indirection
      """
      import requests
  
      with requests.Session() as session:
          with session.get(
              url, stream=True, allow_redirects=True
          ) as response:
              if response.history:
                  return response.url
              else:
                  return url
  
file_path: vissl/vissl/utils/download.py
imports: import io
  import os
  import re
  import urllib
  import urllib.error
  import urllib.request
  from typing import Optional
  from urllib.parse import urlparse
  from torch.utils.model_zoo import tqdm
  from torchvision.datasets.utils import check_integrity, download_file_from_google_drive, extract_archive
  from vissl.utils.io import makedir
label_desc: Use image node_id 1 for calling a global function with example usage: get_redirected_url(url) and returns: response, url