It would be great if this funcion (developed [here](https://github.com/petrobras/3W/blob/main/toolkit/misc.py)) could be updated.