def assert_type(self):
    if (self.mode is not None):
        for value in self.mode:
            if ((value is not None) and (value.lower() not in ['producer', 'consumer'])):
                raise ValueError('"{}" does not match possible values: {}'.format(value, 'producer, consumer'))
def assert_type(self):
    if (self.mode is not None):
        for value in self.mode:
            if ((value is not None) and (value.lower() not in ['producer', 'consumer'])):
                raise ValueError('"{}" does not match possible values: {}'.format(value, 'producer, consumer'))