A python algorithm to detect foot contact and foot clearance using kinematic or inertial data during forward or backward walking