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 time
  from PIL import Image
  from lavis.common.utils import get_abs_path, get_cache_path
  from multiprocessing import Pool
  from omegaconf import OmegaConf
  from pathlib import Path
  from torchvision.transforms import functional
  from tqdm import tqdm
  import glob
  import io
  import json
  import magic
  import numpy
  import os
  import pandas
  import requests
  import shelve
  import zlib
label_desc: Use image node_id 4 for calling a global function with example usage: check_mimetype(row) and returns: row