# Path: cloudify/workflows/local.py
#     HOST_TYPE = None
# class _Environment(object):
# class _Storage(object):
# class InMemoryStorage(_Storage):
# class FileStorage(_Storage):
# class StorageConflictError(Exception):
#     def __init__(self,
#                  storage,
#                  blueprint_path=None,
#                  name='local',
#                  inputs=None,
#                  load_existing=False,
#                  ignored_modules=None,
#                  provider_context=None,
#                  resolver=None,
#                  validate_version=True):
#     def plan(self):
#     def name(self):
#     def outputs(self):
#     def evaluate_functions(self, payload, context):
#     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):
# def init_env(blueprint_path,
#              name='local',
#              inputs=None,
#              storage=None,
#              ignored_modules=None,
#              provider_context=None,
#              resolver=None,
#              validate_version=True):
# def load_env(name, storage, resolver=None):
# def _parse_plan(blueprint_path, inputs, ignored_modules, resolver,
#                 validate_version):
# def _validate_node(node):
# def _prepare_nodes_and_instances(nodes, node_instances, ignored_modules):
#     def scan(parent, name, node):
# def _get_module_method(module_method_path, tpe, node_name,
#                        ignored_modules=None):
# def _try_convert_from_str(string, target_type):
# def _merge_and_validate_execution_parameters(
#         workflow, workflow_name, execution_parameters=None,
#         allow_custom_parameters=False):
#     def __init__(self):
#     def init(self, name, plan, nodes, node_instances, blueprint_path,
#              provider_context):
#     def _init_locks_and_nodes(self, nodes):
#     def load(self, name):
#     def get_resource(self, resource_path):
#     def download_resource(self, resource_path, target_path=None):
#     def update_node_instance(self,
#                              node_instance_id,
#                              version,
#                              runtime_properties=None,
#                              state=None):
#     def _get_node_instance(self, node_instance_id):
#     def get_node(self, node_id):
#     def get_nodes(self):
#     def get_node_instance(self, node_instance_id):
#     def get_provider_context(self):
#     def _load_instance(self, node_instance_id):
#     def _store_instance(self, node_instance):
#     def get_node_instances(self, node_id=None):
#     def _instance_ids(self):
#     def _lock(self, node_instance_id):
#     def get_workdir(self):
#     def get_secret(self):
#     def __init__(self):
#     def init(self, name, plan, nodes, node_instances, blueprint_path,
#              provider_context):
#     def load(self, name):
#     def _load_instance(self, node_instance_id):
#     def _store_instance(self, node_instance):
#     def get_node_instances(self, node_id=None):
#     def _instance_ids(self):
#     def get_workdir(self):
#     def __init__(self, storage_dir='/tmp/cloudify-workflows'):
#     def init(self, name, plan, nodes, node_instances, blueprint_path,
#              provider_context):
#         def ignore(src, names):
#     def load(self, name):
#     def payload(self):
#     def get_blueprint_path(self):
#     def get_node_instance(self, node_instance_id):
#     def _load_instance(self, node_instance_id):
#     def _store_instance(self, node_instance, lock=True):
#     def _instance_path(self, node_instance_id):
#     def get_node_instances(self, node_id=None):
#     def _instance_ids(self):
#     def get_workdir(self):


import sys
import shutil
import tempfile
from os import path, listdir, makedirs
from functools import wraps
from cloudify.workflows import local

        # Finding and adding the plugin
        if func_self is not None and self.copy_plugin_yaml:
            self.resources_to_copy.append(
                _find_plugin_yaml(path.dirname(local_file_path)))
        elif self.copy_plugin_yaml:
            raise StandardError("You cannot use copy_plugin_yaml in "
                                "contextmanager mode.")

        # Copying resources
        _copy_resources(path.dirname(local_file_path)
                        if local_file_path else None,
                        self.resources_to_copy, self.temp_dir)

        # Updating the test_method_name (if not manually set)
        if self.init_args and not self.init_args.get('name'):
            self.init_args['name'] = test_method_name

        # Expand inputs dictionary
        if 'inputs' in self.init_args.keys():
            self.input_func_kwargs['decorator_kwargs'] = vars(self)
            self.init_args['inputs'] = \
                _expand_dictionary(self.init_args['inputs'],
                                   func_self,
                                   self.input_func_args,
                                   self.input_func_kwargs)

        # Init env with supplied args
        temp_blueprint_path = path.join(self.temp_dir,
                                        path.basename(self.blueprint_path))

