<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sample(self, size=(), rule="R", antithetic=None):
 """ Create pseudo-random generated samples. By default, the samples are created using standard (pseudo-)random samples. However, if needed, the samples can also be created by either low-discrepancy sequences, and/or variance reduction techniques. Changing the sampling scheme, use the following ``rule`` flag: | key | Description | +=======+=================================================+ | ``C`` | Roots of the first order Chebyshev polynomials. | | ``NC``| Chebyshev nodes adjusted to ensure nested. | | ``K`` | Korobov lattice. | | ``R`` | Classical (Pseudo-)Random samples. | | ``RG``| Regular spaced grid. | | ``NG``| Nested regular spaced grid. | | ``L`` | Latin hypercube samples. | | ``S`` | Sobol low-discrepancy sequence. | | ``H`` | Halton low-discrepancy sequence. | | ``M`` | Hammersley low-discrepancy sequence. | All samples are created on the ``[0, 1]``-hypercube, which then is mapped into the domain of the distribution using the inverse Rosenblatt transformation. Args: size (numpy.ndarray):
 The size of the samples to generate. rule (str):
 Indicator defining the sampling scheme. antithetic (bool, numpy.ndarray):
 If provided, will be used to setup antithetic variables. If array, defines the axes to mirror. Returns: (numpy.ndarray):
 Random samples with shape ``(len(self),)+self.shape``. """

        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

        from . import sampler
        out = sampler.generator.generate_samples(
            order=size_, domain=self, rule=rule, antithetic=antithetic)
        try:
            out = out.reshape(shape)
        except:
            if len(self) == 1:
                out = out.flatten()
            else:
                out = out.reshape(dim, int(out.size/dim))

        return out