I plan to use unittest package to write a test for my function below. How can I properly test the function with deterministic parameters and/or refactor to make this possibl