Implementing Threshold metric

Updating Survival metric
Adding fixes for flake8 problems
Analytics card 699 finish

Change-Id: I90e9efba482d404a89a4c090113f0882dfdd2067