Wraps a function, returning (True, fxn(val)) if successful, (False, val) if not.

def try_wrapper(fxn):
  """Wraps a function, returning (True, fxn(val)) if successful, (False, val) if not."""
  def wrapper(val):
    """Try to call fxn with the given value. If successful, return (True, fxn(val)), otherwise
    returns (False, val).
    """
    try:
      return (True, fxn(val))
    except Exception:
      return (False, val)
  return wrapper