code: def _scale_pnts(y, sz, do_scale=True, y_first=False):
      if y_first:
          y = y.flip(1)
      res = y * 2 / tensor(sz).float() - 1 if do_scale else y
      return TensorPoint(res, img_size=sz)
  
imports: from __future__ import annotations
  from ..torch_basics import *
  from ..data.all import *
  from PIL import Image
  from matplotlib import patches, patheffects
label_desc: Use image node_id 17 for calling a global function with example usage: _scale_pnts(y, sz, do_scale, y_first) and returns: TensorPoint