def sample(self, n, fluxes=True):
samples = np.zeros((n, self.warmup.shape[<NUM_LIT:1>]))<EOL>for i in range(<NUM_LIT:1>, self.thinning * n + <NUM_LIT:1>):<EOL><INDENT>self.__single_iteration()<EOL>if i % self.thinning == <NUM_LIT:0>:<EOL><INDENT>samples[i//self.thinning - <NUM_LIT:1>, ] = self.prev<EOL><DEDENT><DEDENT>if fluxes:<EOL><INDENT>names = [r.id for r in self.model.reactions]<EOL>return pandas.DataFrame(<EOL>samples[:, self.fwd_idx] - samples[:, self.rev_idx],<EOL>columns=names)<EOL><DEDENT>else:<EOL><INDENT>names = [v.name for v in self.model.variables]<EOL>return pandas.DataFrame(samples, columns=names)<EOL><DEDENT>
Generate a set of samples.

        This is the basic sampling function for all hit-and-run samplers.

        Parameters
        ----------
        n : int
            The number of samples that are generated at once.
        fluxes : boolean
            Whether to return fluxes or the internal solver variables. If set
            to False will return a variable for each forward and backward flux
            as well as all additional variables you might have defined in the
            model.

        Returns
        -------
        numpy.matrix
            Returns a matrix with `n` rows, each containing a flux sample.

        Notes
        -----
        Performance of this function linearly depends on the number
        of reactions in your model and the thinning factor.