code: def transform(point, center, scale, resolution, invert=False):
      """Generate and affine transformation matrix.
  
      Given a set of points, a center, a scale and a targer resolution, the
      function generates and affine transformation matrix. If invert is ``True``
      it will produce the inverse transformation.
  
      Arguments:
          point {torch.tensor} -- the input 2D point
          center {torch.tensor or numpy.array} -- the center around which to perform the transformations
          scale {float} -- the scale of the face/object
          resolution {float} -- the output resolution
  
      Keyword Arguments:
          invert {bool} -- define wherever the function should produce the direct or the
          inverse transformation matrix (default: {False})
      """
      _pt = torch.ones(3)
      _pt[0] = point[0]
      _pt[1] = point[1]
  
      h = 200.0 * scale
      t = torch.eye(3)
      t[0, 0] = resolution / h
      t[1, 1] = resolution / h
      t[0, 2] = resolution * (-center[0] / h + 0.5)
      t[1, 2] = resolution * (-center[1] / h + 0.5)
  
      if invert:
          t = torch.inverse(t)
  
      new_point = (torch.matmul(t, _pt))[0:2]
  
      return new_point.int()
  
imports: import os
  import sys
  import errno
  import torch
  import math
  import numpy
  import cv2
  from skimage import io
  from skimage import color
  from numba import jit
  from urllib.parse import urlparse
  from torch.hub import download_url_to_file, HASH_REGEX
label_desc: Use image node_id 3 for calling a global function with example usage: transform(point, center, scale, resolution, invert) and returns: new_point