# Path: ob_pipelines/config.py
# AWS_PROFILE = os.environ.get('AWS_PROFILE', 'default')
# CONFIG_FILE = op.join(op.dirname(op.dirname(ob_pipelines.__file__)), 'config.yaml')
# class ConfigManager:
#     def __init__(self, config):
#     def get(self, option, default=None):
#     def get_source_bucket(self):
#     def get_target_bucket(self):


from datetime import datetime
from luigi import Parameter
from ob_pipelines.config import cfg, settings
            from ob_pipelines.entities.persistence import get_sample_by_name
            from ob_pipelines.entities.persistence import get_experiment_by_key




class Sample(object):
    sample_id = Parameter()

    def __init__(self, *args, **kwargs):

        if 'id' in kwargs:
            self.key = kwargs['id']

        if 'fields' in kwargs:
            self._sample = kwargs['fields']

        if 'createdTime' in kwargs:
            self._created_at = kwargs['createdTime']
        else:
            self._created_at = datetime.utcnow()


    @property
    def sample(self):
        # TODO: remove fallback init
        if not hasattr(self, '_sample'):

# Path: ob_pipelines/config.py
# AWS_PROFILE = os.environ.get('AWS_PROFILE', 'default')
# CONFIG_FILE = op.join(op.dirname(op.dirname(ob_pipelines.__file__)), 'config.yaml')
# class ConfigManager:
#     def __init__(self, config):
#     def get(self, option, default=None):
#     def get_source_bucket(self):
#     def get_target_bucket(self):


# Path: ob_pipelines/entities/sample.py
from datetime import datetime
from luigi import Parameter
from ob_pipelines.config import cfg, settings
            from ob_pipelines.entities.persistence import get_sample_by_name
            from ob_pipelines.entities.persistence import get_experiment_by_key





class Sample(object):
    sample_id = Parameter()

    def __init__(self, *args, **kwargs):

        if 'id' in kwargs:
            self.key = kwargs['id']

        if 'fields' in kwargs:
            self._sample = kwargs['fields']

        if 'createdTime' in kwargs:
            self._created_at = kwargs['createdTime']
        else:
            self._created_at = datetime.utcnow()


    @property
    def sample(self):
        # TODO: remove fallback init
        if not hasattr(self, '_sample'):

            self._sample = get_sample_by_name(self.sample_id)