old_contents: # Simpleflow implements task priorities on SWF, see documentation here:
  # http://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html
  #
  # Unfortunately boto doesn't support priorities as of version 2.x, so it's
  # impossible for simpleflow to implement *default* priorities on SWF objects.
  # But it's still possible to schedule tasks with a given priority as this is not
  # dependent on arguments on a boto call, but rather passed as data in decisions.
  from __future__ import print_function
  
  from simpleflow import activity, Workflow
  
  
  @activity.with_attributes(task_list='quickstart', version='example')
  def increment(x):
      return x + 1
  
  
  class BaseWorkflow(Workflow):
      version = 'example'
      task_list = 'example'
  
  
  # EXAMPLE 1: no priority set (equivalent to "0" per the docs)
  # Command: simpleflow standalone examples.priorities.WorkflowPriority1 --input '[1]'
  class WorkflowPriority1(BaseWorkflow):
      name = "priority-1"
  
      def run(self, x):
          return self.submit(increment, x).result
  
  
  # EXAMPLE 2: setting priority task by task
  # Command: simpleflow standalone examples.priorities.WorkflowPriority2 --input '[1]'
  #
  # NB: note that this doesn't really make sense when looking at a single workflow,
  # but other workflows may share the same task list with different priorities for
  # different tasks.
  class WorkflowPriority2(BaseWorkflow):
      name = "priority-2"
  
      def run(self, x):
          # taskPriority will be set to "5"
          a = self.submit(increment, x, __priority=5)
          # no priority set
          b = self.submit(increment, a)
          return b.result
  
  
  # EXAMPLE 3: setting a default priority for the workflow
  # Command: simpleflow standalone examples.priorities.WorkflowPriority3 --input '[1]'
  class WorkflowPriority3(BaseWorkflow):
      name = "priority-3"
      task_priority = 5
  
      def run(self, x):
          # taskPriority will be set to "5"
          return self.submit(increment, x).result
  
  
  # EXAMPLE 4: setting a dynamic default priority for the workflow
  # Command: simpleflow standalone examples.priorities.WorkflowPriority4 --input '[1]'
  class WorkflowPriority4(BaseWorkflow):
      name = "priority-4"
  
      @property
      def task_priority(self):
          return self._prio
  
      def run(self, x):
          self._prio = x
          # taskPriority will be set to the value of "x"
          return self.submit(increment, x).result
  
new_contents: # Simpleflow implements task priorities on SWF, see documentation here:
  # http://docs.aws.amazon.com/amazonswf/latest/developerguide/programming-priority.html
  #
  # Unfortunately boto doesn't support priorities as of version 2.x, so it's
  # impossible for simpleflow to implement *default* priorities on SWF objects.
  # But it's still possible to schedule tasks with a given priority as this is not
  # dependent on arguments on a boto call, but rather passed as data in decisions.
  from simpleflow import activity, Workflow
  
  
  @activity.with_attributes(task_list='quickstart', version='example')
  def increment(x):
      return x + 1
  
  
  class BaseWorkflow(Workflow):
      version = 'example'
      task_list = 'example'
  
  
  # EXAMPLE 1: no priority set (equivalent to "0" per the docs)
  # Command: simpleflow standalone examples.priorities.WorkflowPriority1 --input '[1]'
  class WorkflowPriority1(BaseWorkflow):
      name = "priority-1"
  
      def run(self, x):
          return self.submit(increment, x).result
  
  
  # EXAMPLE 2: setting priority task by task
  # Command: simpleflow standalone examples.priorities.WorkflowPriority2 --input '[1]'
  #
  # NB: note that this doesn't really make sense when looking at a single workflow,
  # but other workflows may share the same task list with different priorities for
  # different tasks.
  class WorkflowPriority2(BaseWorkflow):
      name = "priority-2"
  
      def run(self, x):
          # taskPriority will be set to "5"
          a = self.submit(increment, x, __priority=5)
          # no priority set
          b = self.submit(increment, a)
          return b.result
  
  
  # EXAMPLE 3: setting a default priority for the workflow
  # Command: simpleflow standalone examples.priorities.WorkflowPriority3 --input '[1]'
  class WorkflowPriority3(BaseWorkflow):
      name = "priority-3"
      task_priority = 5
  
      def run(self, x):
          # taskPriority will be set to "5"
          return self.submit(increment, x).result
  
  
  # EXAMPLE 4: setting a dynamic default priority for the workflow
  # Command: simpleflow standalone examples.priorities.WorkflowPriority4 --input '[1]'
  class WorkflowPriority4(BaseWorkflow):
      name = "priority-4"
  
      @property
      def task_priority(self):
          return self._prio
  
      def run(self, x):
          self._prio = x
          # taskPriority will be set to the value of "x"
          return self.submit(increment, x).result
  
subject: Remove unused import in examples/priorities.py