Various python utilities functions