I think it's fine to keep here, until we increase our numpy support. And given that we're iterating through each sample in Python, and this doesn't need to be a super-fast function, we might as well not backport it.