def represent_default_value(val, simple=True):
    """
    Attempt to create a python expression to represent val, which was the .default_value of some .input node

    Unless simple=True, we may encounter things such as Materials which require transpiling.
    """

    code = ""
    new_transpiler_targets = {}

    if isinstance(
        val,
        (str, int, bool, bpy.types.Object, bpy.types.Collection, set, bpy.types.Image),
    ):
        code = repr(val)
    elif isinstance(val, (float)):
        code = f"{val:.4f}"
    elif isinstance(
        val, (tuple, bpy.types.bpy_prop_array, mathutils.Vector, mathutils.Euler)
    ):
        code = represent_tuple(tuple(val))
    elif isinstance(val, bpy.types.Collection):
        logger.warning(
            f"Encountered collection {repr(val.name)} as a default_value - please edit the code to remove this dependency on a collection already existing"
        )
        code = f"bpy.data.collections[{repr(val.name)}]"
    elif isinstance(val, bpy.types.Material):
        if val.use_nodes:
            funcname = get_func_name(val)
            new_transpiler_targets[funcname] = val
            code = f"surface.shaderfunc_to_material({funcname})"
        else:
            logger.warning(f"Encountered material {val} but it has use_nodes=False")
            code = repr(val)
    elif val is None:
        logger.warning(
            "Transpiler introduced a None into result script, this may not have been intended by the user"
        )
        code = "None"
    else:
        raise ValueError(
            f"represent_default_value was unable to handle {val=} with type {type(val)}, please contact the developer"
        )

    assert isinstance(code, str)

    if simple:
        if len(new_transpiler_targets) != 0:
            raise ValueError(
                f"Encountered {val=} while trying to represent_default_value with simple=True, please contact the developer"
            )
        return code
    else:
        return code, new_transpiler_targets

    Attempt to create a python expression to represent val, which was the .default_value of some .input node

    Unless simple=True, we may encounter things such as Materials which require transpiling.
    
infinigen/core/nodes/node_transpiler/transpiler.py