Fix pivot function to work with optional args (#389)
Fix pivot function to work with optional args (#389)

* Fix pivot function to work with optional args

* Change dictionary key check and expand optional if check

* Minor improvement to if statements of f and g
AquaQAnalytics/TorQ,FlyingOE/TorQ,FlyingOE/TorQ,AquaQAnalytics/TorQ,AquaQAnalytics/TorQ,FlyingOE/TorQ