'Parse a URL query value
@param value: the value
@return: the parsed value'

@staticmethod
def parse_value(value):

    uquote = (lambda w: w.replace('\\"', '\\"\\').strip('"').replace('\\"\\', '"'))
    NONE = ('NONE', 'None')
    if (type(value) is not list):
        value = [value]
    vlist = []
    for item in value:
        w = ''
        quote = False
        ignore_quote = False
        for c in s3_unicode(item):
            if ((c == '"') and (not ignore_quote)):
                w += c
                quote = (not quote)
            elif ((c == ',') and (not quote)):
                if (w in NONE):
                    w = None
                else:
                    w = uquote(w).encode('utf-8')
                vlist.append(w)
                w = ''
            else:
                w += c
            if (c == '\\'):
                ignore_quote = True
            else:
                ignore_quote = False
        if (w in NONE):
            w = None
        else:
            w = uquote(w).encode('utf-8')
        vlist.append(w)
    if (len(vlist) == 1):
        return vlist[0]
    return vlist
