code: def resizer(image, target_resolution):
      if target_resolution is None:
          return image
      original_size = np.array([image.shape[1], image.shape[0]])
      ratio = target_resolution / original_size.max()
      if ratio < 1:
          new_size = (ratio * original_size).astype(int)
          image = cv2.resize(
              image, tuple(new_size), interpolation=cv2.INTER_AREA
          )
      return image
  
imports: from abc import ABCMeta, abstractmethod
  from dataclasses import replace
  from typing import Optional, Callable, TYPE_CHECKING, Tuple, Type
  import cv2
  import numpy
  from numba.typed import Dict
  from PIL.Image import Image
  from .base import Field, ARG_TYPE
  from ..pipeline.operation import Operation
  from ..pipeline.state import State
  from ..pipeline.compiler import Compiler
  from ..pipeline.allocation_query import AllocationQuery
  from ..libffcv import imdecode, memcpy, resize_crop
label_desc: Use image node_id 2 for calling a global function with example usage: resizer(image, target_resolution) and returns: image, image