code: def to_thumb(self: Image.Image, h, w=None):
      "Same as `thumbnail`, but uses a copy"
      if w is None:
          w = h
      im = self.copy()
      im.thumbnail((w, h))
      return im
  
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 7 for calling a global function with example usage: to_thumb(h, w) and returns: im