docs: def repair(self, x, copy_if_changed=True, copy_always=False):
          """projects infeasible values on the domain bound, might be
          overwritten by derived class """
          if copy_always:
              x = array(x, copy=True)
              copy = False
          else:
              copy = copy_if_changed
          if self.bounds is None:
              return x
          for ib in [0, 1]:
              if self.bounds[ib] is None:
                  continue
              for i in rglen(x):
                  idx = min([i, len(self.bounds[ib]) - 1])
                  if self.bounds[ib][idx] is not None and \
                          (-1)**ib * x[i] < (-1)**ib * self.bounds[ib][idx]:
                      if copy:
                          x = array(x, copy=True)
                          copy = False
                      x[i] = self.bounds[ib][idx]