def encode_module_value(v):
    """
    For all things not in builtins, return the module name, otherwise just return the name
    """
    mod = v.__module__
    v = getattr(v, "__qualname__", v.__name__)
    if mod == "builtins":
        return v
    return {"module": mod, "name": v}