# Path: python/pipeline/exceptions.py
# class PipelineException(Exception):
#     """Base pipeline exception. Prints the message plus any specific info."""
#     def __init__(self, message, info=None):
#         info_message = '\nError info: ' + repr(info) if info else ''
#         super().__init__(message + info_message)
#         self.info = info


import json
import collections
from collections import OrderedDict
from .exceptions import PipelineException
from pprint import pformat
    def __iter__(self):
        return iter(self.instance._conf)

    def __len__(self):
        return len(self.instance._conf)


    class __Config:
        """
        Stores datajoint settings. Behaves like a dictionary, but applies validator functions
        when certain keys are set.

        The default parameters are stored in pipeline.settings.default . If a local config file
        exists, the settings specified in this file override the default settings.

        """

        def __init__(self, *args, **kwargs):
            self._conf = dict(default)
            self._conf.update(dict(*args, **kwargs))  # use the free update to set keys

        def __getitem__(self, key):
            return self._conf[key]

        def __setitem__(self, key, value):
            if isinstance(value, collections.Mapping):
                raise ValueError("Nested settings are not supported!")
            if validators[key](value):
                self._conf[key] = value
            else:

# Path: python/pipeline/exceptions.py
# class PipelineException(Exception):
#     """Base pipeline exception. Prints the message plus any specific info."""
#     def __init__(self, message, info=None):
#         info_message = '\nError info: ' + repr(info) if info else ''
#         super().__init__(message + info_message)
#         self.info = info


# Path: python/pipeline/settings.py
import json
import collections
from collections import OrderedDict
from .exceptions import PipelineException
from pprint import pformat

    def __iter__(self):
        return iter(self.instance._conf)

    def __len__(self):
        return len(self.instance._conf)


    class __Config:
        """
        Stores datajoint settings. Behaves like a dictionary, but applies validator functions
        when certain keys are set.

        The default parameters are stored in pipeline.settings.default . If a local config file
        exists, the settings specified in this file override the default settings.

        """

        def __init__(self, *args, **kwargs):
            self._conf = dict(default)
            self._conf.update(dict(*args, **kwargs))  # use the free update to set keys

        def __getitem__(self, key):
            return self._conf[key]

        def __setitem__(self, key, value):
            if isinstance(value, collections.Mapping):
                raise ValueError("Nested settings are not supported!")
            if validators[key](value):
                self._conf[key] = value
            else:

                raise PipelineException(u'Validator for {0:s} did not pass'.format(key, ))