# Path: wa/utils/serializer.py
# class Podable(object):
# 
#     _pod_serialization_version = 0
# 
#     @classmethod
#     def from_pod(cls, pod):
#         pod = cls._upgrade_pod(pod)
#         instance = cls()
#         instance._pod_version = pod.pop('_pod_version')  # pylint: disable=protected-access
#         return instance
# 
#     @classmethod
#     def _upgrade_pod(cls, pod):
#         _pod_serialization_version = pod.pop('_pod_serialization_version', None) or 0
#         while _pod_serialization_version < cls._pod_serialization_version:
#             _pod_serialization_version += 1
#             upgrade = getattr(cls, '_pod_upgrade_v{}'.format(_pod_serialization_version))
#             pod = upgrade(pod)
#         return pod
# 
#     def __init__(self):
#         self._pod_version = self._pod_serialization_version
# 
#     def to_pod(self):
#         pod = {}
#         pod['_pod_version'] = self._pod_version
#         pod['_pod_serialization_version'] = self._pod_serialization_version
#         return pod


import uuid
from collections import OrderedDict, Counter
from copy import copy
from datetime import datetime, timedelta
from wa.framework.configuration.core import Status
from wa.utils.serializer import Podable
        instance.duration = duration if duration is None else timedelta(seconds=duration)
        return instance

    def __init__(self, run_name=None, project=None, project_stage=None,
                 start_time=None, end_time=None, duration=None):
        super(RunInfo, self).__init__()
        self.uuid = uuid.uuid4()
        self.run_name = run_name
        self.project = project
        self.project_stage = project_stage
        self.start_time = start_time
        self.end_time = end_time
        self.duration = duration

    def to_pod(self):
        d = super(RunInfo, self).to_pod()
        d.update(copy(self.__dict__))
        d['uuid'] = str(self.uuid)
        if self.duration is None:
            d['duration'] = self.duration
        else:
            d['duration'] = self.duration.total_seconds()
        return d

    @staticmethod
    def _pod_upgrade_v1(pod):
        pod['_pod_version'] = pod.get('_pod_version', 1)
        return pod



# Path: wa/utils/serializer.py
# class Podable(object):
# 
#     _pod_serialization_version = 0
# 
#     @classmethod
#     def from_pod(cls, pod):
#         pod = cls._upgrade_pod(pod)
#         instance = cls()
#         instance._pod_version = pod.pop('_pod_version')  # pylint: disable=protected-access
#         return instance
# 
#     @classmethod
#     def _upgrade_pod(cls, pod):
#         _pod_serialization_version = pod.pop('_pod_serialization_version', None) or 0
#         while _pod_serialization_version < cls._pod_serialization_version:
#             _pod_serialization_version += 1
#             upgrade = getattr(cls, '_pod_upgrade_v{}'.format(_pod_serialization_version))
#             pod = upgrade(pod)
#         return pod
# 
#     def __init__(self):
#         self._pod_version = self._pod_serialization_version
# 
#     def to_pod(self):
#         pod = {}
#         pod['_pod_version'] = self._pod_version
#         pod['_pod_serialization_version'] = self._pod_serialization_version
#         return pod


# Path: wa/framework/run.py
import uuid
from collections import OrderedDict, Counter
from copy import copy
from datetime import datetime, timedelta
from wa.framework.configuration.core import Status
from wa.utils.serializer import Podable

        instance.duration = duration if duration is None else timedelta(seconds=duration)
        return instance

    def __init__(self, run_name=None, project=None, project_stage=None,
                 start_time=None, end_time=None, duration=None):
        super(RunInfo, self).__init__()
        self.uuid = uuid.uuid4()
        self.run_name = run_name
        self.project = project
        self.project_stage = project_stage
        self.start_time = start_time
        self.end_time = end_time
        self.duration = duration

    def to_pod(self):
        d = super(RunInfo, self).to_pod()
        d.update(copy(self.__dict__))
        d['uuid'] = str(self.uuid)
        if self.duration is None:
            d['duration'] = self.duration
        else:
            d['duration'] = self.duration.total_seconds()
        return d

    @staticmethod
    def _pod_upgrade_v1(pod):
        pod['_pod_version'] = pod.get('_pod_version', 1)
        return pod



class RunState(Podable):