def Parens(text):
  text = str(text)

  if _PAREN_RE.match(text):
    return text
  else:
    return "(%s)" % text
Enclose text in parens if necessary.
dataset/ETHPy150Open ganeti/ganeti/lib/ht.py/Parens