def applyTransform(im, transform, inPlace=0):
 try:
  if inPlace:
   transform.apply_in_place(im)
   imOut = None
  else:
   imOut = transform.apply(im)
 except (TypeError, ValueError) as v:
  raise PyCMSError(v)
 return imOut

def applyTransform ( im , transform , inPlace = 0 ) : try : if inPlace : transform . apply_in_place ( im ) imOut = None else : imOut = transform . apply ( im ) except ( TypeError , ValueError ) as v : raise PyCMSError ( v ) return imOut
applies a transform to a given image .