def checkCommodities(esM, commodities):
    """ Check if the commodity is considered in the energy system model. """
    if not commodities.issubset(esM.commodities):
        raise ValueError(
            """Commodity does not match the ones of the specified energy system model.
"""
             + 'Commodity: ' + str(set(commodities)) + '\n' +
            'Energy system model commodities: ' + str(esM.commodities))
