def clean(self, value):
if not isinstance(value, (list, tuple, set, GeneratorType)):<EOL><INDENT>value = [value]<EOL><DEDENT>gen = (self.param_type.clean(x) for x in value)<EOL>if isinstance(value, GeneratorType):<EOL><INDENT>return gen<EOL><DEDENT>else:<EOL><INDENT>return list(gen)<EOL><DEDENT>
Cleans and returns the given value, or raises a ParameterNotValidError exception