code: def unique(seq, full=None):
      """replace the duplicate values with unique values in 'full'
  
      If full is a type (int or float), then unique values of the given type
      are selected from range(min(seq),max(seq)). If full is a dict of
      {'min':min, 'max':max}, then unique floats are selected from
      range(min(seq),max(seq)). If full is a sequence (list or set), then
      unique values are selected from the given sequence.
  
      Examples:
        >>> unique([1,2,3,1,2,4], range(11))
        [1, 2, 3, 9, 8, 4]
  
        >>> unique([1,2,3,1,2,9], range(11))
        [1, 2, 3, 8, 5, 9]
  
        >>> try:
        ...     unique([1,2,3,1,2,13], range(11))
        ...     raise Exception
        ... except ValueError:
        ...     pass
        ...
  
        >>> unique([1,2,3,1,2,4], {'min':0, 'max':11})
        [1, 2, 3, 4.175187820357143, 2.5407265707465716, 4]
  
        >>> unique([1,2,3,1,2,4], {'min':0, 'max':11, 'type':int})
        [1, 2, 3, 6, 8, 4]
  
        >>> unique([1,2,3,1,2,4], float)
        [1, 2, 3, 1.012375036824941, 3.9821250727509905, 4]
  
        >>> unique([1,2,3,1,2,10], int)
        [1, 2, 3, 9, 6, 10]
  
        >>> try:
        ...     unique([1,2,3,1,2,4], int)
        ...     raise Exception
        ... except ValueError:
        ...     pass
        ...
      """
      unique = set()
      # replace all duplicates with 'None'
      seq = [
          x if x not in unique and not unique.add(x) else None
          for x in seq
      ]
      lseq = len(seq)
      # check type if full not specified
      if full is None:
          if all([isinstance(x, int) for x in unique]):
              full = int
          else:
              full = float
          ok = True
      else:
          ok = False
      # check all unique show up in 'full'
      if full in (int, float):  # specified type, not range
          ok = (
              ok
              or full == float
              or all([isinstance(x, int) for x in unique])
          )
          msg = "not all items are of type='%s'" % full.__name__
          _min = min(unique)
          _max = max(unique)
      elif isinstance(full, dict):  # specified min/max for floats
          if "type" in full:  # NOTE: undocumented keys: min,max,type
              _type = full["type"]
              del full["type"]
          else:
              _type = float
          minu = min(unique)
          maxu = max(unique)
          _min = full["min"] if "min" in full else minu
          _max = full["max"] if "max" in full else maxu
          ok = minu >= _min and maxu < _max
          if not ok:
              oops = list(unique - set(range(_min, _max)))
              msg = "x=%s not in %s <= x < %s" % (oops[-1], _min, _max)
          full = _type
      else:  # full is a list of all possible values
          ok = unique.issubset(full)
          if not ok:
              oops = list(unique - set(full))
              msg = "%s not in given set" % oops[-1]
          _min = _max = None
      if not ok:
          raise ValueError(msg)
      # check if a unique sequence is possible to build
      if full is float:
          if _min == _max and lseq > 1:
              msg = "no unique len=%s sequence with %s <= x <= %s" % (
                  lseq,
                  _min,
                  _max,
              )
              raise ValueError(msg)
          # replace the 'None' values in seq with 'new' values
          # XXX: HIGHLY UNLIKELY two numbers will be the same, but possible
          return [
              randrange(_min, _max, _int=float) if x is None else x
              for x in seq
          ]
      # generate all possible values not found in 'unique'
      if full is int:
          if max(lseq - (_max + 1 - _min), 0):
              msg = "no unique len=%s sequence with %s <= x <= %s" % (
                  lseq,
                  _min,
                  _max,
              )
              raise ValueError(msg)
          new = list(set(range(_min, _max + 1)) - unique)
      else:
          if lseq > len(full):
              msg = "no unique len=%s sequence in given set" % lseq
              raise ValueError(msg)
          new = list(set(full) - unique)
      # ensure randomly ordered
      shuffle(new)
      # replace the 'None' values in seq with 'new' values
      return [new.pop() if x is None else x for x in seq]
  
imports: from mystic.math.measures import *
  from mystic.math import almostEqual
  from numpy import sum
  from numpy import asfarray, asarray, choose, zeros, ones, ndarray
  from numpy import shape, broadcast, empty, atleast_1d
  from numpy import round, abs
  from random import randrange, shuffle
  from numpy import array, intersect1d, inf, isnan, where, choose, clip
  from numpy.random import uniform, choice
  from numpy import maximum, minimum
  from numpy import round, abs
  from mystic.tools import synchronized, connected
  from mystic.math.discrete import product_measure
label_desc: Use image node_id 20 for calling a global function with example usage: unique(seq, full) and returns: unknown, unknown