code: def module_to_dict(module, omittable=lambda k: k.startswith('_')):
      
      return dict([(k, repr(v)) for k, v in module.__dict__.items() if not omittable(k)])
docs: Converts a module namespace to a Python dictionary. Used by get_settings_diff.