import pprint
import json


def tryJsonOrPlain(text):
  """Return json formatted, if possible. Otherwise just return."""
  try:
    return pprint.pformat( json.loads( text ), indent=1 )
  except:
    return text