code: def load_task_definition_file(task_def_file):
      
      try:
          with open(task_def_file) as f:
              task_def = yaml.safe_load(f)
      except OSError as e:
          raise BenchExecException("Cannot open task-definition file: " + str(e))
      except yaml.YAMLError as e:
          raise BenchExecException("Invalid task definition: " + str(e))
  
      if str(task_def.get("format_version")) not in ["0.1", "1.0"]:
          raise BenchExecException(
              "Task-definition file {} specifies invalid format_version '{}'."
              .format(task_def_file, task_def.get("format_version")))
  
      return task_def
docs: Open and parse a task-definition file in YAML format.