Converts a module namespace to a Python dictionary. Used by get_settings_diff.

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