# Path: cloudify/dispatch.py
# @task
# def dispatch(__cloudify_context, *args, **kwargs):
#     dispatch_type = __cloudify_context['type']
#     dispatch_handler_cls = TASK_HANDLERS.get(dispatch_type)
#     if not dispatch_handler_cls:
#         raise exceptions.NonRecoverableError('No handler for task type: {0}'
#                                              .format(dispatch_type))
#     handler = dispatch_handler_cls(cloudify_context=__cloudify_context,
#                                    args=args,
#                                    kwargs=kwargs)
#     return handler.handle_or_dispatch_to_subprocess_if_remote()
# 
# Path: cloudify/workflows/workflow_context.py
# DEFAULT_LOCAL_TASK_THREAD_POOL_SIZE = 1


import os
import tempfile
import copy
import importlib
import shutil
import uuid
import json
import threading
from StringIO import StringIO
from contextlib import contextmanager
from cloudify_rest_client.nodes import Node
from cloudify_rest_client.node_instances import NodeInstance
from cloudify import dispatch
from cloudify.workflows.workflow_context import (
    DEFAULT_LOCAL_TASK_THREAD_POOL_SIZE)
    from dsl_parser.constants import HOST_TYPE
    from dsl_parser import parser as dsl_parser, tasks as dsl_tasks
    from dsl_parser import functions as dsl_functions
        return self.storage.plan

    @property
    def name(self):
        return self.storage.name

    def outputs(self):
        return dsl_functions.evaluate_outputs(
            outputs_def=self.plan['outputs'],
            get_node_instances_method=self.storage.get_node_instances,
            get_node_instance_method=self.storage.get_node_instance,
            get_node_method=self.storage.get_node,
            get_secret_method=self.storage.get_secret)

    def evaluate_functions(self, payload, context):
        return dsl_functions.evaluate_functions(
            payload=payload,
            context=context,
            get_node_instances_method=self.storage.get_node_instances,
            get_node_instance_method=self.storage.get_node_instance,
            get_node_method=self.storage.get_node,
            get_secret_method=self.storage.get_secret)

    def execute(self,
                workflow,
                parameters=None,
                allow_custom_parameters=False,
                task_retries=-1,
                task_retry_interval=30,
                subgraph_retries=0,

# Path: cloudify/dispatch.py
# @task
# def dispatch(__cloudify_context, *args, **kwargs):
#     dispatch_type = __cloudify_context['type']
#     dispatch_handler_cls = TASK_HANDLERS.get(dispatch_type)
#     if not dispatch_handler_cls:
#         raise exceptions.NonRecoverableError('No handler for task type: {0}'
#                                              .format(dispatch_type))
#     handler = dispatch_handler_cls(cloudify_context=__cloudify_context,
#                                    args=args,
#                                    kwargs=kwargs)
#     return handler.handle_or_dispatch_to_subprocess_if_remote()
# 
# Path: cloudify/workflows/workflow_context.py
# DEFAULT_LOCAL_TASK_THREAD_POOL_SIZE = 1


# Path: cloudify/workflows/local.py
import os
import tempfile
import copy
import importlib
import shutil
import uuid
import json
import threading
from StringIO import StringIO
from contextlib import contextmanager
from cloudify_rest_client.nodes import Node
from cloudify_rest_client.node_instances import NodeInstance
from cloudify import dispatch
from cloudify.workflows.workflow_context import (
    DEFAULT_LOCAL_TASK_THREAD_POOL_SIZE)
    from dsl_parser.constants import HOST_TYPE
    from dsl_parser import parser as dsl_parser, tasks as dsl_tasks
    from dsl_parser import functions as dsl_functions

        return self.storage.plan

    @property
    def name(self):
        return self.storage.name

    def outputs(self):
        return dsl_functions.evaluate_outputs(
            outputs_def=self.plan['outputs'],
            get_node_instances_method=self.storage.get_node_instances,
            get_node_instance_method=self.storage.get_node_instance,
            get_node_method=self.storage.get_node,
            get_secret_method=self.storage.get_secret)

    def evaluate_functions(self, payload, context):
        return dsl_functions.evaluate_functions(
            payload=payload,
            context=context,
            get_node_instances_method=self.storage.get_node_instances,
            get_node_instance_method=self.storage.get_node_instance,
            get_node_method=self.storage.get_node,
            get_secret_method=self.storage.get_secret)

    def execute(self,
                workflow,
                parameters=None,
                allow_custom_parameters=False,
                task_retries=-1,
                task_retry_interval=30,
                subgraph_retries=0,

                task_thread_pool_size=DEFAULT_LOCAL_TASK_THREAD_POOL_SIZE):