<commit_before>
from __future__ import print_function

import numpy
import theano

try:
    from hmc import HMC_sampler
except:
    # python 3 compatibility
    # http://stackoverflow.com/questions/3073259/python-nose-import-error
    from hmc.hmc import HMC_sampler


def sampler_on_nd_gaussian(sampler_cls, burnin, n_samples, dim=10):
    batchsize = 3

    rng = numpy.random.RandomState(123)

    # Define a covariance and mu for a gaussian
    mu = numpy.array(rng.rand(dim) * 10, dtype=theano.config.floatX)
    cov = numpy.array(rng.rand(dim, dim), dtype=theano.config.floatX)
    cov = (cov + cov.T) / 2.
    cov[numpy.arange(dim), numpy.arange(dim)] = 1.0
    cov_inv = numpy.linalg.inv(cov)

    # Define energy function for a multi-variate Gaussian<commit_msg>minor edit to respond to Pascal's suggestion<commit_after>
from __future__ import print_function

import numpy
import theano

try:
    from hmc import HMC_sampler
except ImportError as e:
    # python 3 compatibility
    # http://stackoverflow.com/questions/3073259/python-nose-import-error
    from hmc.hmc import HMC_sampler


def sampler_on_nd_gaussian(sampler_cls, burnin, n_samples, dim=10):
    batchsize = 3

    rng = numpy.random.RandomState(123)

    # Define a covariance and mu for a gaussian
    mu = numpy.array(rng.rand(dim) * 10, dtype=theano.config.floatX)
    cov = numpy.array(rng.rand(dim, dim), dtype=theano.config.floatX)
    cov = (cov + cov.T) / 2.
    cov[numpy.arange(dim), numpy.arange(dim)] = 1.0
    cov_inv = numpy.linalg.inv(cov)

    # Define energy function for a multi-variate Gaussian
{'fraction_non_alphanumeric': 0.10251572327044026, 'fraction_numerical': 0.02389937106918239, 'mean_word_length': 3.679411764705882, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6159490', 'n_tokens_mistral': 593, 'n_tokens_neox': 548, 'n_words': 136}