def assign_default_values(instance, schema):
    """
    Assign default values on the provided instance based on the schema default specification.
    """
    instance = fast_deepcopy_dict(instance)
    instance_is_dict = isinstance(instance, dict)
    instance_is_array = isinstance(instance, list)

    if not instance_is_dict and not instance_is_array:
        return instance

    schema_type = schema.get("type", None)

    if instance_is_dict and schema_type == "object":
        return _assign_default_values_object(instance, schema)

    elif instance_is_array and schema_type == "array":
        return _assign_default_values_array(instance, schema)

    return instance

    Assign default values on the provided instance based on the schema default specification.
    
st2common/st2common/util/schema/__init__.py