can you add a test in test_util for this function with examples ?

also let's replace "s" with "data" and explain in the docstrings what it does