def load_settings(self, settings):
        # If settings module was set try to load or die with error
        if settings is not None:
            try:
                resolve_name(settings)
            except (AttributeError, ImportError):
                return self.error(settings)
        else:
            settings = 'settings'

            try:
                resolve_name(settings)
            except (AttributeError, __HOLE__):
                dirname = os.getcwd()
                loaded = False

                subdirs = \
                    filter(lambda name: os.path.isdir(os.path.join(dirname,
                                                                   name)),
                           os.listdir(dirname))
                subdirs.sort()

                for name in subdirs:
                    settings = name + '.settings'

                    try:
                        resolve_name(settings)
                    except (AttributeError, ImportError, ValueError):
                        pass
                    else:
                        loaded = True
                        break

                if not loaded:
                    self.error(None, dirname, subdirs)

        os.environ['DJANGO_SETTINGS_MODULE'] = settings
dataset/ETHPy150Open playpauseandstop/tddspry/tddspry/noseplugins/djangoplugin.py/DjangoPlugin.load_settings