quant finance snippets in python and c++ (maximum 100 lines)