'Clean incoming parameters (strings or lists)'

def sanitize_param(self, value):

    if (not self.sanitize):
        return value
    if isinstance(value, string_types):
        return self.sanitize_text(value)
    elif isinstance(value, list):
        return list(map(self.sanitize_text, value))
    else:
        raise Exception(('Unknown    parameter    type    (%s:%s)' % (type(value), value)))
