Fix for mapping the releases of the label to python objects

Hello,

If there is a problem that this code is copy-pasted I can extract it to some abstract class.