code: def imagedraw_textsize_c(draw, text):
      if int(PIL.__version__.split(".")[0]) < 10:
          tw, th = draw.textsize(text)
      else:
          left, top, right, bottom = draw.textbbox((0, 0), text)
          tw, th = right - left, bottom - top
  
      return tw, th
  
imports: from __future__ import division
  import os
  import cv2
  import math
  import numpy
  import PIL
  from PIL import Image, ImageDraw, ImageFile
label_desc: Use image node_id 1 for calling a global function with example usage: imagedraw_textsize_c(draw, text) and returns: tw,  th