def dequote(text):
    """
    If text has single or double quotes around it, remove them.
    Make sure the pair of quotes match.
    If a matching pair of quotes is not found, return the text unchanged.
    """
    if (text[0] == text[-1]) and text.startswith(("'", '"')):
        return text[1:-1]
    return text