# Path: oggm/exceptions.py
# class InvalidParamsError(ValueError):
#     pass


import logging
import os
import shutil
import sys
import glob
import warnings
import numpy as np
import pandas as pd
    import geopandas as gpd
    import salem
                import multiprocessing
            import multiprocessing
from collections import OrderedDict
from distutils.util import strtobool
    from scipy.signal.windows import gaussian
    from scipy.signal import gaussian
from configobj import ConfigObj, ConfigObjError
from oggm.exceptions import InvalidParamsError
    from oggm.utils import download_oggm_files, get_demo_file
    from oggm.utils import get_dl_verify_data
        from oggm.utils import LRUFileCache
    """Quick "magic" to be sure that paths are expanded correctly."""

    def __setitem__(self, key, value):
        # Overrides the original dic to expand the path
        try:
            value = os.path.expanduser(value)
        except AttributeError:
            raise InvalidParamsError('The value you are trying to set does '
                                     'not seem to be a valid path: '
                                     '{}'.format(value))

        ResettingOrderedDict.__setitem__(self, key, value)


class ParamsLoggingDict(ResettingOrderedDict):
    """Quick "magic" to log the parameter changes by the user."""

    do_log = False

    def __setitem__(self, key, value):
        # Overrides the original dic to log the change
        if self.do_log:
            self._log_param_change(key, value)
        ResettingOrderedDict.__setitem__(self, key, value)

    def _log_param_change(self, key, value):

        prev = self.get(key)
        if prev is None:
            if key in ['baseline_y0', 'baseline_y1']:

# Path: oggm/exceptions.py
# class InvalidParamsError(ValueError):
#     pass


# Path: oggm/cfg.py
import logging
import os
import shutil
import sys
import glob
import warnings
import numpy as np
import pandas as pd
    import geopandas as gpd
    import salem
                import multiprocessing
            import multiprocessing
from collections import OrderedDict
from distutils.util import strtobool
    from scipy.signal.windows import gaussian
    from scipy.signal import gaussian
from configobj import ConfigObj, ConfigObjError
from oggm.exceptions import InvalidParamsError
    from oggm.utils import download_oggm_files, get_demo_file
    from oggm.utils import get_dl_verify_data
        from oggm.utils import LRUFileCache

    """Quick "magic" to be sure that paths are expanded correctly."""

    def __setitem__(self, key, value):
        # Overrides the original dic to expand the path
        try:
            value = os.path.expanduser(value)
        except AttributeError:
            raise InvalidParamsError('The value you are trying to set does '
                                     'not seem to be a valid path: '
                                     '{}'.format(value))

        ResettingOrderedDict.__setitem__(self, key, value)


class ParamsLoggingDict(ResettingOrderedDict):
    """Quick "magic" to log the parameter changes by the user."""

    do_log = False

    def __setitem__(self, key, value):
        # Overrides the original dic to log the change
        if self.do_log:
            self._log_param_change(key, value)
        ResettingOrderedDict.__setitem__(self, key, value)

    def _log_param_change(self, key, value):

        prev = self.get(key)
        if prev is None:
            if key in ['baseline_y0', 'baseline_y1']:

                raise InvalidParamsError('The `baseline_y0` and `baseline_y1` '