def assure_image(fnc):
 @wraps(fnc)
 def _wrapped(self, img, *args, **kwargs):
  if (not isinstance(img, Image)):
   img = self._manager.get(img)
  return fnc(self, img, *args, **kwargs)
 return _wrapped

def assure_image ( fnc ) : @ wraps ( fnc ) def _wrapped ( self , img , * args , ** kwargs ) : if ( not isinstance ( img , Image ) ) : img = self . _manager . get ( img ) return fnc ( self , img , * args , ** kwargs ) return _wrapped
converts a image id passed as the image parameter to a image object .