code: def val2dzn(val, wrap=True):
      
      if _is_value(val):
          dzn_val = _dzn_val(val)
      elif _is_set(val):
          dzn_val = _dzn_set(val)
      elif _is_array_type(val):
          dzn_val =_dzn_array_nd(val)
      else:
          raise TypeError(
              'Unsupported serialization of value: {}'.format(repr(val))
          )
  
      if wrap:
          wrapper = _get_wrapper()
          dzn_val = wrapper.fill(dzn_val)
  
      return dzn_val
docs: Serializes a value into its dzn representation.
  
      The supported types are ``bool``, ``int``, ``float``, ``set``, ``array``.
  
      Parameters
      ----------
      val
          The value to serialize
      wrap : bool
          Whether to wrap the serialized value.
  
      Returns
      -------
      str
          The serialized dzn representation of the given value.