code: 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
  
file_path: allennlp/allennlp/confidence_checks/task_checklists/utils.py
imports: import string
  from typing import Dict, Callable, List, Union
  import numpy
  import spacy
  from checklist.editor import Editor
label_desc: Use image node_id 4 for calling a global function with example usage: toggle_punctuation(data) and returns: ret