code: def check_mimetype(row):
      if os.path.isfile(str(row["file"])):
          row["mimetype"] = magic.from_file(row["file"], mime=True)
          row["size"] = os.stat(row["file"]).st_size
      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 4 for calling a global function with example usage: check_mimetype(row) and returns: row