code: def check_download(row):
      fname = _file_name(row)
      try:
          # not all sites will support HEAD
          response = requests.head(
              row["url"],
              stream=False,
              timeout=5,
              allow_redirects=True,
              headers=headers,
          )
          row["status"] = response.status_code
          row["headers"] = dict(response.headers)
      except:
          # log errors later, set error as 408 timeout
          row["status"] = 408
          return row
      if response.ok:
          row["file"] = fname
      return row
  
imports: import glob
  from pathlib import Path
  import time
  from omegaconf import OmegaConf
  import pandas
  import numpy
  import requests
  import zlib
  import os
  import io
  import shelve
  from lavis.common.utils import get_abs_path, get_cache_path
  import magic
  import json
  from multiprocessing import Pool
  from tqdm import tqdm
  from PIL import Image
  from torchvision.transforms import functional
label_desc: Use image node_id 5 for calling a global function with example usage: check_download(row) and returns: row, row