def transform_tawn2(t, theta, k):
 def _check_args(theta, k):
  condth = (theta >= 0)
  cond1 = (((theta + (3 * k)) > 0) and ((theta + k) <= 1) and ((theta + (2 * k)) <= 1))
  return (condth and cond1)
 if (not np.all(_check_args(theta, k))):
  raise ValueError('invalid args')
 transf = (((1 - ((theta + k) * t)) + ((theta * t) * t)) + (k * (t ** 3)))
 return transf

def transform_tawn2 ( t , theta , k ) : def _check_args ( theta , k ) : condth = ( theta >= 0 ) cond1 = ( ( ( theta + ( 3 * k ) ) > 0 ) and ( ( theta + k ) <= 1 ) and ( ( theta + ( 2 * k ) ) <= 1 ) ) return ( condth and cond1 ) if ( not np . all ( _check_args ( theta , k ) ) ) : raise ValueError ( 'invalid args' ) transf = ( ( ( 1 - ( ( theta + k ) * t ) ) + ( ( theta * t ) * t ) ) + ( k * ( t ** 3 ) ) ) return transf
asymmetric mixed model of tawn 1988 special case: k=0 .