# Path: cloudify/workflows/local.py
#     HOST_TYPE = None
# class _Environment(object):
# class _Storage(object):
# class InMemoryStorage(_Storage):
# class FileStorage(_Storage):
# class StorageConflictError(Exception):
#     def __init__(self,
#                  storage,
#                  blueprint_path=None,
#                  name='local',
#                  inputs=None,
#                  load_existing=False,
#                  ignored_modules=None,
#                  provider_context=None,
#                  resolver=None,
#                  validate_version=True):
#     def plan(self):
#     def name(self):
#     def outputs(self):
#     def evaluate_functions(self, payload, context):
#     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):
# def init_env(blueprint_path,
#              name='local',
#              inputs=None,
#              storage=None,
#              ignored_modules=None,
#              provider_context=None,
#              resolver=None,
#              validate_version=True):
# def load_env(name, storage, resolver=None):
# def _parse_plan(blueprint_path, inputs, ignored_modules, resolver,
#                 validate_version):
# def _validate_node(node):
# def _prepare_nodes_and_instances(nodes, node_instances, ignored_modules):
#     def scan(parent, name, node):
# def _get_module_method(module_method_path, tpe, node_name,
#                        ignored_modules=None):
# def _try_convert_from_str(string, target_type):
# def _merge_and_validate_execution_parameters(
#         workflow, workflow_name, execution_parameters=None,
#         allow_custom_parameters=False):
#     def __init__(self):
#     def init(self, name, plan, nodes, node_instances, blueprint_path,
#              provider_context):
#     def _init_locks_and_nodes(self, nodes):
#     def load(self, name):
#     def get_resource(self, resource_path):
#     def download_resource(self, resource_path, target_path=None):
#     def update_node_instance(self,
#                              node_instance_id,
#                              version,
#                              runtime_properties=None,
#                              state=None):
#     def _get_node_instance(self, node_instance_id):
#     def get_node(self, node_id):
#     def get_nodes(self):
#     def get_node_instance(self, node_instance_id):
#     def get_provider_context(self):
#     def _load_instance(self, node_instance_id):
#     def _store_instance(self, node_instance):
#     def get_node_instances(self, node_id=None):
#     def _instance_ids(self):
#     def _lock(self, node_instance_id):
#     def get_workdir(self):
#     def get_secret(self):
#     def __init__(self):
#     def init(self, name, plan, nodes, node_instances, blueprint_path,
#              provider_context):
#     def load(self, name):
#     def _load_instance(self, node_instance_id):
#     def _store_instance(self, node_instance):
#     def get_node_instances(self, node_id=None):
#     def _instance_ids(self):
#     def get_workdir(self):
#     def __init__(self, storage_dir='/tmp/cloudify-workflows'):
#     def init(self, name, plan, nodes, node_instances, blueprint_path,
#              provider_context):
#         def ignore(src, names):
#     def load(self, name):
#     def payload(self):
#     def get_blueprint_path(self):
#     def get_node_instance(self, node_instance_id):
#     def _load_instance(self, node_instance_id):
#     def _store_instance(self, node_instance, lock=True):
#     def _instance_path(self, node_instance_id):
#     def get_node_instances(self, node_id=None):
#     def _instance_ids(self):
#     def get_workdir(self):


# Path: cloudify/test_utils/local_workflow_decorator.py
import sys
import shutil
import tempfile
from os import path, listdir, makedirs
from functools import wraps
from cloudify.workflows import local


        # Finding and adding the plugin
        if func_self is not None and self.copy_plugin_yaml:
            self.resources_to_copy.append(
                _find_plugin_yaml(path.dirname(local_file_path)))
        elif self.copy_plugin_yaml:
            raise StandardError("You cannot use copy_plugin_yaml in "
                                "contextmanager mode.")

        # Copying resources
        _copy_resources(path.dirname(local_file_path)
                        if local_file_path else None,
                        self.resources_to_copy, self.temp_dir)

        # Updating the test_method_name (if not manually set)
        if self.init_args and not self.init_args.get('name'):
            self.init_args['name'] = test_method_name

        # Expand inputs dictionary
        if 'inputs' in self.init_args.keys():
            self.input_func_kwargs['decorator_kwargs'] = vars(self)
            self.init_args['inputs'] = \
                _expand_dictionary(self.init_args['inputs'],
                                   func_self,
                                   self.input_func_args,
                                   self.input_func_kwargs)

        # Init env with supplied args
        temp_blueprint_path = path.join(self.temp_dir,
                                        path.basename(self.blueprint_path))

        test_env = local.init_env(temp_blueprint_path, **self.init_args)