<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_datafile_valid(datafile):
 """ Given a datafile determine if it is valid or not. Args: datafile: JSON string representing the project. Returns: Boolean depending upon whether datafile is valid or not. """


  try:
    datafile_json = json.loads(datafile)
  except:
    return False

  try:
    jsonschema.Draft4Validator(constants.JSON_SCHEMA).validate(datafile_json)
  except:
    return False

  return True