code: def sample(self, size=(), rule="R", antithetic=None, verbose=False, **kws):
          
          size_ = numpy.prod(size, dtype=int)
          dim = len(self)
          if dim > 1:
              if isinstance(size, (tuple,list,numpy.ndarray)):
                  shape = (dim,) + tuple(size)
              else:
                  shape = (dim, size)
          else:
              shape = size
  
          out = self.kernel.resample(size_)[0]
          try:
              out = out.reshape(shape)
          except:
              if len(self) == 1:
                  out = out.flatten()
              else:
                  out = out.reshape(dim, out.size/dim)
  
          return out
docs: Overwrite sample() function, because the constructed Dist that is
          based on the KDE is only working with the random sampling that is
          given by the KDE itself.