code: def settings(**kwargs):
      
      from pyemma import config
  
      old_settings = {}
      try:
          # remember old setting, set new one. May raise ValueError, if invalid setting is given.
          for k, v in kwargs.items():
              old_settings[k] = getattr(config, k)
              setattr(config, k, v)
          yield
      finally:
          # restore old settings
          for k, v in old_settings.items():
              setattr(config, k, v)
docs: apply given PyEMMA config values temporarily within the given context.