code: def _rotate_impl(pil_img, level):
      """
      Rotates `pil_img` from -30 to 30 degrees depending on `level`.
      """
      max = 30
      degrees = scale_parameter(level, max, "int")
      if random.random() > 0.5:
          degrees = -degrees
      return pil_img.rotate(degrees)
  
imports: import logging
  import random
  import nltk
  from PIL import Image, ImageEnhance, ImageOps
  from ..constants import AUTOMM, IMAGE, TEXT
label_desc: Use image node_id 2 for calling a global function with example usage: _rotate_impl(pil_img, level) and returns: pil_img