Added minor feature to ag.util.pad_to_size.

Also cleaned up that file (PEP8).