code: def with_temporary_numpy_seed(sampling_seed: int):
      """
      Context manager to run a specific portion of code with a given seed:
      resumes the numpy state after the execution of the block
      """
      original_random_state = np.random.get_state()
      np.random.seed(sampling_seed)
      yield
      np.random.set_state(original_random_state)
  
imports: import contextlib
  import logging
  import queue
  from typing import Dict, List
  import numpy
  import torch
  from PIL import Image
  from torch.utils.data import Dataset
  from torch.utils.data.distributed import DistributedSampler
label_desc: Use image node_id 2 for calling a global function with example usage: with_temporary_numpy_seed(sampling_seed) without return types