def dequote(v, dequoted=False, qchar='"'):
    """Remove quotes (qchar) from v if dequoted is False and return
       (v, dequoted) where dequoted=True if quotes were removed.
    """
    if not dequoted:
        if len(v) > 1 and v[0] == qchar and v[-1] == qchar:
            v = v[1:-1]
            dequoted = True
    return v, dequoted