def maybe(x, f):
  """Returns [f(x)], unless f(x) raises an exception. In that case, []."""
  try:
    result = f(x)
    output = [result]
  # pylint:disable=broad-except
  except Exception:
    # pylint:enable=broad-except
    output = []
  return output