def composite_transform_factory(a, b):
 if isinstance(a, IdentityTransform):
  return b
 elif isinstance(b, IdentityTransform):
  return a
 elif (isinstance(a, AffineBase) and isinstance(b, AffineBase)):
  return CompositeAffine2D(a, b)
 return CompositeGenericTransform(a, b)

def composite_transform_factory ( a , b ) : if isinstance ( a , IdentityTransform ) : return b elif isinstance ( b , IdentityTransform ) : return a elif ( isinstance ( a , AffineBase ) and isinstance ( b , AffineBase ) ) : return CompositeAffine2D ( a , b ) return CompositeGenericTransform ( a , b )
create a new composite transform that is the result of applying transform a then transform b .