code: def expandvars_dict(settings):
      
      return dict(
          (key, os.path.expandvars(value))
          for key, value in settings.iteritems()
      )
docs: Expands all environment variables in a settings dictionary.