code: def retry_load_images(image_paths, retry=10, backend="pytorch"):
      """
      This function is to load images with support of retrying for failed load.
  
      Args:
          image_paths (list): paths of images needed to be loaded.
          retry (int, optional): maximum time of loading retrying. Defaults to 10.
          backend (str): `pytorch` or `cv2`.
  
      Returns:
          imgs (list): list of loaded images.
      """
      for i in range(retry):
          imgs = []
          for image_path in image_paths:
              with pathmgr.open(image_path, "rb") as f:
                  img_str = np.frombuffer(f.read(), np.uint8)
                  img = cv2.imdecode(img_str, flags=cv2.IMREAD_COLOR)
              imgs.append(img)
  
          if all(img is not None for img in imgs):
              if backend == "pytorch":
                  imgs = torch.as_tensor(np.stack(imgs))
              return imgs
          else:
              logger.warn("Reading failed. Will retry.")
              time.sleep(1.0)
          if i == retry - 1:
              raise Exception(
                  "Failed to load images {}".format(image_paths)
              )
  
imports: import logging
  import numpy
  import os
  import random
  import time
  from collections import defaultdict
  import cv2
  import torch
  from torch.utils.data.distributed import DistributedSampler
  from torchvision import transforms
  from slowfast.utils.env import pathmgr
  from .None import transform
  from .random_erasing import RandomErasing
  from .transform import create_random_augment
label_desc: Use image node_id 1 for calling a global function with example usage: retry_load_images(image_paths, retry, backend) and returns: imgs