By above, do you mean your comment on line 42? The function corresponding to that comment is CalcCoregAffine. The one here is 
ApplyTransform for which copyfile=True (cf line 120 in original function). Or did you mean something else?