# Path: pipelines/pipeline/task.py
# class Task(object):
#     def __init__(self, name, executor, args, always_run, ignore_errors, timeout):
#         self.name = name
#         self.executor = executor
#         self.args = args
#         self.always_run = always_run
#         self.ignore_errors = ignore_errors
#         self.timeout = timeout
# 
#     @staticmethod
#     def from_dict(task_dict):
#         task_args = copy(task_dict)
#         executor = task_args.pop('type')
# 
#         name = ''
#         if 'name' in task_dict:
#             name = task_dict.pop('name')
# 
#         always_run = False
#         if 'always_run' in task_dict:
#             always_run = task_dict.pop('always_run')
# 
#         ignore_errors = False
#         if 'ignore_errors' in task_dict:
#             ignore_errors = task_dict.pop('ignore_errors')
# 
#         timeout = False
#         if 'timeout' in task_dict:
#             timeout = task_dict.pop('timeout')
# 
#         return Task(name, executor, task_args, always_run, ignore_errors, timeout)
# 
# class TaskResult(dict):
#     def __init__(self, status, message='', data={}, return_obj={}):
#         self['status'] = status
#         self['message'] = message
#         self['data'] = data
#         self['return_obj'] = return_obj
# 
#     @property
#     def status(self):
#         return self.get('status')
# 
#     @property
#     def message(self):
#         return self.get('message')
# 
#     @property
#     def data(self):
#         return self.get('data')
# 
#     @property
#     def return_obj(self):
#         return self.get('return_obj')
# 
#     def is_successful(self):
#         return self.status == EXECUTION_SUCCESSFUL


import json
import logging
from datetime import datetime, timedelta
from pipelines.pipeline.task import Task, TaskResult
        return obj.__name__

    if hasattr(obj, '__class__') and hasattr(obj.__class__, '__name__'):
        return obj.__class__.__name__

    return str(obj)


def setup_logging(level=logging.DEBUG):
    logging.basicConfig(format='%(levelname)s: %(message)s', level=level)

    # Hide most logging for 3rd party libs
    for pack in ['sh', 'requests']:
        logging.getLogger(pack).setLevel(logging.WARNING)

def datetime_serializer(obj):
    """JSON serializer for objects not serializable by default json code"""

    if isinstance(obj, datetime):
        serial = obj.isoformat()
        return serial

    if isinstance(obj, Task):
        serial = json.dumps({
            'name': obj.name,
            'executor': obj.executor,
            'args': obj.args,
        })
        return serial


# Path: pipelines/pipeline/task.py
# class Task(object):
#     def __init__(self, name, executor, args, always_run, ignore_errors, timeout):
#         self.name = name
#         self.executor = executor
#         self.args = args
#         self.always_run = always_run
#         self.ignore_errors = ignore_errors
#         self.timeout = timeout
# 
#     @staticmethod
#     def from_dict(task_dict):
#         task_args = copy(task_dict)
#         executor = task_args.pop('type')
# 
#         name = ''
#         if 'name' in task_dict:
#             name = task_dict.pop('name')
# 
#         always_run = False
#         if 'always_run' in task_dict:
#             always_run = task_dict.pop('always_run')
# 
#         ignore_errors = False
#         if 'ignore_errors' in task_dict:
#             ignore_errors = task_dict.pop('ignore_errors')
# 
#         timeout = False
#         if 'timeout' in task_dict:
#             timeout = task_dict.pop('timeout')
# 
#         return Task(name, executor, task_args, always_run, ignore_errors, timeout)
# 
# class TaskResult(dict):
#     def __init__(self, status, message='', data={}, return_obj={}):
#         self['status'] = status
#         self['message'] = message
#         self['data'] = data
#         self['return_obj'] = return_obj
# 
#     @property
#     def status(self):
#         return self.get('status')
# 
#     @property
#     def message(self):
#         return self.get('message')
# 
#     @property
#     def data(self):
#         return self.get('data')
# 
#     @property
#     def return_obj(self):
#         return self.get('return_obj')
# 
#     def is_successful(self):
#         return self.status == EXECUTION_SUCCESSFUL


# Path: pipelines/plugin/utils.py
import json
import logging
from datetime import datetime, timedelta
from pipelines.pipeline.task import Task, TaskResult

        return obj.__name__

    if hasattr(obj, '__class__') and hasattr(obj.__class__, '__name__'):
        return obj.__class__.__name__

    return str(obj)


def setup_logging(level=logging.DEBUG):
    logging.basicConfig(format='%(levelname)s: %(message)s', level=level)

    # Hide most logging for 3rd party libs
    for pack in ['sh', 'requests']:
        logging.getLogger(pack).setLevel(logging.WARNING)

def datetime_serializer(obj):
    """JSON serializer for objects not serializable by default json code"""

    if isinstance(obj, datetime):
        serial = obj.isoformat()
        return serial

    if isinstance(obj, Task):
        serial = json.dumps({
            'name': obj.name,
            'executor': obj.executor,
            'args': obj.args,
        })
        return serial


    if isinstance(obj, TaskResult):