This was a class exercise where we were to write some functions and unit tests to go with those functions.
The class was Building Robust Software, part of the Machine Learning Software Foundations Certificate at the University of Toronto. More info here: https://certificates.datasciences.utoronto.ca/certificatesandsessions/