def toggle_punctuation(data: str) -> List[str]:
    """
    If `data` contains any punctuation, it is removed.
    Otherwise, a `.` is added to the string.
    Returns a list of strings.

    Eg.
    `data` = "This was great!"
    Returns ["This was great", "This was great."]

    `data` = "The movie was good"
    Returns ["The movie was good."]
    """
    s = strip_punctuation(data)
    ret = []
    if s != data:
        ret.append(s)
    if s + "." != data:
        ret.append(s + ".")
    return ret
If `data` contains any punctuation, it is removed.
Otherwise, a `.` is added to the string.
Returns a list of strings.

Eg.
`data` = "This was great!"
Returns ["This was great", "This was great."]

`data` = "The movie was good"
Returns ["The movie was good."]
allennlp/confidence_checks/task_checklists/utils.py