code: def check_pil(func):
      
      def __wrapper(*args, **kwargs):
          root = kwargs.get('root')
          if not Image:
              if root and root.get_opt('warn'):
                  warn("Images manipulation require PIL")
              return 'none'
          return func(*args, **kwargs)
      return __wrapper
docs: PIL module checking decorator.