Applying Two Gradients In Python