<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def execute(self, context, goals):
 """Executes the supplied goals and their dependencies against the given context. :param context: The pants run context. :param list goals: A list of ``Goal`` objects representing the command line goals explicitly requested. :returns int: An exit code of 0 upon success and non-zero otherwise. """

    try:
      self.attempt(context, goals)
      return 0
    except TaskError as e:
      message = str(e)
      if message:
        print('\nFAILURE: {0}\n'.format(message))
      else:
        print('\nFAILURE\n')
      return e.exit_code