Would you be comfortable changing your PR to include that function (with the proper attribution, of course)?