derive default labels, if null, from code and codes