def get_task_class(tasks, task_args):
    """Reads in a list of tasks provided by the user,
    loads the appropiate task, and returns two lists,
    pre_stop_tasks and post_stop_tasks
    :param tasks: list of strings locating tasks to load
    :type tasks: list
    :param task_args: list of strings to be used as args
    :type task_args: list
    """
    pre_stop_tasks = []
    post_stop_tasks = []
    task_to_task_args = dict(list(zip(tasks, task_args)))
    tasks_classes = [PreStopTask, PostStopTask]

    for func, task_args in task_to_task_args.items():
        for task_class in tasks_classes:
            imported_class = dynamic_import(func, task_class)
            if imported_class:
                if task_class is PreStopTask:
                    pre_stop_tasks.append(imported_class(task_args))
                elif task_class is PostStopTask:
                    post_stop_tasks.append(imported_class(task_args))
                else:
                    print("ERROR: Class is not a type of Pre/Post StopTask:" + func)
                    sys.exit(1)
    return pre_stop_tasks, post_stop_tasks
def get_task_class ( tasks , task_args ) : pre_stop_tasks = [ ] post_stop_tasks = [ ] task_to_task_args = dict ( list ( zip ( tasks , task_args ) ) ) tasks_classes = [ PreStopTask , PostStopTask ] for func , task_args in task_to_task_args . items ( ) : for task_class in tasks_classes : imported_class = dynamic_import ( func , task_class ) if imported_class : if task_class is PreStopTask : pre_stop_tasks . append ( imported_class ( task_args ) ) elif task_class is PostStopTask : post_stop_tasks . append ( imported_class ( task_args ) ) else : print ( "ERROR: Class is not a type of Pre/Post StopTask:" + func ) sys . exit ( 1 ) return pre_stop_tasks , post_stop_tasks
Reads in a list of tasks provided by the user,
    loads the appropiate task, and returns two lists,
    pre_stop_tasks and post_stop_tasks
    :param tasks: list of strings locating tasks to load
    :type tasks: list
    :param task_args: list of strings to be used as args
    :type task_args: list