def check(validator, value, *args, **kwargs):
  """Call a validator and return True if it's valid, False otherwise.
  The first argument is the validator, the second a value.  All other
  arguments are forwarded to the validator function.

  >>> check(is_valid_email, 'foo@bar.com')
  True
  """
  try:
    validator(*args, **kwargs)(None, value)
  except __HOLE__:
    return False
  return True
dataset/ETHPy150Open IanLewis/kay/kay/utils/validators.py/check