def __init__(self, *args, **kwargs):
        """Instantiate the settings."""
        # update this dict from default settings (but only for ALL_CAPS
        # settings)
        for setting in dir(default_settings):
            if setting == setting.upper():
                setattr(self, setting, getattr(default_settings, setting))

        # use user-provided settings
        try:
            settings_module_path = os.environ[ENVIRONMENT_VARIABLE]
            try:
                settings_module = importlib.import_module(settings_module_path)
                for setting in dir(settings_module):
                    if setting == setting.upper():
                        setting_value = getattr(settings_module, setting)
                        setattr(self, setting, setting_value)
            except __HOLE__ as e:
                error = ImportError(
                    'Could not import settings "%s" (Is it on sys.path?): %s' %
                    (settings_module_path, e))
                logger.warn(error)
        except KeyError:
            # NOTE: This is arguably an EnvironmentError, but that causes
            # problems with Python's interactive help.
            logger.warn(
                ('Environment variable %s is undefined. '
                 'Use default settings for now.') % ENVIRONMENT_VARIABLE)


# Instantiate the settings globally.
dataset/ETHPy150Open Nextdoor/ndscheduler/ndscheduler/__init__.py/Settings.__init__