Utilities function clearly detached from main code

In file utils.py there should be all utilities needed for others functions. Please give an appropiate docstring.