partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | GaussianProcess.add_data | Add data to the training data set of the GaussianProcess instance.
Parameters
----------
X : array, (`M`, `D`)
`M` input values of dimension `D`.
y : array, (`M`,)
`M` target values.
err_y : array, (`M`,) or scalar float, optional
Non-... | gptools/gaussian_process.py | def add_data(self, X, y, err_y=0, n=0, T=None):
"""Add data to the training data set of the GaussianProcess instance.
Parameters
----------
X : array, (`M`, `D`)
`M` input values of dimension `D`.
y : array, (`M`,)
`M` target values.
er... | def add_data(self, X, y, err_y=0, n=0, T=None):
"""Add data to the training data set of the GaussianProcess instance.
Parameters
----------
X : array, (`M`, `D`)
`M` input values of dimension `D`.
y : array, (`M`,)
`M` target values.
er... | [
"Add",
"data",
"to",
"the",
"training",
"data",
"set",
"of",
"the",
"GaussianProcess",
"instance",
".",
"Parameters",
"----------",
"X",
":",
"array",
"(",
"M",
"D",
")",
"M",
"input",
"values",
"of",
"dimension",
"D",
".",
"y",
":",
"array",
"(",
"M",... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L376-L499 | [
"def",
"add_data",
"(",
"self",
",",
"X",
",",
"y",
",",
"err_y",
"=",
"0",
",",
"n",
"=",
"0",
",",
"T",
"=",
"None",
")",
":",
"# Verify y has only one non-trivial dimension:",
"y",
"=",
"scipy",
".",
"atleast_1d",
"(",
"scipy",
".",
"asarray",
"(",
... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess.condense_duplicates | Condense duplicate points using a transformation matrix.
This is useful if you have multiple non-transformed points at the same
location or multiple transformed points that use the same quadrature
points.
Won't change the GP if all of the rows of [X, n] are unique. Will... | gptools/gaussian_process.py | def condense_duplicates(self):
"""Condense duplicate points using a transformation matrix.
This is useful if you have multiple non-transformed points at the same
location or multiple transformed points that use the same quadrature
points.
Won't change the GP if ... | def condense_duplicates(self):
"""Condense duplicate points using a transformation matrix.
This is useful if you have multiple non-transformed points at the same
location or multiple transformed points that use the same quadrature
points.
Won't change the GP if ... | [
"Condense",
"duplicate",
"points",
"using",
"a",
"transformation",
"matrix",
".",
"This",
"is",
"useful",
"if",
"you",
"have",
"multiple",
"non",
"-",
"transformed",
"points",
"at",
"the",
"same",
"location",
"or",
"multiple",
"transformed",
"points",
"that",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L501-L537 | [
"def",
"condense_duplicates",
"(",
"self",
")",
":",
"unique",
",",
"inv",
"=",
"unique_rows",
"(",
"scipy",
".",
"hstack",
"(",
"(",
"self",
".",
"X",
",",
"self",
".",
"n",
")",
")",
",",
"return_inverse",
"=",
"True",
")",
"# Only proceed if there is ... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess.remove_outliers | Remove outliers from the GP with very simplistic outlier detection.
Removes points that are more than `thresh` * `err_y` away from the GP
mean. Note that this is only very rough in that it ignores the
uncertainty in the GP mean at any given point. But you should only be
using th... | gptools/gaussian_process.py | def remove_outliers(self, thresh=3, **predict_kwargs):
"""Remove outliers from the GP with very simplistic outlier detection.
Removes points that are more than `thresh` * `err_y` away from the GP
mean. Note that this is only very rough in that it ignores the
uncertainty in the G... | def remove_outliers(self, thresh=3, **predict_kwargs):
"""Remove outliers from the GP with very simplistic outlier detection.
Removes points that are more than `thresh` * `err_y` away from the GP
mean. Note that this is only very rough in that it ignores the
uncertainty in the G... | [
"Remove",
"outliers",
"from",
"the",
"GP",
"with",
"very",
"simplistic",
"outlier",
"detection",
".",
"Removes",
"points",
"that",
"are",
"more",
"than",
"thresh",
"*",
"err_y",
"away",
"from",
"the",
"GP",
"mean",
".",
"Note",
"that",
"this",
"is",
"only"... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L539-L617 | [
"def",
"remove_outliers",
"(",
"self",
",",
"thresh",
"=",
"3",
",",
"*",
"*",
"predict_kwargs",
")",
":",
"mean",
"=",
"self",
".",
"predict",
"(",
"self",
".",
"X",
",",
"n",
"=",
"self",
".",
"n",
",",
"noise",
"=",
"False",
",",
"return_std",
... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess.optimize_hyperparameters | r"""Optimize the hyperparameters by maximizing the log-posterior.
Leaves the :py:class:`GaussianProcess` instance in the optimized state.
If :py:func:`scipy.optimize.minimize` is not available (i.e., if your
:py:mod:`scipy` version is older than 0.11.0) then :py:func:`fmin_slsq... | gptools/gaussian_process.py | def optimize_hyperparameters(self, method='SLSQP', opt_kwargs={},
verbose=False, random_starts=None,
num_proc=None, max_tries=1):
r"""Optimize the hyperparameters by maximizing the log-posterior.
Leaves the :py:class:`GaussianPro... | def optimize_hyperparameters(self, method='SLSQP', opt_kwargs={},
verbose=False, random_starts=None,
num_proc=None, max_tries=1):
r"""Optimize the hyperparameters by maximizing the log-posterior.
Leaves the :py:class:`GaussianPro... | [
"r",
"Optimize",
"the",
"hyperparameters",
"by",
"maximizing",
"the",
"log",
"-",
"posterior",
".",
"Leaves",
"the",
":",
"py",
":",
"class",
":",
"GaussianProcess",
"instance",
"in",
"the",
"optimized",
"state",
".",
"If",
":",
"py",
":",
"func",
":",
"... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L619-L777 | [
"def",
"optimize_hyperparameters",
"(",
"self",
",",
"method",
"=",
"'SLSQP'",
",",
"opt_kwargs",
"=",
"{",
"}",
",",
"verbose",
"=",
"False",
",",
"random_starts",
"=",
"None",
",",
"num_proc",
"=",
"None",
",",
"max_tries",
"=",
"1",
")",
":",
"if",
... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess.predict | Predict the mean and covariance at the inputs `Xstar`.
The order of the derivative is given by `n`. The keyword `noise` sets
whether or not noise is included in the prediction.
Parameters
----------
Xstar : array, (`M`, `D`)
`M` test input values of ... | gptools/gaussian_process.py | def predict(self, Xstar, n=0, noise=False, return_std=True, return_cov=False,
full_output=False, return_samples=False, num_samples=1,
samp_kwargs={}, return_mean_func=False, use_MCMC=False,
full_MC=False, rejection_func=None, ddof=1, output_transform=None,
... | def predict(self, Xstar, n=0, noise=False, return_std=True, return_cov=False,
full_output=False, return_samples=False, num_samples=1,
samp_kwargs={}, return_mean_func=False, use_MCMC=False,
full_MC=False, rejection_func=None, ddof=1, output_transform=None,
... | [
"Predict",
"the",
"mean",
"and",
"covariance",
"at",
"the",
"inputs",
"Xstar",
".",
"The",
"order",
"of",
"the",
"derivative",
"is",
"given",
"by",
"n",
".",
"The",
"keyword",
"noise",
"sets",
"whether",
"or",
"not",
"noise",
"is",
"included",
"in",
"the... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L779-L1024 | [
"def",
"predict",
"(",
"self",
",",
"Xstar",
",",
"n",
"=",
"0",
",",
"noise",
"=",
"False",
",",
"return_std",
"=",
"True",
",",
"return_cov",
"=",
"False",
",",
"full_output",
"=",
"False",
",",
"return_samples",
"=",
"False",
",",
"num_samples",
"="... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess.plot | Plots the Gaussian process using the current hyperparameters. Only for num_dim <= 2.
Parameters
----------
X : array-like (`M`,) or (`M`, `num_dim`), optional
The values to evaluate the Gaussian process at. If None, then 100
points between the minimum and maximum... | gptools/gaussian_process.py | def plot(self, X=None, n=0, ax=None, envelopes=[1, 3], base_alpha=0.375,
return_prediction=False, return_std=True, full_output=False,
plot_kwargs={}, **kwargs):
"""Plots the Gaussian process using the current hyperparameters. Only for num_dim <= 2.
Parameters
-... | def plot(self, X=None, n=0, ax=None, envelopes=[1, 3], base_alpha=0.375,
return_prediction=False, return_std=True, full_output=False,
plot_kwargs={}, **kwargs):
"""Plots the Gaussian process using the current hyperparameters. Only for num_dim <= 2.
Parameters
-... | [
"Plots",
"the",
"Gaussian",
"process",
"using",
"the",
"current",
"hyperparameters",
".",
"Only",
"for",
"num_dim",
"<",
"=",
"2",
".",
"Parameters",
"----------",
"X",
":",
"array",
"-",
"like",
"(",
"M",
")",
"or",
"(",
"M",
"num_dim",
")",
"optional",... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L1026-L1143 | [
"def",
"plot",
"(",
"self",
",",
"X",
"=",
"None",
",",
"n",
"=",
"0",
",",
"ax",
"=",
"None",
",",
"envelopes",
"=",
"[",
"1",
",",
"3",
"]",
",",
"base_alpha",
"=",
"0.375",
",",
"return_prediction",
"=",
"False",
",",
"return_std",
"=",
"True"... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess.draw_sample | Draw a sample evaluated at the given points `Xstar`.
Note that this function draws samples from the GP given the current
values for the hyperparameters (which may be in a nonsense state if you
just created the instance or called a method that performs MCMC sampling).
If you want... | gptools/gaussian_process.py | def draw_sample(self, Xstar, n=0, num_samp=1, rand_vars=None,
rand_type='standard normal', diag_factor=1e3,
method='cholesky', num_eig=None, mean=None, cov=None,
modify_sign=None, **kwargs):
"""Draw a sample evaluated at the given points `Xstar`.
... | def draw_sample(self, Xstar, n=0, num_samp=1, rand_vars=None,
rand_type='standard normal', diag_factor=1e3,
method='cholesky', num_eig=None, mean=None, cov=None,
modify_sign=None, **kwargs):
"""Draw a sample evaluated at the given points `Xstar`.
... | [
"Draw",
"a",
"sample",
"evaluated",
"at",
"the",
"given",
"points",
"Xstar",
".",
"Note",
"that",
"this",
"function",
"draws",
"samples",
"from",
"the",
"GP",
"given",
"the",
"current",
"values",
"for",
"the",
"hyperparameters",
"(",
"which",
"may",
"be",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L1145-L1320 | [
"def",
"draw_sample",
"(",
"self",
",",
"Xstar",
",",
"n",
"=",
"0",
",",
"num_samp",
"=",
"1",
",",
"rand_vars",
"=",
"None",
",",
"rand_type",
"=",
"'standard normal'",
",",
"diag_factor",
"=",
"1e3",
",",
"method",
"=",
"'cholesky'",
",",
"num_eig",
... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess.update_hyperparameters | r"""Update the kernel's hyperparameters to the new parameters.
This will call :py:meth:`compute_K_L_alpha_ll` to update the state
accordingly.
Note that if this method crashes and the `hyper_deriv_handling` keyword
was used, it may leave :py:attr:`use_hyper_deriv` in th... | gptools/gaussian_process.py | def update_hyperparameters(self, new_params, hyper_deriv_handling='default', exit_on_bounds=True, inf_on_error=True):
r"""Update the kernel's hyperparameters to the new parameters.
This will call :py:meth:`compute_K_L_alpha_ll` to update the state
accordingly.
Note that... | def update_hyperparameters(self, new_params, hyper_deriv_handling='default', exit_on_bounds=True, inf_on_error=True):
r"""Update the kernel's hyperparameters to the new parameters.
This will call :py:meth:`compute_K_L_alpha_ll` to update the state
accordingly.
Note that... | [
"r",
"Update",
"the",
"kernel",
"s",
"hyperparameters",
"to",
"the",
"new",
"parameters",
".",
"This",
"will",
"call",
":",
"py",
":",
"meth",
":",
"compute_K_L_alpha_ll",
"to",
"update",
"the",
"state",
"accordingly",
".",
"Note",
"that",
"if",
"this",
"m... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L1322-L1405 | [
"def",
"update_hyperparameters",
"(",
"self",
",",
"new_params",
",",
"hyper_deriv_handling",
"=",
"'default'",
",",
"exit_on_bounds",
"=",
"True",
",",
"inf_on_error",
"=",
"True",
")",
":",
"use_hyper_deriv",
"=",
"self",
".",
"use_hyper_deriv",
"if",
"hyper_der... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess.compute_K_L_alpha_ll | r"""Compute `K`, `L`, `alpha` and log-likelihood according to the first part of Algorithm 2.1 in R&W.
Computes `K` and the noise portion of `K` using :py:meth:`compute_Kij`,
computes `L` using :py:func:`scipy.linalg.cholesky`, then computes
`alpha` as `L.T\\(L\\y)`.
Onl... | gptools/gaussian_process.py | def compute_K_L_alpha_ll(self):
r"""Compute `K`, `L`, `alpha` and log-likelihood according to the first part of Algorithm 2.1 in R&W.
Computes `K` and the noise portion of `K` using :py:meth:`compute_Kij`,
computes `L` using :py:func:`scipy.linalg.cholesky`, then computes
`alpha... | def compute_K_L_alpha_ll(self):
r"""Compute `K`, `L`, `alpha` and log-likelihood according to the first part of Algorithm 2.1 in R&W.
Computes `K` and the noise portion of `K` using :py:meth:`compute_Kij`,
computes `L` using :py:func:`scipy.linalg.cholesky`, then computes
`alpha... | [
"r",
"Compute",
"K",
"L",
"alpha",
"and",
"log",
"-",
"likelihood",
"according",
"to",
"the",
"first",
"part",
"of",
"Algorithm",
"2",
".",
"1",
"in",
"R&W",
".",
"Computes",
"K",
"and",
"the",
"noise",
"portion",
"of",
"K",
"using",
":",
"py",
":",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L1407-L1511 | [
"def",
"compute_K_L_alpha_ll",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"K_up_to_date",
":",
"y",
"=",
"self",
".",
"y",
"err_y",
"=",
"self",
".",
"err_y",
"self",
".",
"K",
"=",
"self",
".",
"compute_Kij",
"(",
"self",
".",
"X",
",",
"Non... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess.compute_Kij | r"""Compute covariance matrix between datasets `Xi` and `Xj`.
Specify the orders of derivatives at each location with the `ni`, `nj`
arrays. The `include_noise` flag is passed to the covariance kernel to
indicate whether noise is to be included (i.e., for evaluation of
:math:`K+... | gptools/gaussian_process.py | def compute_Kij(self, Xi, Xj, ni, nj, noise=False, hyper_deriv=None, k=None):
r"""Compute covariance matrix between datasets `Xi` and `Xj`.
Specify the orders of derivatives at each location with the `ni`, `nj`
arrays. The `include_noise` flag is passed to the covariance kernel to
... | def compute_Kij(self, Xi, Xj, ni, nj, noise=False, hyper_deriv=None, k=None):
r"""Compute covariance matrix between datasets `Xi` and `Xj`.
Specify the orders of derivatives at each location with the `ni`, `nj`
arrays. The `include_noise` flag is passed to the covariance kernel to
... | [
"r",
"Compute",
"covariance",
"matrix",
"between",
"datasets",
"Xi",
"and",
"Xj",
".",
"Specify",
"the",
"orders",
"of",
"derivatives",
"at",
"each",
"location",
"with",
"the",
"ni",
"nj",
"arrays",
".",
"The",
"include_noise",
"flag",
"is",
"passed",
"to",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L1524-L1594 | [
"def",
"compute_Kij",
"(",
"self",
",",
"Xi",
",",
"Xj",
",",
"ni",
",",
"nj",
",",
"noise",
"=",
"False",
",",
"hyper_deriv",
"=",
"None",
",",
"k",
"=",
"None",
")",
":",
"if",
"k",
"is",
"None",
":",
"if",
"not",
"noise",
":",
"k",
"=",
"s... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess.compute_ll_matrix | Compute the log likelihood over the (free) parameter space.
Parameters
----------
bounds : 2-tuple or list of 2-tuples with length equal to the number of free parameters
Bounds on the range to use for each of the parameters. If a single
2-tuple is given, it will ... | gptools/gaussian_process.py | def compute_ll_matrix(self, bounds, num_pts):
"""Compute the log likelihood over the (free) parameter space.
Parameters
----------
bounds : 2-tuple or list of 2-tuples with length equal to the number of free parameters
Bounds on the range to use for each of the param... | def compute_ll_matrix(self, bounds, num_pts):
"""Compute the log likelihood over the (free) parameter space.
Parameters
----------
bounds : 2-tuple or list of 2-tuples with length equal to the number of free parameters
Bounds on the range to use for each of the param... | [
"Compute",
"the",
"log",
"likelihood",
"over",
"the",
"(",
"free",
")",
"parameter",
"space",
".",
"Parameters",
"----------",
"bounds",
":",
"2",
"-",
"tuple",
"or",
"list",
"of",
"2",
"-",
"tuples",
"with",
"length",
"equal",
"to",
"the",
"number",
"of... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L1596-L1642 | [
"def",
"compute_ll_matrix",
"(",
"self",
",",
"bounds",
",",
"num_pts",
")",
":",
"present_free_params",
"=",
"self",
".",
"free_params",
"[",
":",
"]",
"bounds",
"=",
"scipy",
".",
"atleast_2d",
"(",
"scipy",
".",
"asarray",
"(",
"bounds",
",",
"dtype",
... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess._compute_ll_matrix | Recursive helper function for compute_ll_matrix.
Parameters
----------
idx : int
The index of the parameter for this layer of the recursion to
work on. `idx` == len(`num_pts`) is the base case that terminates
the recursion.
param_vals : List o... | gptools/gaussian_process.py | def _compute_ll_matrix(self, idx, param_vals, num_pts):
"""Recursive helper function for compute_ll_matrix.
Parameters
----------
idx : int
The index of the parameter for this layer of the recursion to
work on. `idx` == len(`num_pts`) is the base case tha... | def _compute_ll_matrix(self, idx, param_vals, num_pts):
"""Recursive helper function for compute_ll_matrix.
Parameters
----------
idx : int
The index of the parameter for this layer of the recursion to
work on. `idx` == len(`num_pts`) is the base case tha... | [
"Recursive",
"helper",
"function",
"for",
"compute_ll_matrix",
".",
"Parameters",
"----------",
"idx",
":",
"int",
"The",
"index",
"of",
"the",
"parameter",
"for",
"this",
"layer",
"of",
"the",
"recursion",
"to",
"work",
"on",
".",
"idx",
"==",
"len",
"(",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L1644-L1681 | [
"def",
"_compute_ll_matrix",
"(",
"self",
",",
"idx",
",",
"param_vals",
",",
"num_pts",
")",
":",
"if",
"idx",
">=",
"len",
"(",
"num_pts",
")",
":",
"# Base case: All entries in param_vals should be scalars:",
"return",
"-",
"1.0",
"*",
"self",
".",
"update_hy... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess.sample_hyperparameter_posterior | Produce samples from the posterior for the hyperparameters using MCMC.
Returns the sampler created, because storing it stops the GP from being
pickleable. To add more samples to a previous sampler, pass the sampler
instance in the `sampler` keyword.
Parameters
-... | gptools/gaussian_process.py | def sample_hyperparameter_posterior(self, nwalkers=200, nsamp=500, burn=0,
thin=1, num_proc=None, sampler=None,
plot_posterior=False,
plot_chains=False, sampler_type='ensemble',
... | def sample_hyperparameter_posterior(self, nwalkers=200, nsamp=500, burn=0,
thin=1, num_proc=None, sampler=None,
plot_posterior=False,
plot_chains=False, sampler_type='ensemble',
... | [
"Produce",
"samples",
"from",
"the",
"posterior",
"for",
"the",
"hyperparameters",
"using",
"MCMC",
".",
"Returns",
"the",
"sampler",
"created",
"because",
"storing",
"it",
"stops",
"the",
"GP",
"from",
"being",
"pickleable",
".",
"To",
"add",
"more",
"samples... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L1683-L1827 | [
"def",
"sample_hyperparameter_posterior",
"(",
"self",
",",
"nwalkers",
"=",
"200",
",",
"nsamp",
"=",
"500",
",",
"burn",
"=",
"0",
",",
"thin",
"=",
"1",
",",
"num_proc",
"=",
"None",
",",
"sampler",
"=",
"None",
",",
"plot_posterior",
"=",
"False",
... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess.compute_from_MCMC | Compute desired quantities from MCMC samples of the hyperparameter posterior.
The return will be a list with a number of rows equal to the number of
hyperparameter samples. The columns depend on the state of the boolean
flags, but will be some subset of (mean, stddev, cov, samples), in ... | gptools/gaussian_process.py | def compute_from_MCMC(self, X, n=0, return_mean=True, return_std=True,
return_cov=False, return_samples=False,
return_mean_func=False, num_samples=1, noise=False,
samp_kwargs={}, sampler=None, flat_trace=None, burn=0,
... | def compute_from_MCMC(self, X, n=0, return_mean=True, return_std=True,
return_cov=False, return_samples=False,
return_mean_func=False, num_samples=1, noise=False,
samp_kwargs={}, sampler=None, flat_trace=None, burn=0,
... | [
"Compute",
"desired",
"quantities",
"from",
"MCMC",
"samples",
"of",
"the",
"hyperparameter",
"posterior",
".",
"The",
"return",
"will",
"be",
"a",
"list",
"with",
"a",
"number",
"of",
"rows",
"equal",
"to",
"the",
"number",
"of",
"hyperparameter",
"samples",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L1829-L1976 | [
"def",
"compute_from_MCMC",
"(",
"self",
",",
"X",
",",
"n",
"=",
"0",
",",
"return_mean",
"=",
"True",
",",
"return_std",
"=",
"True",
",",
"return_cov",
"=",
"False",
",",
"return_samples",
"=",
"False",
",",
"return_mean_func",
"=",
"False",
",",
"num... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess.compute_l_from_MCMC | Compute desired quantities from MCMC samples of the hyperparameter posterior.
The return will be a list with a number of rows equal to the number of
hyperparameter samples. The columns will contain the covariance length
scale function.
Parameters
----------
... | gptools/gaussian_process.py | def compute_l_from_MCMC(self, X, n=0, sampler=None, flat_trace=None, burn=0, thin=1, **kwargs):
"""Compute desired quantities from MCMC samples of the hyperparameter posterior.
The return will be a list with a number of rows equal to the number of
hyperparameter samples. The columns wil... | def compute_l_from_MCMC(self, X, n=0, sampler=None, flat_trace=None, burn=0, thin=1, **kwargs):
"""Compute desired quantities from MCMC samples of the hyperparameter posterior.
The return will be a list with a number of rows equal to the number of
hyperparameter samples. The columns wil... | [
"Compute",
"desired",
"quantities",
"from",
"MCMC",
"samples",
"of",
"the",
"hyperparameter",
"posterior",
".",
"The",
"return",
"will",
"be",
"a",
"list",
"with",
"a",
"number",
"of",
"rows",
"equal",
"to",
"the",
"number",
"of",
"hyperparameter",
"samples",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L1978-L2054 | [
"def",
"compute_l_from_MCMC",
"(",
"self",
",",
"X",
",",
"n",
"=",
"0",
",",
"sampler",
"=",
"None",
",",
"flat_trace",
"=",
"None",
",",
"burn",
"=",
"0",
",",
"thin",
"=",
"1",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"flat_trace",
"is",
"None... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | GaussianProcess.predict_MCMC | Make a prediction using MCMC samples.
This is essentially a convenient wrapper of :py:meth:`compute_from_MCMC`,
designed to act more or less interchangeably with :py:meth:`predict`.
Computes the mean of the GP posterior marginalized over the
hyperparameters using iterat... | gptools/gaussian_process.py | def predict_MCMC(self, X, ddof=1, full_MC=False, rejection_func=None, **kwargs):
"""Make a prediction using MCMC samples.
This is essentially a convenient wrapper of :py:meth:`compute_from_MCMC`,
designed to act more or less interchangeably with :py:meth:`predict`.
Comp... | def predict_MCMC(self, X, ddof=1, full_MC=False, rejection_func=None, **kwargs):
"""Make a prediction using MCMC samples.
This is essentially a convenient wrapper of :py:meth:`compute_from_MCMC`,
designed to act more or less interchangeably with :py:meth:`predict`.
Comp... | [
"Make",
"a",
"prediction",
"using",
"MCMC",
"samples",
".",
"This",
"is",
"essentially",
"a",
"convenient",
"wrapper",
"of",
":",
"py",
":",
"meth",
":",
"compute_from_MCMC",
"designed",
"to",
"act",
"more",
"or",
"less",
"interchangeably",
"with",
":",
"py"... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/gaussian_process.py#L2133-L2243 | [
"def",
"predict_MCMC",
"(",
"self",
",",
"X",
",",
"ddof",
"=",
"1",
",",
"full_MC",
"=",
"False",
",",
"rejection_func",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return_std",
"=",
"kwargs",
".",
"get",
"(",
"'return_std'",
",",
"True",
")",
... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | build_parser | Build an argparse argument parser to parse the command line. | courseraoauth2client/main.py | def build_parser():
"Build an argparse argument parser to parse the command line."
parser = argparse.ArgumentParser(
description="""Coursera OAuth2 client CLI. This tool
helps users of the Coursera App Platform to programmatically access
Coursera APIs.""",
epilog="""Please file ... | def build_parser():
"Build an argparse argument parser to parse the command line."
parser = argparse.ArgumentParser(
description="""Coursera OAuth2 client CLI. This tool
helps users of the Coursera App Platform to programmatically access
Coursera APIs.""",
epilog="""Please file ... | [
"Build",
"an",
"argparse",
"argument",
"parser",
"to",
"parse",
"the",
"command",
"line",
"."
] | coursera/courseraoauth2client | python | https://github.com/coursera/courseraoauth2client/blob/4edd991defe26bfc768ab28a30368cace40baf44/courseraoauth2client/main.py#L30-L53 | [
"def",
"build_parser",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"\"\"\"Coursera OAuth2 client CLI. This tool\n helps users of the Coursera App Platform to programmatically access\n Coursera APIs.\"\"\"",
",",
"epilog",
"=... | 4edd991defe26bfc768ab28a30368cace40baf44 |
train | main | Boots up the command line tool | courseraoauth2client/main.py | def main():
"Boots up the command line tool"
logging.captureWarnings(True)
args = build_parser().parse_args()
# Configure logging
args.setup_logging(args)
# Dispatch into the appropriate subcommand function.
try:
return args.func(args)
except SystemExit:
raise
except:... | def main():
"Boots up the command line tool"
logging.captureWarnings(True)
args = build_parser().parse_args()
# Configure logging
args.setup_logging(args)
# Dispatch into the appropriate subcommand function.
try:
return args.func(args)
except SystemExit:
raise
except:... | [
"Boots",
"up",
"the",
"command",
"line",
"tool"
] | coursera/courseraoauth2client | python | https://github.com/coursera/courseraoauth2client/blob/4edd991defe26bfc768ab28a30368cace40baf44/courseraoauth2client/main.py#L56-L69 | [
"def",
"main",
"(",
")",
":",
"logging",
".",
"captureWarnings",
"(",
"True",
")",
"args",
"=",
"build_parser",
"(",
")",
".",
"parse_args",
"(",
")",
"# Configure logging",
"args",
".",
"setup_logging",
"(",
"args",
")",
"# Dispatch into the appropriate subcomm... | 4edd991defe26bfc768ab28a30368cace40baf44 |
train | sponsor_menu | Add sponsor menu links. | wafer/sponsors/models.py | def sponsor_menu(
root_menu, menu="sponsors", label=_("Sponsors"),
sponsors_item=_("Our sponsors"),
packages_item=_("Sponsorship packages")):
"""Add sponsor menu links."""
root_menu.add_menu(menu, label, items=[])
for sponsor in (
Sponsor.objects.all()
.order_... | def sponsor_menu(
root_menu, menu="sponsors", label=_("Sponsors"),
sponsors_item=_("Our sponsors"),
packages_item=_("Sponsorship packages")):
"""Add sponsor menu links."""
root_menu.add_menu(menu, label, items=[])
for sponsor in (
Sponsor.objects.all()
.order_... | [
"Add",
"sponsor",
"menu",
"links",
"."
] | CTPUG/wafer | python | https://github.com/CTPUG/wafer/blob/a20af3c399267f76373dc342f4d542a9bc457c35/wafer/sponsors/models.py#L115-L141 | [
"def",
"sponsor_menu",
"(",
"root_menu",
",",
"menu",
"=",
"\"sponsors\"",
",",
"label",
"=",
"_",
"(",
"\"Sponsors\"",
")",
",",
"sponsors_item",
"=",
"_",
"(",
"\"Our sponsors\"",
")",
",",
"packages_item",
"=",
"_",
"(",
"\"Sponsorship packages\"",
")",
"... | a20af3c399267f76373dc342f4d542a9bc457c35 |
train | objectatrib | this filter is going to be useful to execute an object method or get an
object attribute dynamically. this method is going to take into account
the atrib param can contains underscores | codenerix/templatetags/codenerix_common.py | def objectatrib(instance, atrib):
'''
this filter is going to be useful to execute an object method or get an
object attribute dynamically. this method is going to take into account
the atrib param can contains underscores
'''
atrib = atrib.replace("__", ".")
atribs = []
atribs = atrib.s... | def objectatrib(instance, atrib):
'''
this filter is going to be useful to execute an object method or get an
object attribute dynamically. this method is going to take into account
the atrib param can contains underscores
'''
atrib = atrib.replace("__", ".")
atribs = []
atribs = atrib.s... | [
"this",
"filter",
"is",
"going",
"to",
"be",
"useful",
"to",
"execute",
"an",
"object",
"method",
"or",
"get",
"an",
"object",
"attribute",
"dynamically",
".",
"this",
"method",
"is",
"going",
"to",
"take",
"into",
"account",
"the",
"atrib",
"param",
"can"... | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/templatetags/codenerix_common.py#L241-L262 | [
"def",
"objectatrib",
"(",
"instance",
",",
"atrib",
")",
":",
"atrib",
"=",
"atrib",
".",
"replace",
"(",
"\"__\"",
",",
"\".\"",
")",
"atribs",
"=",
"[",
"]",
"atribs",
"=",
"atrib",
".",
"split",
"(",
"\".\"",
")",
"obj",
"=",
"instance",
"for",
... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | NgBoundField.as_widget | Renders the field. | codenerix/djng/angular_base.py | def as_widget(self, widget=None, attrs=None, only_initial=False):
"""
Renders the field.
"""
attrs = attrs or {}
attrs.update(self.form.get_widget_attrs(self))
if hasattr(self.field, 'widget_css_classes'):
css_classes = self.field.widget_css_classes
el... | def as_widget(self, widget=None, attrs=None, only_initial=False):
"""
Renders the field.
"""
attrs = attrs or {}
attrs.update(self.form.get_widget_attrs(self))
if hasattr(self.field, 'widget_css_classes'):
css_classes = self.field.widget_css_classes
el... | [
"Renders",
"the",
"field",
"."
] | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/djng/angular_base.py#L166-L184 | [
"def",
"as_widget",
"(",
"self",
",",
"widget",
"=",
"None",
",",
"attrs",
"=",
"None",
",",
"only_initial",
"=",
"False",
")",
":",
"attrs",
"=",
"attrs",
"or",
"{",
"}",
"attrs",
".",
"update",
"(",
"self",
".",
"form",
".",
"get_widget_attrs",
"("... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | NgFormBaseMixin.convert_widgets | During form initialization, some widgets have to be replaced by a counterpart suitable to
be rendered the AngularJS way. | codenerix/djng/angular_base.py | def convert_widgets(self):
"""
During form initialization, some widgets have to be replaced by a counterpart suitable to
be rendered the AngularJS way.
"""
for field in self.base_fields.values():
try:
new_widget = field.get_converted_widget()
... | def convert_widgets(self):
"""
During form initialization, some widgets have to be replaced by a counterpart suitable to
be rendered the AngularJS way.
"""
for field in self.base_fields.values():
try:
new_widget = field.get_converted_widget()
... | [
"During",
"form",
"initialization",
"some",
"widgets",
"have",
"to",
"be",
"replaced",
"by",
"a",
"counterpart",
"suitable",
"to",
"be",
"rendered",
"the",
"AngularJS",
"way",
"."
] | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/djng/angular_base.py#L291-L303 | [
"def",
"convert_widgets",
"(",
"self",
")",
":",
"for",
"field",
"in",
"self",
".",
"base_fields",
".",
"values",
"(",
")",
":",
"try",
":",
"new_widget",
"=",
"field",
".",
"get_converted_widget",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"else",... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | epochdate | Convet an epoch date to a tuple in format ("yyyy-mm-dd","hh:mm:ss")
Example: "1023456427" -> ("2002-06-07","15:27:07")
Parameters:
- `timestamp`: date in epoch format | codenerix/helpers.py | def epochdate(timestamp):
'''
Convet an epoch date to a tuple in format ("yyyy-mm-dd","hh:mm:ss")
Example: "1023456427" -> ("2002-06-07","15:27:07")
Parameters:
- `timestamp`: date in epoch format
'''
dt = datetime.fromtimestamp(float(timestamp)).timetuple()
fecha = "{0:d}-{1:02d}-{2:0... | def epochdate(timestamp):
'''
Convet an epoch date to a tuple in format ("yyyy-mm-dd","hh:mm:ss")
Example: "1023456427" -> ("2002-06-07","15:27:07")
Parameters:
- `timestamp`: date in epoch format
'''
dt = datetime.fromtimestamp(float(timestamp)).timetuple()
fecha = "{0:d}-{1:02d}-{2:0... | [
"Convet",
"an",
"epoch",
"date",
"to",
"a",
"tuple",
"in",
"format",
"(",
"yyyy",
"-",
"mm",
"-",
"dd",
"hh",
":",
"mm",
":",
"ss",
")",
"Example",
":",
"1023456427",
"-",
">",
"(",
"2002",
"-",
"06",
"-",
"07",
"15",
":",
"27",
":",
"07",
")... | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/helpers.py#L52-L64 | [
"def",
"epochdate",
"(",
"timestamp",
")",
":",
"dt",
"=",
"datetime",
".",
"fromtimestamp",
"(",
"float",
"(",
"timestamp",
")",
")",
".",
"timetuple",
"(",
")",
"fecha",
"=",
"\"{0:d}-{1:02d}-{2:02d}\"",
".",
"format",
"(",
"dt",
".",
"tm_year",
",",
"... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | model_inspect | Analize itself looking for special information, right now it returns:
- Application name
- Model name | codenerix/helpers.py | def model_inspect(obj):
'''
Analize itself looking for special information, right now it returns:
- Application name
- Model name
'''
# Prepare the information object
info = {}
if hasattr(obj, '_meta'):
info['verbose_name'] = getattr(obj._meta,... | def model_inspect(obj):
'''
Analize itself looking for special information, right now it returns:
- Application name
- Model name
'''
# Prepare the information object
info = {}
if hasattr(obj, '_meta'):
info['verbose_name'] = getattr(obj._meta,... | [
"Analize",
"itself",
"looking",
"for",
"special",
"information",
"right",
"now",
"it",
"returns",
":",
"-",
"Application",
"name",
"-",
"Model",
"name"
] | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/helpers.py#L284-L312 | [
"def",
"model_inspect",
"(",
"obj",
")",
":",
"# Prepare the information object",
"info",
"=",
"{",
"}",
"if",
"hasattr",
"(",
"obj",
",",
"'_meta'",
")",
":",
"info",
"[",
"'verbose_name'",
"]",
"=",
"getattr",
"(",
"obj",
".",
"_meta",
",",
"'verbose_nam... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | upload_path | This method is created to return the path to upload files. This path must be
different from any other to avoid problems. | codenerix/helpers.py | def upload_path(instance, filename):
'''
This method is created to return the path to upload files. This path must be
different from any other to avoid problems.
'''
path_separator = "/"
date_separator = "-"
ext_separator = "."
empty_string = ""
# get the model name
model_name = ... | def upload_path(instance, filename):
'''
This method is created to return the path to upload files. This path must be
different from any other to avoid problems.
'''
path_separator = "/"
date_separator = "-"
ext_separator = "."
empty_string = ""
# get the model name
model_name = ... | [
"This",
"method",
"is",
"created",
"to",
"return",
"the",
"path",
"to",
"upload",
"files",
".",
"This",
"path",
"must",
"be",
"different",
"from",
"any",
"other",
"to",
"avoid",
"problems",
"."
] | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/helpers.py#L315-L341 | [
"def",
"upload_path",
"(",
"instance",
",",
"filename",
")",
":",
"path_separator",
"=",
"\"/\"",
"date_separator",
"=",
"\"-\"",
"ext_separator",
"=",
"\".\"",
"empty_string",
"=",
"\"\"",
"# get the model name",
"model_name",
"=",
"model_inspect",
"(",
"instance",... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | remove_getdisplay | for string 'get_FIELD_NAME_display' return 'FIELD_NAME' | codenerix/helpers.py | def remove_getdisplay(field_name):
'''
for string 'get_FIELD_NAME_display' return 'FIELD_NAME'
'''
str_ini = 'get_'
str_end = '_display'
if str_ini == field_name[0:len(str_ini)] and str_end == field_name[(-1) * len(str_end):]:
field_name = field_name[len(str_ini):(-1) * len(str_end)]
... | def remove_getdisplay(field_name):
'''
for string 'get_FIELD_NAME_display' return 'FIELD_NAME'
'''
str_ini = 'get_'
str_end = '_display'
if str_ini == field_name[0:len(str_ini)] and str_end == field_name[(-1) * len(str_end):]:
field_name = field_name[len(str_ini):(-1) * len(str_end)]
... | [
"for",
"string",
"get_FIELD_NAME_display",
"return",
"FIELD_NAME"
] | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/helpers.py#L545-L553 | [
"def",
"remove_getdisplay",
"(",
"field_name",
")",
":",
"str_ini",
"=",
"'get_'",
"str_end",
"=",
"'_display'",
"if",
"str_ini",
"==",
"field_name",
"[",
"0",
":",
"len",
"(",
"str_ini",
")",
"]",
"and",
"str_end",
"==",
"field_name",
"[",
"(",
"-",
"1"... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | JSONEncoder_newdefault | JSON Encoder newdfeault is a wrapper capable of encoding several kinds
Usage:
from codenerix.helpers import JSONEncoder_newdefault
JSONEncoder_newdefault() | codenerix/helpers.py | def JSONEncoder_newdefault(kind=['uuid', 'datetime', 'time', 'decimal']):
'''
JSON Encoder newdfeault is a wrapper capable of encoding several kinds
Usage:
from codenerix.helpers import JSONEncoder_newdefault
JSONEncoder_newdefault()
'''
JSONEncoder_olddefault = json.JSONEncoder.defa... | def JSONEncoder_newdefault(kind=['uuid', 'datetime', 'time', 'decimal']):
'''
JSON Encoder newdfeault is a wrapper capable of encoding several kinds
Usage:
from codenerix.helpers import JSONEncoder_newdefault
JSONEncoder_newdefault()
'''
JSONEncoder_olddefault = json.JSONEncoder.defa... | [
"JSON",
"Encoder",
"newdfeault",
"is",
"a",
"wrapper",
"capable",
"of",
"encoding",
"several",
"kinds",
"Usage",
":",
"from",
"codenerix",
".",
"helpers",
"import",
"JSONEncoder_newdefault",
"JSONEncoder_newdefault",
"()"
] | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/helpers.py#L626-L648 | [
"def",
"JSONEncoder_newdefault",
"(",
"kind",
"=",
"[",
"'uuid'",
",",
"'datetime'",
",",
"'time'",
",",
"'decimal'",
"]",
")",
":",
"JSONEncoder_olddefault",
"=",
"json",
".",
"JSONEncoder",
".",
"default",
"def",
"JSONEncoder_wrapped",
"(",
"self",
",",
"o",... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | context_processors_update | Update context with context_processors from settings
Usage:
from codenerix.helpers import context_processors_update
context_processors_update(context, self.request) | codenerix/helpers.py | def context_processors_update(context, request):
'''
Update context with context_processors from settings
Usage:
from codenerix.helpers import context_processors_update
context_processors_update(context, self.request)
'''
for template in settings.TEMPLATES:
for context_proces... | def context_processors_update(context, request):
'''
Update context with context_processors from settings
Usage:
from codenerix.helpers import context_processors_update
context_processors_update(context, self.request)
'''
for template in settings.TEMPLATES:
for context_proces... | [
"Update",
"context",
"with",
"context_processors",
"from",
"settings",
"Usage",
":",
"from",
"codenerix",
".",
"helpers",
"import",
"context_processors_update",
"context_processors_update",
"(",
"context",
"self",
".",
"request",
")"
] | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/helpers.py#L651-L665 | [
"def",
"context_processors_update",
"(",
"context",
",",
"request",
")",
":",
"for",
"template",
"in",
"settings",
".",
"TEMPLATES",
":",
"for",
"context_processor",
"in",
"template",
"[",
"'OPTIONS'",
"]",
"[",
"'context_processors'",
"]",
":",
"path",
"=",
"... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | InMemoryZip.append | Appends a file with name filename_in_zip and contents of
file_contents to the in-memory zip. | codenerix/helpers.py | def append(self, filename_in_zip, file_contents):
'''
Appends a file with name filename_in_zip and contents of
file_contents to the in-memory zip.
'''
# Set the file pointer to the end of the file
self.in_memory_zip.seek(-1, io.SEEK_END)
# Get a handle to the in-... | def append(self, filename_in_zip, file_contents):
'''
Appends a file with name filename_in_zip and contents of
file_contents to the in-memory zip.
'''
# Set the file pointer to the end of the file
self.in_memory_zip.seek(-1, io.SEEK_END)
# Get a handle to the in-... | [
"Appends",
"a",
"file",
"with",
"name",
"filename_in_zip",
"and",
"contents",
"of",
"file_contents",
"to",
"the",
"in",
"-",
"memory",
"zip",
"."
] | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/helpers.py#L491-L516 | [
"def",
"append",
"(",
"self",
",",
"filename_in_zip",
",",
"file_contents",
")",
":",
"# Set the file pointer to the end of the file",
"self",
".",
"in_memory_zip",
".",
"seek",
"(",
"-",
"1",
",",
"io",
".",
"SEEK_END",
")",
"# Get a handle to the in-memory zip in ap... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | InMemoryZip.writetofile | Writes the in-memory zip to a file. | codenerix/helpers.py | def writetofile(self, filename):
'''Writes the in-memory zip to a file.'''
f = open(filename, "w")
f.write(self.read())
f.close() | def writetofile(self, filename):
'''Writes the in-memory zip to a file.'''
f = open(filename, "w")
f.write(self.read())
f.close() | [
"Writes",
"the",
"in",
"-",
"memory",
"zip",
"to",
"a",
"file",
"."
] | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/helpers.py#L538-L542 | [
"def",
"writetofile",
"(",
"self",
",",
"filename",
")",
":",
"f",
"=",
"open",
"(",
"filename",
",",
"\"w\"",
")",
"f",
".",
"write",
"(",
"self",
".",
"read",
"(",
")",
")",
"f",
".",
"close",
"(",
")"
] | 1f5527b352141caaee902b37b2648791a06bd57d |
train | sponsor_image_url | Returns the corresponding url from the sponsors images | wafer/sponsors/templatetags/sponsors.py | def sponsor_image_url(sponsor, name):
"""Returns the corresponding url from the sponsors images"""
if sponsor.files.filter(name=name).exists():
# We avoid worrying about multiple matches by always
# returning the first one.
return sponsor.files.filter(name=name).first().item.url
retu... | def sponsor_image_url(sponsor, name):
"""Returns the corresponding url from the sponsors images"""
if sponsor.files.filter(name=name).exists():
# We avoid worrying about multiple matches by always
# returning the first one.
return sponsor.files.filter(name=name).first().item.url
retu... | [
"Returns",
"the",
"corresponding",
"url",
"from",
"the",
"sponsors",
"images"
] | CTPUG/wafer | python | https://github.com/CTPUG/wafer/blob/a20af3c399267f76373dc342f4d542a9bc457c35/wafer/sponsors/templatetags/sponsors.py#L25-L31 | [
"def",
"sponsor_image_url",
"(",
"sponsor",
",",
"name",
")",
":",
"if",
"sponsor",
".",
"files",
".",
"filter",
"(",
"name",
"=",
"name",
")",
".",
"exists",
"(",
")",
":",
"# We avoid worrying about multiple matches by always",
"# returning the first one.",
"ret... | a20af3c399267f76373dc342f4d542a9bc457c35 |
train | sponsor_tagged_image | returns the corresponding url from the tagged image list. | wafer/sponsors/templatetags/sponsors.py | def sponsor_tagged_image(sponsor, tag):
"""returns the corresponding url from the tagged image list."""
if sponsor.files.filter(tag_name=tag).exists():
return sponsor.files.filter(tag_name=tag).first().tagged_file.item.url
return '' | def sponsor_tagged_image(sponsor, tag):
"""returns the corresponding url from the tagged image list."""
if sponsor.files.filter(tag_name=tag).exists():
return sponsor.files.filter(tag_name=tag).first().tagged_file.item.url
return '' | [
"returns",
"the",
"corresponding",
"url",
"from",
"the",
"tagged",
"image",
"list",
"."
] | CTPUG/wafer | python | https://github.com/CTPUG/wafer/blob/a20af3c399267f76373dc342f4d542a9bc457c35/wafer/sponsors/templatetags/sponsors.py#L35-L39 | [
"def",
"sponsor_tagged_image",
"(",
"sponsor",
",",
"tag",
")",
":",
"if",
"sponsor",
".",
"files",
".",
"filter",
"(",
"tag_name",
"=",
"tag",
")",
".",
"exists",
"(",
")",
":",
"return",
"sponsor",
".",
"files",
".",
"filter",
"(",
"tag_name",
"=",
... | a20af3c399267f76373dc342f4d542a9bc457c35 |
train | ifusergroup | Check to see if the currently logged in user belongs to a specific
group. Requires the Django authentication contrib app and middleware.
Usage: {% ifusergroup Admins %} ... {% endifusergroup %}, or
{% ifusergroup Admins Clients Sellers %} ... {% else %} ... {% endifusergroup %} | codenerix/templatetags/codenerix_special.py | def ifusergroup(parser, token):
""" Check to see if the currently logged in user belongs to a specific
group. Requires the Django authentication contrib app and middleware.
Usage: {% ifusergroup Admins %} ... {% endifusergroup %}, or
{% ifusergroup Admins Clients Sellers %} ... {% else %} ... {%... | def ifusergroup(parser, token):
""" Check to see if the currently logged in user belongs to a specific
group. Requires the Django authentication contrib app and middleware.
Usage: {% ifusergroup Admins %} ... {% endifusergroup %}, or
{% ifusergroup Admins Clients Sellers %} ... {% else %} ... {%... | [
"Check",
"to",
"see",
"if",
"the",
"currently",
"logged",
"in",
"user",
"belongs",
"to",
"a",
"specific",
"group",
".",
"Requires",
"the",
"Django",
"authentication",
"contrib",
"app",
"and",
"middleware",
"."
] | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/templatetags/codenerix_special.py#L63-L87 | [
"def",
"ifusergroup",
"(",
"parser",
",",
"token",
")",
":",
"try",
":",
"tokensp",
"=",
"token",
".",
"split_contents",
"(",
")",
"groups",
"=",
"[",
"]",
"groups",
"+=",
"tokensp",
"[",
"1",
":",
"]",
"except",
"ValueError",
":",
"raise",
"template",... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | VMGuestLib.OpenHandle | Gets a handle for use with other vSphere Guest API functions. The guest library
handle provides a context for accessing information about the virtual machine.
Virtual machine statistics and state data are associated with a particular guest library
handle, so using one handle does not a... | vmguestlib.py | def OpenHandle(self):
'''Gets a handle for use with other vSphere Guest API functions. The guest library
handle provides a context for accessing information about the virtual machine.
Virtual machine statistics and state data are associated with a particular guest library
handl... | def OpenHandle(self):
'''Gets a handle for use with other vSphere Guest API functions. The guest library
handle provides a context for accessing information about the virtual machine.
Virtual machine statistics and state data are associated with a particular guest library
handl... | [
"Gets",
"a",
"handle",
"for",
"use",
"with",
"other",
"vSphere",
"Guest",
"API",
"functions",
".",
"The",
"guest",
"library",
"handle",
"provides",
"a",
"context",
"for",
"accessing",
"information",
"about",
"the",
"virtual",
"machine",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L114-L126 | [
"def",
"OpenHandle",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'handle'",
")",
":",
"return",
"self",
".",
"handle",
"else",
":",
"handle",
"=",
"c_void_p",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_OpenHandle",
"(",
"byref",
... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.CloseHandle | Releases a handle acquired with VMGuestLib_OpenHandle | vmguestlib.py | def CloseHandle(self):
'''Releases a handle acquired with VMGuestLib_OpenHandle'''
if hasattr(self, 'handle'):
ret = vmGuestLib.VMGuestLib_CloseHandle(self.handle.value)
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
del(self.handle) | def CloseHandle(self):
'''Releases a handle acquired with VMGuestLib_OpenHandle'''
if hasattr(self, 'handle'):
ret = vmGuestLib.VMGuestLib_CloseHandle(self.handle.value)
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
del(self.handle) | [
"Releases",
"a",
"handle",
"acquired",
"with",
"VMGuestLib_OpenHandle"
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L128-L133 | [
"def",
"CloseHandle",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'handle'",
")",
":",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_CloseHandle",
"(",
"self",
".",
"handle",
".",
"value",
")",
"if",
"ret",
"!=",
"VMGUESTLIB_ERROR_SUCCESS",
":"... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.UpdateInfo | Updates information about the virtual machine. This information is associated with
the VMGuestLibHandle.
VMGuestLib_UpdateInfo requires similar CPU resources to a system call and
therefore can affect performance. If you are concerned about performance, minimize
the number of... | vmguestlib.py | def UpdateInfo(self):
'''Updates information about the virtual machine. This information is associated with
the VMGuestLibHandle.
VMGuestLib_UpdateInfo requires similar CPU resources to a system call and
therefore can affect performance. If you are concerned about performance, ... | def UpdateInfo(self):
'''Updates information about the virtual machine. This information is associated with
the VMGuestLibHandle.
VMGuestLib_UpdateInfo requires similar CPU resources to a system call and
therefore can affect performance. If you are concerned about performance, ... | [
"Updates",
"information",
"about",
"the",
"virtual",
"machine",
".",
"This",
"information",
"is",
"associated",
"with",
"the",
"VMGuestLibHandle",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L135-L147 | [
"def",
"UpdateInfo",
"(",
"self",
")",
":",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_UpdateInfo",
"(",
"self",
".",
"handle",
".",
"value",
")",
"if",
"ret",
"!=",
"VMGUESTLIB_ERROR_SUCCESS",
":",
"raise",
"VMGuestLibException",
"(",
"ret",
")"
] | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetSessionId | Retrieves the VMSessionID for the current session. Call this function after calling
VMGuestLib_UpdateInfo. If VMGuestLib_UpdateInfo has never been called,
VMGuestLib_GetSessionId returns VMGUESTLIB_ERROR_NO_INFO. | vmguestlib.py | def GetSessionId(self):
'''Retrieves the VMSessionID for the current session. Call this function after calling
VMGuestLib_UpdateInfo. If VMGuestLib_UpdateInfo has never been called,
VMGuestLib_GetSessionId returns VMGUESTLIB_ERROR_NO_INFO.'''
sid = c_void_p()
ret = vmGuestL... | def GetSessionId(self):
'''Retrieves the VMSessionID for the current session. Call this function after calling
VMGuestLib_UpdateInfo. If VMGuestLib_UpdateInfo has never been called,
VMGuestLib_GetSessionId returns VMGUESTLIB_ERROR_NO_INFO.'''
sid = c_void_p()
ret = vmGuestL... | [
"Retrieves",
"the",
"VMSessionID",
"for",
"the",
"current",
"session",
".",
"Call",
"this",
"function",
"after",
"calling",
"VMGuestLib_UpdateInfo",
".",
"If",
"VMGuestLib_UpdateInfo",
"has",
"never",
"been",
"called",
"VMGuestLib_GetSessionId",
"returns",
"VMGUESTLIB_E... | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L149-L156 | [
"def",
"GetSessionId",
"(",
"self",
")",
":",
"sid",
"=",
"c_void_p",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetSessionId",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"sid",
")",
")",
"if",
"ret",
"!=",
"VMGUESTLIB_ERROR_S... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetCpuLimitMHz | Retrieves the upperlimit of processor use in MHz available to the virtual
machine. For information about setting the CPU limit, see "Limits and
Reservations" on page 14. | vmguestlib.py | def GetCpuLimitMHz(self):
'''Retrieves the upperlimit of processor use in MHz available to the virtual
machine. For information about setting the CPU limit, see "Limits and
Reservations" on page 14.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetCpuLimitMHz(self.handl... | def GetCpuLimitMHz(self):
'''Retrieves the upperlimit of processor use in MHz available to the virtual
machine. For information about setting the CPU limit, see "Limits and
Reservations" on page 14.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetCpuLimitMHz(self.handl... | [
"Retrieves",
"the",
"upperlimit",
"of",
"processor",
"use",
"in",
"MHz",
"available",
"to",
"the",
"virtual",
"machine",
".",
"For",
"information",
"about",
"setting",
"the",
"CPU",
"limit",
"see",
"Limits",
"and",
"Reservations",
"on",
"page",
"14",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L158-L165 | [
"def",
"GetCpuLimitMHz",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetCpuLimitMHz",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGUESTL... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetCpuReservationMHz | Retrieves the minimum processing power in MHz reserved for the virtual
machine. For information about setting a CPU reservation, see "Limits and
Reservations" on page 14. | vmguestlib.py | def GetCpuReservationMHz(self):
'''Retrieves the minimum processing power in MHz reserved for the virtual
machine. For information about setting a CPU reservation, see "Limits and
Reservations" on page 14.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetCpuReservationM... | def GetCpuReservationMHz(self):
'''Retrieves the minimum processing power in MHz reserved for the virtual
machine. For information about setting a CPU reservation, see "Limits and
Reservations" on page 14.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetCpuReservationM... | [
"Retrieves",
"the",
"minimum",
"processing",
"power",
"in",
"MHz",
"reserved",
"for",
"the",
"virtual",
"machine",
".",
"For",
"information",
"about",
"setting",
"a",
"CPU",
"reservation",
"see",
"Limits",
"and",
"Reservations",
"on",
"page",
"14",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L167-L174 | [
"def",
"GetCpuReservationMHz",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetCpuReservationMHz",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetCpuShares | Retrieves the number of CPU shares allocated to the virtual machine. For
information about how an ESX server uses CPU shares to manage virtual
machine priority, see the vSphere Resource Management Guide. | vmguestlib.py | def GetCpuShares(self):
'''Retrieves the number of CPU shares allocated to the virtual machine. For
information about how an ESX server uses CPU shares to manage virtual
machine priority, see the vSphere Resource Management Guide.'''
counter = c_uint()
ret = vmGuestLib.VMGu... | def GetCpuShares(self):
'''Retrieves the number of CPU shares allocated to the virtual machine. For
information about how an ESX server uses CPU shares to manage virtual
machine priority, see the vSphere Resource Management Guide.'''
counter = c_uint()
ret = vmGuestLib.VMGu... | [
"Retrieves",
"the",
"number",
"of",
"CPU",
"shares",
"allocated",
"to",
"the",
"virtual",
"machine",
".",
"For",
"information",
"about",
"how",
"an",
"ESX",
"server",
"uses",
"CPU",
"shares",
"to",
"manage",
"virtual",
"machine",
"priority",
"see",
"the",
"v... | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L176-L183 | [
"def",
"GetCpuShares",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetCpuShares",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGUESTLIB_E... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetCpuStolenMs | Retrieves the number of milliseconds that the virtual machine was in a
ready state (able to transition to a run state), but was not scheduled to run. | vmguestlib.py | def GetCpuStolenMs(self):
'''Retrieves the number of milliseconds that the virtual machine was in a
ready state (able to transition to a run state), but was not scheduled to run.'''
counter = c_uint64()
ret = vmGuestLib.VMGuestLib_GetCpuStolenMs(self.handle.value, byref(counter))
... | def GetCpuStolenMs(self):
'''Retrieves the number of milliseconds that the virtual machine was in a
ready state (able to transition to a run state), but was not scheduled to run.'''
counter = c_uint64()
ret = vmGuestLib.VMGuestLib_GetCpuStolenMs(self.handle.value, byref(counter))
... | [
"Retrieves",
"the",
"number",
"of",
"milliseconds",
"that",
"the",
"virtual",
"machine",
"was",
"in",
"a",
"ready",
"state",
"(",
"able",
"to",
"transition",
"to",
"a",
"run",
"state",
")",
"but",
"was",
"not",
"scheduled",
"to",
"run",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L185-L191 | [
"def",
"GetCpuStolenMs",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint64",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetCpuStolenMs",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGUES... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetCpuUsedMs | Retrieves the number of milliseconds during which the virtual machine
has used the CPU. This value includes the time used by the guest
operating system and the time used by virtualization code for tasks for this
virtual machine. You can combine this value with the elapsed time
... | vmguestlib.py | def GetCpuUsedMs(self):
'''Retrieves the number of milliseconds during which the virtual machine
has used the CPU. This value includes the time used by the guest
operating system and the time used by virtualization code for tasks for this
virtual machine. You can combine this va... | def GetCpuUsedMs(self):
'''Retrieves the number of milliseconds during which the virtual machine
has used the CPU. This value includes the time used by the guest
operating system and the time used by virtualization code for tasks for this
virtual machine. You can combine this va... | [
"Retrieves",
"the",
"number",
"of",
"milliseconds",
"during",
"which",
"the",
"virtual",
"machine",
"has",
"used",
"the",
"CPU",
".",
"This",
"value",
"includes",
"the",
"time",
"used",
"by",
"the",
"guest",
"operating",
"system",
"and",
"the",
"time",
"used... | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L193-L203 | [
"def",
"GetCpuUsedMs",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint64",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetCpuUsedMs",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGUESTLIB... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetElapsedMs | Retrieves the number of milliseconds that have passed in the virtual
machine since it last started running on the server. The count of elapsed
time restarts each time the virtual machine is powered on, resumed, or
migrated using VMotion. This value counts milliseconds, regardless of
... | vmguestlib.py | def GetElapsedMs(self):
'''Retrieves the number of milliseconds that have passed in the virtual
machine since it last started running on the server. The count of elapsed
time restarts each time the virtual machine is powered on, resumed, or
migrated using VMotion. This value cou... | def GetElapsedMs(self):
'''Retrieves the number of milliseconds that have passed in the virtual
machine since it last started running on the server. The count of elapsed
time restarts each time the virtual machine is powered on, resumed, or
migrated using VMotion. This value cou... | [
"Retrieves",
"the",
"number",
"of",
"milliseconds",
"that",
"have",
"passed",
"in",
"the",
"virtual",
"machine",
"since",
"it",
"last",
"started",
"running",
"on",
"the",
"server",
".",
"The",
"count",
"of",
"elapsed",
"time",
"restarts",
"each",
"time",
"th... | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L205-L218 | [
"def",
"GetElapsedMs",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint64",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetElapsedMs",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGUESTLIB... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetHostCpuUsedMs | Undocumented. | vmguestlib.py | def GetHostCpuUsedMs(self):
'''Undocumented.'''
counter = c_uint64()
ret = vmGuestLib.VMGuestLib_GetHostCpuUsedMs(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetHostCpuUsedMs(self):
'''Undocumented.'''
counter = c_uint64()
ret = vmGuestLib.VMGuestLib_GetHostCpuUsedMs(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L221-L226 | [
"def",
"GetHostCpuUsedMs",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint64",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetHostCpuUsedMs",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VM... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetHostMemKernOvhdMB | Undocumented. | vmguestlib.py | def GetHostMemKernOvhdMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemKernOvhdMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetHostMemKernOvhdMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemKernOvhdMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L229-L234 | [
"def",
"GetHostMemKernOvhdMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetHostMemKernOvhdMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetHostMemMappedMB | Undocumented. | vmguestlib.py | def GetHostMemMappedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemMappedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetHostMemMappedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemMappedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L237-L242 | [
"def",
"GetHostMemMappedMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetHostMemMappedMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetHostMemPhysFreeMB | Undocumented. | vmguestlib.py | def GetHostMemPhysFreeMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemPhysFreeMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetHostMemPhysFreeMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemPhysFreeMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L245-L250 | [
"def",
"GetHostMemPhysFreeMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetHostMemPhysFreeMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetHostMemPhysMB | Undocumented. | vmguestlib.py | def GetHostMemPhysMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemPhysMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetHostMemPhysMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemPhysMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L253-L258 | [
"def",
"GetHostMemPhysMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetHostMemPhysMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGU... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetHostMemSharedMB | Undocumented. | vmguestlib.py | def GetHostMemSharedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemSharedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetHostMemSharedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemSharedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L261-L266 | [
"def",
"GetHostMemSharedMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetHostMemSharedMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetHostMemSwappedMB | Undocumented. | vmguestlib.py | def GetHostMemSwappedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemSwappedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetHostMemSwappedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemSwappedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L269-L274 | [
"def",
"GetHostMemSwappedMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetHostMemSwappedMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetHostMemUnmappedMB | Undocumented. | vmguestlib.py | def GetHostMemUnmappedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemUnmappedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetHostMemUnmappedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemUnmappedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L277-L282 | [
"def",
"GetHostMemUnmappedMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetHostMemUnmappedMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetHostMemUsedMB | Undocumented. | vmguestlib.py | def GetHostMemUsedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemUsedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetHostMemUsedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostMemUsedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L285-L290 | [
"def",
"GetHostMemUsedMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetHostMemUsedMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGU... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetHostNumCpuCores | Undocumented. | vmguestlib.py | def GetHostNumCpuCores(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostNumCpuCores(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetHostNumCpuCores(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostNumCpuCores(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L293-L298 | [
"def",
"GetHostNumCpuCores",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetHostNumCpuCores",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetHostProcessorSpeed | Retrieves the speed of the ESX system's physical CPU in MHz. | vmguestlib.py | def GetHostProcessorSpeed(self):
'''Retrieves the speed of the ESX system's physical CPU in MHz.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostProcessorSpeed(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return co... | def GetHostProcessorSpeed(self):
'''Retrieves the speed of the ESX system's physical CPU in MHz.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetHostProcessorSpeed(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return co... | [
"Retrieves",
"the",
"speed",
"of",
"the",
"ESX",
"system",
"s",
"physical",
"CPU",
"in",
"MHz",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L300-L305 | [
"def",
"GetHostProcessorSpeed",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetHostProcessorSpeed",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemActiveMB | Retrieves the amount of memory the virtual machine is actively using its
estimated working set size. | vmguestlib.py | def GetMemActiveMB(self):
'''Retrieves the amount of memory the virtual machine is actively using its
estimated working set size.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemActiveMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGue... | def GetMemActiveMB(self):
'''Retrieves the amount of memory the virtual machine is actively using its
estimated working set size.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemActiveMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGue... | [
"Retrieves",
"the",
"amount",
"of",
"memory",
"the",
"virtual",
"machine",
"is",
"actively",
"using",
"its",
"estimated",
"working",
"set",
"size",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L307-L313 | [
"def",
"GetMemActiveMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemActiveMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGUESTL... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemBalloonedMB | Retrieves the amount of memory that has been reclaimed from this virtual
machine by the vSphere memory balloon driver (also referred to as the
"vmmemctl" driver). | vmguestlib.py | def GetMemBalloonedMB(self):
'''Retrieves the amount of memory that has been reclaimed from this virtual
machine by the vSphere memory balloon driver (also referred to as the
"vmmemctl" driver).'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemBalloonedMB(self.handle... | def GetMemBalloonedMB(self):
'''Retrieves the amount of memory that has been reclaimed from this virtual
machine by the vSphere memory balloon driver (also referred to as the
"vmmemctl" driver).'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemBalloonedMB(self.handle... | [
"Retrieves",
"the",
"amount",
"of",
"memory",
"that",
"has",
"been",
"reclaimed",
"from",
"this",
"virtual",
"machine",
"by",
"the",
"vSphere",
"memory",
"balloon",
"driver",
"(",
"also",
"referred",
"to",
"as",
"the",
"vmmemctl",
"driver",
")",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L315-L322 | [
"def",
"GetMemBalloonedMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemBalloonedMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VM... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemBalloonMaxMB | Undocumented. | vmguestlib.py | def GetMemBalloonMaxMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemBalloonMaxMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetMemBalloonMaxMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemBalloonMaxMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L325-L330 | [
"def",
"GetMemBalloonMaxMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemBalloonMaxMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemBalloonTargetMB | Undocumented. | vmguestlib.py | def GetMemBalloonTargetMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemBalloonTargetMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetMemBalloonTargetMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemBalloonTargetMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L333-L338 | [
"def",
"GetMemBalloonTargetMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemBalloonTargetMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemLimitMB | Retrieves the upper limit of memory that is available to the virtual
machine. For information about setting a memory limit, see "Limits and
Reservations" on page 14. | vmguestlib.py | def GetMemLimitMB(self):
'''Retrieves the upper limit of memory that is available to the virtual
machine. For information about setting a memory limit, see "Limits and
Reservations" on page 14.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemLimitMB(self.handle.valu... | def GetMemLimitMB(self):
'''Retrieves the upper limit of memory that is available to the virtual
machine. For information about setting a memory limit, see "Limits and
Reservations" on page 14.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemLimitMB(self.handle.valu... | [
"Retrieves",
"the",
"upper",
"limit",
"of",
"memory",
"that",
"is",
"available",
"to",
"the",
"virtual",
"machine",
".",
"For",
"information",
"about",
"setting",
"a",
"memory",
"limit",
"see",
"Limits",
"and",
"Reservations",
"on",
"page",
"14",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L340-L347 | [
"def",
"GetMemLimitMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemLimitMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGUESTLIB... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemLLSwappedMB | Undocumented. | vmguestlib.py | def GetMemLLSwappedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemLLSwappedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetMemLLSwappedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemLLSwappedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L350-L355 | [
"def",
"GetMemLLSwappedMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemLLSwappedMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VM... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemMappedMB | Retrieves the amount of memory that is allocated to the virtual machine.
Memory that is ballooned, swapped, or has never been accessed is
excluded. | vmguestlib.py | def GetMemMappedMB(self):
'''Retrieves the amount of memory that is allocated to the virtual machine.
Memory that is ballooned, swapped, or has never been accessed is
excluded.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemMappedMB(self.handle.value, byref(counter... | def GetMemMappedMB(self):
'''Retrieves the amount of memory that is allocated to the virtual machine.
Memory that is ballooned, swapped, or has never been accessed is
excluded.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemMappedMB(self.handle.value, byref(counter... | [
"Retrieves",
"the",
"amount",
"of",
"memory",
"that",
"is",
"allocated",
"to",
"the",
"virtual",
"machine",
".",
"Memory",
"that",
"is",
"ballooned",
"swapped",
"or",
"has",
"never",
"been",
"accessed",
"is",
"excluded",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L357-L364 | [
"def",
"GetMemMappedMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemMappedMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGUESTL... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemOverheadMB | Retrieves the amount of "overhead" memory associated with this virtual
machine that is currently consumed on the host system. Overhead
memory is additional memory that is reserved for data structures required
by the virtualization layer. | vmguestlib.py | def GetMemOverheadMB(self):
'''Retrieves the amount of "overhead" memory associated with this virtual
machine that is currently consumed on the host system. Overhead
memory is additional memory that is reserved for data structures required
by the virtualization layer.'''
... | def GetMemOverheadMB(self):
'''Retrieves the amount of "overhead" memory associated with this virtual
machine that is currently consumed on the host system. Overhead
memory is additional memory that is reserved for data structures required
by the virtualization layer.'''
... | [
"Retrieves",
"the",
"amount",
"of",
"overhead",
"memory",
"associated",
"with",
"this",
"virtual",
"machine",
"that",
"is",
"currently",
"consumed",
"on",
"the",
"host",
"system",
".",
"Overhead",
"memory",
"is",
"additional",
"memory",
"that",
"is",
"reserved",... | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L366-L374 | [
"def",
"GetMemOverheadMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemOverheadMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGU... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemReservationMB | Retrieves the minimum amount of memory that is reserved for the virtual
machine. For information about setting a memory reservation, see "Limits
and Reservations" on page 14. | vmguestlib.py | def GetMemReservationMB(self):
'''Retrieves the minimum amount of memory that is reserved for the virtual
machine. For information about setting a memory reservation, see "Limits
and Reservations" on page 14.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemReservati... | def GetMemReservationMB(self):
'''Retrieves the minimum amount of memory that is reserved for the virtual
machine. For information about setting a memory reservation, see "Limits
and Reservations" on page 14.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemReservati... | [
"Retrieves",
"the",
"minimum",
"amount",
"of",
"memory",
"that",
"is",
"reserved",
"for",
"the",
"virtual",
"machine",
".",
"For",
"information",
"about",
"setting",
"a",
"memory",
"reservation",
"see",
"Limits",
"and",
"Reservations",
"on",
"page",
"14",
"."
... | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L376-L383 | [
"def",
"GetMemReservationMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemReservationMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemSharedMB | Retrieves the amount of physical memory associated with this virtual
machine that is copy-on-write (COW) shared on the host. | vmguestlib.py | def GetMemSharedMB(self):
'''Retrieves the amount of physical memory associated with this virtual
machine that is copy-on-write (COW) shared on the host.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemSharedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ER... | def GetMemSharedMB(self):
'''Retrieves the amount of physical memory associated with this virtual
machine that is copy-on-write (COW) shared on the host.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemSharedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ER... | [
"Retrieves",
"the",
"amount",
"of",
"physical",
"memory",
"associated",
"with",
"this",
"virtual",
"machine",
"that",
"is",
"copy",
"-",
"on",
"-",
"write",
"(",
"COW",
")",
"shared",
"on",
"the",
"host",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L385-L391 | [
"def",
"GetMemSharedMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemSharedMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGUESTL... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemSharedSavedMB | Retrieves the estimated amount of physical memory on the host saved
from copy-on-write (COW) shared guest physical memory. | vmguestlib.py | def GetMemSharedSavedMB(self):
'''Retrieves the estimated amount of physical memory on the host saved
from copy-on-write (COW) shared guest physical memory.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemSharedSavedMB(self.handle.value, byref(counter))
if ret != VMGUE... | def GetMemSharedSavedMB(self):
'''Retrieves the estimated amount of physical memory on the host saved
from copy-on-write (COW) shared guest physical memory.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemSharedSavedMB(self.handle.value, byref(counter))
if ret != VMGUE... | [
"Retrieves",
"the",
"estimated",
"amount",
"of",
"physical",
"memory",
"on",
"the",
"host",
"saved",
"from",
"copy",
"-",
"on",
"-",
"write",
"(",
"COW",
")",
"shared",
"guest",
"physical",
"memory",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L393-L399 | [
"def",
"GetMemSharedSavedMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemSharedSavedMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemShares | Retrieves the number of memory shares allocated to the virtual machine.
For information about how an ESX server uses memory shares to manage
virtual machine priority, see the vSphere Resource Management Guide. | vmguestlib.py | def GetMemShares(self):
'''Retrieves the number of memory shares allocated to the virtual machine.
For information about how an ESX server uses memory shares to manage
virtual machine priority, see the vSphere Resource Management Guide.'''
counter = c_uint()
ret = vmGuestLi... | def GetMemShares(self):
'''Retrieves the number of memory shares allocated to the virtual machine.
For information about how an ESX server uses memory shares to manage
virtual machine priority, see the vSphere Resource Management Guide.'''
counter = c_uint()
ret = vmGuestLi... | [
"Retrieves",
"the",
"number",
"of",
"memory",
"shares",
"allocated",
"to",
"the",
"virtual",
"machine",
".",
"For",
"information",
"about",
"how",
"an",
"ESX",
"server",
"uses",
"memory",
"shares",
"to",
"manage",
"virtual",
"machine",
"priority",
"see",
"the"... | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L401-L408 | [
"def",
"GetMemShares",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemShares",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGUESTLIB_E... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemSwappedMB | Retrieves the amount of memory that has been reclaimed from this virtual
machine by transparently swapping guest memory to disk. | vmguestlib.py | def GetMemSwappedMB(self):
'''Retrieves the amount of memory that has been reclaimed from this virtual
machine by transparently swapping guest memory to disk.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemSwappedMB(self.handle.value, byref(counter))
if ret != VMGUEST... | def GetMemSwappedMB(self):
'''Retrieves the amount of memory that has been reclaimed from this virtual
machine by transparently swapping guest memory to disk.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemSwappedMB(self.handle.value, byref(counter))
if ret != VMGUEST... | [
"Retrieves",
"the",
"amount",
"of",
"memory",
"that",
"has",
"been",
"reclaimed",
"from",
"this",
"virtual",
"machine",
"by",
"transparently",
"swapping",
"guest",
"memory",
"to",
"disk",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L410-L416 | [
"def",
"GetMemSwappedMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemSwappedMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGUES... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemSwapTargetMB | Undocumented. | vmguestlib.py | def GetMemSwapTargetMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemSwapTargetMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetMemSwapTargetMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemSwapTargetMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L419-L424 | [
"def",
"GetMemSwapTargetMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemSwapTargetMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemTargetSizeMB | Retrieves the size of the target memory allocation for this virtual machine. | vmguestlib.py | def GetMemTargetSizeMB(self):
'''Retrieves the size of the target memory allocation for this virtual machine.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemTargetSizeMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
... | def GetMemTargetSizeMB(self):
'''Retrieves the size of the target memory allocation for this virtual machine.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemTargetSizeMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
... | [
"Retrieves",
"the",
"size",
"of",
"the",
"target",
"memory",
"allocation",
"for",
"this",
"virtual",
"machine",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L426-L431 | [
"def",
"GetMemTargetSizeMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemTargetSizeMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemUsedMB | Retrieves the estimated amount of physical host memory currently
consumed for this virtual machine's physical memory. | vmguestlib.py | def GetMemUsedMB(self):
'''Retrieves the estimated amount of physical host memory currently
consumed for this virtual machine's physical memory.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemUsedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS... | def GetMemUsedMB(self):
'''Retrieves the estimated amount of physical host memory currently
consumed for this virtual machine's physical memory.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemUsedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS... | [
"Retrieves",
"the",
"estimated",
"amount",
"of",
"physical",
"host",
"memory",
"currently",
"consumed",
"for",
"this",
"virtual",
"machine",
"s",
"physical",
"memory",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L433-L439 | [
"def",
"GetMemUsedMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemUsedMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGUESTLIB_E... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemZippedMB | Undocumented. | vmguestlib.py | def GetMemZippedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemZippedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetMemZippedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemZippedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L442-L447 | [
"def",
"GetMemZippedMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemZippedMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGUESTL... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | VMGuestLib.GetMemZipSavedMB | Undocumented. | vmguestlib.py | def GetMemZipSavedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemZipSavedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | def GetMemZipSavedMB(self):
'''Undocumented.'''
counter = c_uint()
ret = vmGuestLib.VMGuestLib_GetMemZipSavedMB(self.handle.value, byref(counter))
if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
return counter.value | [
"Undocumented",
"."
] | dagwieers/vmguestlib | python | https://github.com/dagwieers/vmguestlib/blob/2ba9333a745628cf9e6b4c767427a5bd997a71ad/vmguestlib.py#L450-L455 | [
"def",
"GetMemZipSavedMB",
"(",
"self",
")",
":",
"counter",
"=",
"c_uint",
"(",
")",
"ret",
"=",
"vmGuestLib",
".",
"VMGuestLib_GetMemZipSavedMB",
"(",
"self",
".",
"handle",
".",
"value",
",",
"byref",
"(",
"counter",
")",
")",
"if",
"ret",
"!=",
"VMGU... | 2ba9333a745628cf9e6b4c767427a5bd997a71ad |
train | spev | Evaluate a B-, M- or I-spline with the specified internal knots, order and coefficients.
`deg` boundary knots are appended at both sides of the domain.
The zeroth order basis functions are modified to ensure continuity at the
right-hand boundary.
Note that the I-splines include the :math:... | gptools/splines.py | def spev(t_int, C, deg, x, cov_C=None, M_spline=False, I_spline=False, n=0):
"""Evaluate a B-, M- or I-spline with the specified internal knots, order and coefficients.
`deg` boundary knots are appended at both sides of the domain.
The zeroth order basis functions are modified to ensure continuity... | def spev(t_int, C, deg, x, cov_C=None, M_spline=False, I_spline=False, n=0):
"""Evaluate a B-, M- or I-spline with the specified internal knots, order and coefficients.
`deg` boundary knots are appended at both sides of the domain.
The zeroth order basis functions are modified to ensure continuity... | [
"Evaluate",
"a",
"B",
"-",
"M",
"-",
"or",
"I",
"-",
"spline",
"with",
"the",
"specified",
"internal",
"knots",
"order",
"and",
"coefficients",
".",
"deg",
"boundary",
"knots",
"are",
"appended",
"at",
"both",
"sides",
"of",
"the",
"domain",
".",
"The",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/splines.py#L5-L146 | [
"def",
"spev",
"(",
"t_int",
",",
"C",
",",
"deg",
",",
"x",
",",
"cov_C",
"=",
"None",
",",
"M_spline",
"=",
"False",
",",
"I_spline",
"=",
"False",
",",
"n",
"=",
"0",
")",
":",
"C",
"=",
"scipy",
".",
"asarray",
"(",
"C",
",",
"dtype",
"="... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | parser | Build an argparse argument parser to parse the command line. | courseraoauth2client/commands/version.py | def parser(subparsers):
"Build an argparse argument parser to parse the command line."
# create the parser for the version subcommand.
parser_version = subparsers.add_parser(
'version',
help="Output the version of %(prog)s to the console.")
parser_version.set_defaults(func=command_versi... | def parser(subparsers):
"Build an argparse argument parser to parse the command line."
# create the parser for the version subcommand.
parser_version = subparsers.add_parser(
'version',
help="Output the version of %(prog)s to the console.")
parser_version.set_defaults(func=command_versi... | [
"Build",
"an",
"argparse",
"argument",
"parser",
"to",
"parse",
"the",
"command",
"line",
"."
] | coursera/courseraoauth2client | python | https://github.com/coursera/courseraoauth2client/blob/4edd991defe26bfc768ab28a30368cace40baf44/courseraoauth2client/commands/version.py#L53-L62 | [
"def",
"parser",
"(",
"subparsers",
")",
":",
"# create the parser for the version subcommand.",
"parser_version",
"=",
"subparsers",
".",
"add_parser",
"(",
"'version'",
",",
"help",
"=",
"\"Output the version of %(prog)s to the console.\"",
")",
"parser_version",
".",
"se... | 4edd991defe26bfc768ab28a30368cace40baf44 |
train | wafer_form_helper | Find the specified Crispy FormHelper and instantiate it.
Handy when you are crispyifying other apps' forms. | wafer/registration/templatetags/wafer_crispy.py | def wafer_form_helper(context, helper_name):
'''
Find the specified Crispy FormHelper and instantiate it.
Handy when you are crispyifying other apps' forms.
'''
request = context.request
module, class_name = helper_name.rsplit('.', 1)
if module not in sys.modules:
__import__(module)
... | def wafer_form_helper(context, helper_name):
'''
Find the specified Crispy FormHelper and instantiate it.
Handy when you are crispyifying other apps' forms.
'''
request = context.request
module, class_name = helper_name.rsplit('.', 1)
if module not in sys.modules:
__import__(module)
... | [
"Find",
"the",
"specified",
"Crispy",
"FormHelper",
"and",
"instantiate",
"it",
".",
"Handy",
"when",
"you",
"are",
"crispyifying",
"other",
"apps",
"forms",
"."
] | CTPUG/wafer | python | https://github.com/CTPUG/wafer/blob/a20af3c399267f76373dc342f4d542a9bc457c35/wafer/registration/templatetags/wafer_crispy.py#L8-L19 | [
"def",
"wafer_form_helper",
"(",
"context",
",",
"helper_name",
")",
":",
"request",
"=",
"context",
".",
"request",
"module",
",",
"class_name",
"=",
"helper_name",
".",
"rsplit",
"(",
"'.'",
",",
"1",
")",
"if",
"module",
"not",
"in",
"sys",
".",
"modu... | a20af3c399267f76373dc342f4d542a9bc457c35 |
train | page_menus | Add page menus. | wafer/pages/models.py | def page_menus(root_menu):
"""Add page menus."""
for page in Page.objects.filter(include_in_menu=True):
path = page.get_path()
menu = path[0] if len(path) > 1 else None
try:
root_menu.add_item(page.name, page.get_absolute_url(), menu=menu)
except MenuError as e:
... | def page_menus(root_menu):
"""Add page menus."""
for page in Page.objects.filter(include_in_menu=True):
path = page.get_path()
menu = path[0] if len(path) > 1 else None
try:
root_menu.add_item(page.name, page.get_absolute_url(), menu=menu)
except MenuError as e:
... | [
"Add",
"page",
"menus",
"."
] | CTPUG/wafer | python | https://github.com/CTPUG/wafer/blob/a20af3c399267f76373dc342f4d542a9bc457c35/wafer/pages/models.py#L162-L171 | [
"def",
"page_menus",
"(",
"root_menu",
")",
":",
"for",
"page",
"in",
"Page",
".",
"objects",
".",
"filter",
"(",
"include_in_menu",
"=",
"True",
")",
":",
"path",
"=",
"page",
".",
"get_path",
"(",
")",
"menu",
"=",
"path",
"[",
"0",
"]",
"if",
"l... | a20af3c399267f76373dc342f4d542a9bc457c35 |
train | redirect_profile | The default destination from logging in, redirect to the actual profile URL | wafer/registration/views.py | def redirect_profile(request):
'''
The default destination from logging in, redirect to the actual profile URL
'''
if request.user.is_authenticated:
return HttpResponseRedirect(reverse('wafer_user_profile',
args=(request.user.username,)))
else:
... | def redirect_profile(request):
'''
The default destination from logging in, redirect to the actual profile URL
'''
if request.user.is_authenticated:
return HttpResponseRedirect(reverse('wafer_user_profile',
args=(request.user.username,)))
else:
... | [
"The",
"default",
"destination",
"from",
"logging",
"in",
"redirect",
"to",
"the",
"actual",
"profile",
"URL"
] | CTPUG/wafer | python | https://github.com/CTPUG/wafer/blob/a20af3c399267f76373dc342f4d542a9bc457c35/wafer/registration/views.py#L12-L20 | [
"def",
"redirect_profile",
"(",
"request",
")",
":",
"if",
"request",
".",
"user",
".",
"is_authenticated",
":",
"return",
"HttpResponseRedirect",
"(",
"reverse",
"(",
"'wafer_user_profile'",
",",
"args",
"=",
"(",
"request",
".",
"user",
".",
"username",
",",... | a20af3c399267f76373dc342f4d542a9bc457c35 |
train | reviewed_badge | Returns a badge for the user's reviews of the talk | wafer/talks/templatetags/review.py | def reviewed_badge(user, talk):
"""Returns a badge for the user's reviews of the talk"""
context = {
'reviewed': False,
}
review = None
if user and not user.is_anonymous():
review = talk.reviews.filter(reviewer=user).first()
if review:
context['reviewed'] = True
... | def reviewed_badge(user, talk):
"""Returns a badge for the user's reviews of the talk"""
context = {
'reviewed': False,
}
review = None
if user and not user.is_anonymous():
review = talk.reviews.filter(reviewer=user).first()
if review:
context['reviewed'] = True
... | [
"Returns",
"a",
"badge",
"for",
"the",
"user",
"s",
"reviews",
"of",
"the",
"talk"
] | CTPUG/wafer | python | https://github.com/CTPUG/wafer/blob/a20af3c399267f76373dc342f4d542a9bc457c35/wafer/talks/templatetags/review.py#L7-L21 | [
"def",
"reviewed_badge",
"(",
"user",
",",
"talk",
")",
":",
"context",
"=",
"{",
"'reviewed'",
":",
"False",
",",
"}",
"review",
"=",
"None",
"if",
"user",
"and",
"not",
"user",
".",
"is_anonymous",
"(",
")",
":",
"review",
"=",
"talk",
".",
"review... | a20af3c399267f76373dc342f4d542a9bc457c35 |
train | beta_cdf_warp | r"""Warp inputs that are confined to the unit hypercube using the regularized incomplete beta function.
Applies separately to each dimension, designed for use with
:py:class:`WarpingFunction`.
Assumes that your inputs `X` lie entirely within the unit hypercube [0, 1].
Note that you may ex... | gptools/kernel/warping.py | def beta_cdf_warp(X, d, n, *args):
r"""Warp inputs that are confined to the unit hypercube using the regularized incomplete beta function.
Applies separately to each dimension, designed for use with
:py:class:`WarpingFunction`.
Assumes that your inputs `X` lie entirely within the unit hypercub... | def beta_cdf_warp(X, d, n, *args):
r"""Warp inputs that are confined to the unit hypercube using the regularized incomplete beta function.
Applies separately to each dimension, designed for use with
:py:class:`WarpingFunction`.
Assumes that your inputs `X` lie entirely within the unit hypercub... | [
"r",
"Warp",
"inputs",
"that",
"are",
"confined",
"to",
"the",
"unit",
"hypercube",
"using",
"the",
"regularized",
"incomplete",
"beta",
"function",
".",
"Applies",
"separately",
"to",
"each",
"dimension",
"designed",
"for",
"use",
"with",
":",
"py",
":",
"c... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/kernel/warping.py#L315-L365 | [
"def",
"beta_cdf_warp",
"(",
"X",
",",
"d",
",",
"n",
",",
"*",
"args",
")",
":",
"X",
"=",
"scipy",
".",
"asarray",
"(",
"X",
")",
"a",
"=",
"args",
"[",
"2",
"*",
"d",
"]",
"b",
"=",
"args",
"[",
"2",
"*",
"d",
"+",
"1",
"]",
"if",
"n... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | linear_warp | r"""Warp inputs with a linear transformation.
Applies the warping
.. math::
w(x) = \frac{x-a}{b-a}
to each dimension. If you set `a=min(X)` and `b=max(X)` then this is a
convenient way to map your inputs to the unit hypercube.
Parameters
----------
X : ar... | gptools/kernel/warping.py | def linear_warp(X, d, n, *args):
r"""Warp inputs with a linear transformation.
Applies the warping
.. math::
w(x) = \frac{x-a}{b-a}
to each dimension. If you set `a=min(X)` and `b=max(X)` then this is a
convenient way to map your inputs to the unit hypercube.
... | def linear_warp(X, d, n, *args):
r"""Warp inputs with a linear transformation.
Applies the warping
.. math::
w(x) = \frac{x-a}{b-a}
to each dimension. If you set `a=min(X)` and `b=max(X)` then this is a
convenient way to map your inputs to the unit hypercube.
... | [
"r",
"Warp",
"inputs",
"with",
"a",
"linear",
"transformation",
".",
"Applies",
"the",
"warping",
"..",
"math",
"::",
"w",
"(",
"x",
")",
"=",
"\\",
"frac",
"{",
"x",
"-",
"a",
"}",
"{",
"b",
"-",
"a",
"}",
"to",
"each",
"dimension",
".",
"If",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/kernel/warping.py#L367-L402 | [
"def",
"linear_warp",
"(",
"X",
",",
"d",
",",
"n",
",",
"*",
"args",
")",
":",
"X",
"=",
"scipy",
".",
"asarray",
"(",
"X",
",",
"dtype",
"=",
"float",
")",
"a",
"=",
"args",
"[",
"2",
"*",
"d",
"]",
"b",
"=",
"args",
"[",
"2",
"*",
"d",... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | WarpedKernel.w_func | Evaluate the (possibly recursive) warping function and its derivatives.
Parameters
----------
X : array, (`M`,)
The points (from dimension `d`) to evaluate the warping function at.
d : int
The dimension to warp.
n : int
The derivative ... | gptools/kernel/warping.py | def w_func(self, X, d, n):
"""Evaluate the (possibly recursive) warping function and its derivatives.
Parameters
----------
X : array, (`M`,)
The points (from dimension `d`) to evaluate the warping function at.
d : int
The dimension to warp.
... | def w_func(self, X, d, n):
"""Evaluate the (possibly recursive) warping function and its derivatives.
Parameters
----------
X : array, (`M`,)
The points (from dimension `d`) to evaluate the warping function at.
d : int
The dimension to warp.
... | [
"Evaluate",
"the",
"(",
"possibly",
"recursive",
")",
"warping",
"function",
"and",
"its",
"derivatives",
".",
"Parameters",
"----------",
"X",
":",
"array",
"(",
"M",
")",
"The",
"points",
"(",
"from",
"dimension",
"d",
")",
"to",
"evaluate",
"the",
"warp... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/kernel/warping.py#L507-L531 | [
"def",
"w_func",
"(",
"self",
",",
"X",
",",
"d",
",",
"n",
")",
":",
"if",
"n",
"==",
"0",
":",
"wX",
"=",
"self",
".",
"w",
"(",
"X",
",",
"d",
",",
"0",
")",
"if",
"isinstance",
"(",
"self",
".",
"k",
",",
"WarpedKernel",
")",
":",
"wX... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | WarpedKernel.enforce_bounds | Set `enforce_bounds` for both of the kernels to a new value. | gptools/kernel/warping.py | def enforce_bounds(self, v):
"""Set `enforce_bounds` for both of the kernels to a new value.
"""
self._enforce_bounds = v
self.k.enforce_bounds = v
self.w.enforce_bounds = v | def enforce_bounds(self, v):
"""Set `enforce_bounds` for both of the kernels to a new value.
"""
self._enforce_bounds = v
self.k.enforce_bounds = v
self.w.enforce_bounds = v | [
"Set",
"enforce_bounds",
"for",
"both",
"of",
"the",
"kernels",
"to",
"a",
"new",
"value",
"."
] | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/kernel/warping.py#L540-L545 | [
"def",
"enforce_bounds",
"(",
"self",
",",
"v",
")",
":",
"self",
".",
"_enforce_bounds",
"=",
"v",
"self",
".",
"k",
".",
"enforce_bounds",
"=",
"v",
"self",
".",
"w",
".",
"enforce_bounds",
"=",
"v"
] | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | WarpedKernel.free_params | Set the free parameters. Note that this bypasses enforce_bounds. | gptools/kernel/warping.py | def free_params(self, value):
"""Set the free parameters. Note that this bypasses enforce_bounds.
"""
value = scipy.asarray(value, dtype=float)
self.K_up_to_date = False
self.k.free_params = value[:self.k.num_free_params]
self.w.free_params = value[self.k.num_free_params:... | def free_params(self, value):
"""Set the free parameters. Note that this bypasses enforce_bounds.
"""
value = scipy.asarray(value, dtype=float)
self.K_up_to_date = False
self.k.free_params = value[:self.k.num_free_params]
self.w.free_params = value[self.k.num_free_params:... | [
"Set",
"the",
"free",
"parameters",
".",
"Note",
"that",
"this",
"bypasses",
"enforce_bounds",
"."
] | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/kernel/warping.py#L582-L588 | [
"def",
"free_params",
"(",
"self",
",",
"value",
")",
":",
"value",
"=",
"scipy",
".",
"asarray",
"(",
"value",
",",
"dtype",
"=",
"float",
")",
"self",
".",
"K_up_to_date",
"=",
"False",
"self",
".",
"k",
".",
"free_params",
"=",
"value",
"[",
":",
... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | WarpedKernel.set_hyperparams | Set the (free) hyperparameters.
Parameters
----------
new_params : :py:class:`Array` or other Array-like
New values of the free parameters.
Raises
------
ValueError
If the length of `new_params` is not consistent with :py:attr:`se... | gptools/kernel/warping.py | def set_hyperparams(self, new_params):
"""Set the (free) hyperparameters.
Parameters
----------
new_params : :py:class:`Array` or other Array-like
New values of the free parameters.
Raises
------
ValueError
If the length o... | def set_hyperparams(self, new_params):
"""Set the (free) hyperparameters.
Parameters
----------
new_params : :py:class:`Array` or other Array-like
New values of the free parameters.
Raises
------
ValueError
If the length o... | [
"Set",
"the",
"(",
"free",
")",
"hyperparameters",
".",
"Parameters",
"----------",
"new_params",
":",
":",
"py",
":",
"class",
":",
"Array",
"or",
"other",
"Array",
"-",
"like",
"New",
"values",
"of",
"the",
"free",
"parameters",
".",
"Raises",
"------",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/kernel/warping.py#L611-L631 | [
"def",
"set_hyperparams",
"(",
"self",
",",
"new_params",
")",
":",
"new_params",
"=",
"scipy",
".",
"asarray",
"(",
"new_params",
",",
"dtype",
"=",
"float",
")",
"if",
"len",
"(",
"new_params",
")",
"==",
"len",
"(",
"self",
".",
"free_params",
")",
... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | MultiForm.get | Handles GET requests and instantiates blank versions of the form and its inline formsets. | codenerix/multiforms.py | def get(self, request, *args, **kwargs):
"""
Handles GET requests and instantiates blank versions of the form and its inline formsets.
"""
# Prepare base
if 'pk' in kwargs:
self.object = self.get_object()
else:
self.object = None
form_clas... | def get(self, request, *args, **kwargs):
"""
Handles GET requests and instantiates blank versions of the form and its inline formsets.
"""
# Prepare base
if 'pk' in kwargs:
self.object = self.get_object()
else:
self.object = None
form_clas... | [
"Handles",
"GET",
"requests",
"and",
"instantiates",
"blank",
"versions",
"of",
"the",
"form",
"and",
"its",
"inline",
"formsets",
"."
] | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/multiforms.py#L51-L160 | [
"def",
"get",
"(",
"self",
",",
"request",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Prepare base",
"if",
"'pk'",
"in",
"kwargs",
":",
"self",
".",
"object",
"=",
"self",
".",
"get_object",
"(",
")",
"else",
":",
"self",
".",
"object"... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | MultiForm.post | andles POST requests, instantiating a form instance and its inline formsets with the passed POST variables and then checking them for validity. | codenerix/multiforms.py | def post(self, request, *args, **kwargs):
"""
andles POST requests, instantiating a form instance and its inline formsets with the passed POST variables and then checking them for validity.
"""
# Prepare base
if 'pk' in kwargs:
self.object = self.get_object()
... | def post(self, request, *args, **kwargs):
"""
andles POST requests, instantiating a form instance and its inline formsets with the passed POST variables and then checking them for validity.
"""
# Prepare base
if 'pk' in kwargs:
self.object = self.get_object()
... | [
"andles",
"POST",
"requests",
"instantiating",
"a",
"form",
"instance",
"and",
"its",
"inline",
"formsets",
"with",
"the",
"passed",
"POST",
"variables",
"and",
"then",
"checking",
"them",
"for",
"validity",
"."
] | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/multiforms.py#L162-L309 | [
"def",
"post",
"(",
"self",
",",
"request",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Prepare base",
"if",
"'pk'",
"in",
"kwargs",
":",
"self",
".",
"object",
"=",
"self",
".",
"get_object",
"(",
")",
"else",
":",
"self",
".",
"object... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | MultiForm.form_valid | Called if all forms are valid. Creates a Recipe instance along with associated Ingredients and Instructions and then redirects to a success page. | codenerix/multiforms.py | def form_valid(self, form, forms):
"""
Called if all forms are valid. Creates a Recipe instance along with associated Ingredients and Instructions and then redirects to a success page.
"""
if self.object:
form.save()
for (formobj, linkerfield) in forms:
... | def form_valid(self, form, forms):
"""
Called if all forms are valid. Creates a Recipe instance along with associated Ingredients and Instructions and then redirects to a success page.
"""
if self.object:
form.save()
for (formobj, linkerfield) in forms:
... | [
"Called",
"if",
"all",
"forms",
"are",
"valid",
".",
"Creates",
"a",
"Recipe",
"instance",
"along",
"with",
"associated",
"Ingredients",
"and",
"Instructions",
"and",
"then",
"redirects",
"to",
"a",
"success",
"page",
"."
] | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/multiforms.py#L312-L327 | [
"def",
"form_valid",
"(",
"self",
",",
"form",
",",
"forms",
")",
":",
"if",
"self",
".",
"object",
":",
"form",
".",
"save",
"(",
")",
"for",
"(",
"formobj",
",",
"linkerfield",
")",
"in",
"forms",
":",
"if",
"form",
"!=",
"formobj",
":",
"formobj... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | MultiForm.form_invalid | Called if a form is invalid. Re-renders the context data with the data-filled forms and errors. | codenerix/multiforms.py | def form_invalid(self, form, forms, open_tabs, position_form_default):
"""
Called if a form is invalid. Re-renders the context data with the data-filled forms and errors.
"""
# return self.render_to_response( self.get_context_data( form = form, forms = forms ) )
return self.rende... | def form_invalid(self, form, forms, open_tabs, position_form_default):
"""
Called if a form is invalid. Re-renders the context data with the data-filled forms and errors.
"""
# return self.render_to_response( self.get_context_data( form = form, forms = forms ) )
return self.rende... | [
"Called",
"if",
"a",
"form",
"is",
"invalid",
".",
"Re",
"-",
"renders",
"the",
"context",
"data",
"with",
"the",
"data",
"-",
"filled",
"forms",
"and",
"errors",
"."
] | codenerix/django-codenerix | python | https://github.com/codenerix/django-codenerix/blob/1f5527b352141caaee902b37b2648791a06bd57d/codenerix/multiforms.py#L329-L334 | [
"def",
"form_invalid",
"(",
"self",
",",
"form",
",",
"forms",
",",
"open_tabs",
",",
"position_form_default",
")",
":",
"# return self.render_to_response( self.get_context_data( form = form, forms = forms ) )",
"return",
"self",
".",
"render_to_response",
"(",
"self",
".",... | 1f5527b352141caaee902b37b2648791a06bd57d |
train | wrap_fmin_slsqp | Wrapper for :py:func:`fmin_slsqp` to allow it to be called with :py:func:`minimize`-like syntax.
This is included to enable the code to run with :py:mod:`scipy` versions
older than 0.11.0.
Accepts `opt_kwargs` in the same format as used by
:py:func:`scipy.optimize.minimize`, with the additional precon... | gptools/utils.py | def wrap_fmin_slsqp(fun, guess, opt_kwargs={}):
"""Wrapper for :py:func:`fmin_slsqp` to allow it to be called with :py:func:`minimize`-like syntax.
This is included to enable the code to run with :py:mod:`scipy` versions
older than 0.11.0.
Accepts `opt_kwargs` in the same format as used by
:py:fun... | def wrap_fmin_slsqp(fun, guess, opt_kwargs={}):
"""Wrapper for :py:func:`fmin_slsqp` to allow it to be called with :py:func:`minimize`-like syntax.
This is included to enable the code to run with :py:mod:`scipy` versions
older than 0.11.0.
Accepts `opt_kwargs` in the same format as used by
:py:fun... | [
"Wrapper",
"for",
":",
"py",
":",
"func",
":",
"fmin_slsqp",
"to",
"allow",
"it",
"to",
"be",
"called",
"with",
":",
"py",
":",
"func",
":",
"minimize",
"-",
"like",
"syntax",
"."
] | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/utils.py#L1269-L1367 | [
"def",
"wrap_fmin_slsqp",
"(",
"fun",
",",
"guess",
",",
"opt_kwargs",
"=",
"{",
"}",
")",
":",
"opt_kwargs",
"=",
"dict",
"(",
"opt_kwargs",
")",
"opt_kwargs",
".",
"pop",
"(",
"'method'",
",",
"None",
")",
"eqcons",
"=",
"[",
"]",
"ieqcons",
"=",
"... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | fixed_poch | Implementation of the Pochhammer symbol :math:`(a)_n` which handles negative integer arguments properly.
Need conditional statement because scipy's impelementation of the Pochhammer
symbol is wrong for negative integer arguments. This function uses the
definition from
http://functions.wolfram.com/G... | gptools/utils.py | def fixed_poch(a, n):
"""Implementation of the Pochhammer symbol :math:`(a)_n` which handles negative integer arguments properly.
Need conditional statement because scipy's impelementation of the Pochhammer
symbol is wrong for negative integer arguments. This function uses the
definition from
h... | def fixed_poch(a, n):
"""Implementation of the Pochhammer symbol :math:`(a)_n` which handles negative integer arguments properly.
Need conditional statement because scipy's impelementation of the Pochhammer
symbol is wrong for negative integer arguments. This function uses the
definition from
h... | [
"Implementation",
"of",
"the",
"Pochhammer",
"symbol",
":",
"math",
":",
"(",
"a",
")",
"_n",
"which",
"handles",
"negative",
"integer",
"arguments",
"properly",
".",
"Need",
"conditional",
"statement",
"because",
"scipy",
"s",
"impelementation",
"of",
"the",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/utils.py#L1369-L1395 | [
"def",
"fixed_poch",
"(",
"a",
",",
"n",
")",
":",
"# Old form, calls gamma function:",
"# if a < 0.0 and a % 1 == 0 and n <= -a:",
"# p = (-1.0)**n * scipy.misc.factorial(-a) / scipy.misc.factorial(-a - n)",
"# else:",
"# p = scipy.special.poch(a, n)",
"# return p",
"if",
"(",... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | Kn2Der | r"""Find the derivatives of :math:`K_\nu(y^{1/2})`.
Parameters
----------
nu : float
The order of the modified Bessel function of the second kind.
y : array of float
The values to evaluate at.
n : nonnegative int, optional
The order of derivative to take. | gptools/utils.py | def Kn2Der(nu, y, n=0):
r"""Find the derivatives of :math:`K_\nu(y^{1/2})`.
Parameters
----------
nu : float
The order of the modified Bessel function of the second kind.
y : array of float
The values to evaluate at.
n : nonnegative int, optional
The order of derivat... | def Kn2Der(nu, y, n=0):
r"""Find the derivatives of :math:`K_\nu(y^{1/2})`.
Parameters
----------
nu : float
The order of the modified Bessel function of the second kind.
y : array of float
The values to evaluate at.
n : nonnegative int, optional
The order of derivat... | [
"r",
"Find",
"the",
"derivatives",
"of",
":",
"math",
":",
"K_",
"\\",
"nu",
"(",
"y^",
"{",
"1",
"/",
"2",
"}",
")",
".",
"Parameters",
"----------",
"nu",
":",
"float",
"The",
"order",
"of",
"the",
"modified",
"Bessel",
"function",
"of",
"the",
"... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/utils.py#L1397-L1427 | [
"def",
"Kn2Der",
"(",
"nu",
",",
"y",
",",
"n",
"=",
"0",
")",
":",
"n",
"=",
"int",
"(",
"n",
")",
"y",
"=",
"scipy",
".",
"asarray",
"(",
"y",
",",
"dtype",
"=",
"float",
")",
"sqrty",
"=",
"scipy",
".",
"sqrt",
"(",
"y",
")",
"if",
"n"... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | yn2Kn2Der | r"""Computes the function :math:`y^{\nu/2} K_{\nu}(y^{1/2})` and its derivatives.
Care has been taken to handle the conditions at :math:`y=0`.
For `n=0`, uses a direct evaluation of the expression, replacing points
where `y=0` with the appropriate value. For `n>0`, uses a general sum
expressio... | gptools/utils.py | def yn2Kn2Der(nu, y, n=0, tol=5e-4, nterms=1, nu_step=0.001):
r"""Computes the function :math:`y^{\nu/2} K_{\nu}(y^{1/2})` and its derivatives.
Care has been taken to handle the conditions at :math:`y=0`.
For `n=0`, uses a direct evaluation of the expression, replacing points
where `y=0` with ... | def yn2Kn2Der(nu, y, n=0, tol=5e-4, nterms=1, nu_step=0.001):
r"""Computes the function :math:`y^{\nu/2} K_{\nu}(y^{1/2})` and its derivatives.
Care has been taken to handle the conditions at :math:`y=0`.
For `n=0`, uses a direct evaluation of the expression, replacing points
where `y=0` with ... | [
"r",
"Computes",
"the",
"function",
":",
"math",
":",
"y^",
"{",
"\\",
"nu",
"/",
"2",
"}",
"K_",
"{",
"\\",
"nu",
"}",
"(",
"y^",
"{",
"1",
"/",
"2",
"}",
")",
"and",
"its",
"derivatives",
".",
"Care",
"has",
"been",
"taken",
"to",
"handle",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/utils.py#L1429-L1518 | [
"def",
"yn2Kn2Der",
"(",
"nu",
",",
"y",
",",
"n",
"=",
"0",
",",
"tol",
"=",
"5e-4",
",",
"nterms",
"=",
"1",
",",
"nu_step",
"=",
"0.001",
")",
":",
"n",
"=",
"int",
"(",
"n",
")",
"y",
"=",
"scipy",
".",
"asarray",
"(",
"y",
",",
"dtype"... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | incomplete_bell_poly | r"""Recursive evaluation of the incomplete Bell polynomial :math:`B_{n, k}(x)`.
Evaluates the incomplete Bell polynomial :math:`B_{n, k}(x_1, x_2, \dots, x_{n-k+1})`,
also known as the partial Bell polynomial or the Bell polynomial of the
second kind. This polynomial is useful in the evaluation of (the... | gptools/utils.py | def incomplete_bell_poly(n, k, x):
r"""Recursive evaluation of the incomplete Bell polynomial :math:`B_{n, k}(x)`.
Evaluates the incomplete Bell polynomial :math:`B_{n, k}(x_1, x_2, \dots, x_{n-k+1})`,
also known as the partial Bell polynomial or the Bell polynomial of the
second kind. This polynom... | def incomplete_bell_poly(n, k, x):
r"""Recursive evaluation of the incomplete Bell polynomial :math:`B_{n, k}(x)`.
Evaluates the incomplete Bell polynomial :math:`B_{n, k}(x_1, x_2, \dots, x_{n-k+1})`,
also known as the partial Bell polynomial or the Bell polynomial of the
second kind. This polynom... | [
"r",
"Recursive",
"evaluation",
"of",
"the",
"incomplete",
"Bell",
"polynomial",
":",
"math",
":",
"B_",
"{",
"n",
"k",
"}",
"(",
"x",
")",
".",
"Evaluates",
"the",
"incomplete",
"Bell",
"polynomial",
":",
"math",
":",
"B_",
"{",
"n",
"k",
"}",
"(",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/utils.py#L1520-L1570 | [
"def",
"incomplete_bell_poly",
"(",
"n",
",",
"k",
",",
"x",
")",
":",
"if",
"n",
"==",
"0",
"and",
"k",
"==",
"0",
":",
"return",
"scipy",
".",
"ones",
"(",
"x",
".",
"shape",
"[",
"0",
"]",
",",
"dtype",
"=",
"float",
")",
"elif",
"k",
"=="... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | generate_set_partition_strings | Generate the restricted growth strings for all of the partitions of an `n`-member set.
Uses Algorithm H from page 416 of volume 4A of Knuth's `The Art of Computer
Programming`. Returns the partitions in lexicographical order.
Parameters
----------
n : scalar int, non-negative
Numbe... | gptools/utils.py | def generate_set_partition_strings(n):
"""Generate the restricted growth strings for all of the partitions of an `n`-member set.
Uses Algorithm H from page 416 of volume 4A of Knuth's `The Art of Computer
Programming`. Returns the partitions in lexicographical order.
Parameters
----------
... | def generate_set_partition_strings(n):
"""Generate the restricted growth strings for all of the partitions of an `n`-member set.
Uses Algorithm H from page 416 of volume 4A of Knuth's `The Art of Computer
Programming`. Returns the partitions in lexicographical order.
Parameters
----------
... | [
"Generate",
"the",
"restricted",
"growth",
"strings",
"for",
"all",
"of",
"the",
"partitions",
"of",
"an",
"n",
"-",
"member",
"set",
".",
"Uses",
"Algorithm",
"H",
"from",
"page",
"416",
"of",
"volume",
"4A",
"of",
"Knuth",
"s",
"The",
"Art",
"of",
"C... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/utils.py#L1572-L1624 | [
"def",
"generate_set_partition_strings",
"(",
"n",
")",
":",
"# Handle edge cases:",
"if",
"n",
"==",
"0",
":",
"return",
"[",
"]",
"elif",
"n",
"==",
"1",
":",
"return",
"[",
"scipy",
".",
"array",
"(",
"[",
"0",
"]",
")",
"]",
"partitions",
"=",
"[... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | generate_set_partitions | Generate all of the partitions of a set.
This is a helper function that utilizes the restricted growth strings from
:py:func:`generate_set_partition_strings`. The partitions are returned in
lexicographic order.
Parameters
----------
set_ : :py:class:`Array` or other Array-like, (`m`,)
... | gptools/utils.py | def generate_set_partitions(set_):
"""Generate all of the partitions of a set.
This is a helper function that utilizes the restricted growth strings from
:py:func:`generate_set_partition_strings`. The partitions are returned in
lexicographic order.
Parameters
----------
set_ : :py:... | def generate_set_partitions(set_):
"""Generate all of the partitions of a set.
This is a helper function that utilizes the restricted growth strings from
:py:func:`generate_set_partition_strings`. The partitions are returned in
lexicographic order.
Parameters
----------
set_ : :py:... | [
"Generate",
"all",
"of",
"the",
"partitions",
"of",
"a",
"set",
".",
"This",
"is",
"a",
"helper",
"function",
"that",
"utilizes",
"the",
"restricted",
"growth",
"strings",
"from",
":",
"py",
":",
"func",
":",
"generate_set_partition_strings",
".",
"The",
"pa... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/utils.py#L1626-L1656 | [
"def",
"generate_set_partitions",
"(",
"set_",
")",
":",
"set_",
"=",
"scipy",
".",
"asarray",
"(",
"set_",
")",
"strings",
"=",
"generate_set_partition_strings",
"(",
"len",
"(",
"set_",
")",
")",
"partitions",
"=",
"[",
"]",
"for",
"string",
"in",
"strin... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | unique_rows | Returns a copy of arr with duplicate rows removed.
From Stackoverflow "Find unique rows in numpy.array."
Parameters
----------
arr : :py:class:`Array`, (`m`, `n`)
The array to find the unique rows of.
return_index : bool, optional
If True, the indices of the unique rows in ... | gptools/utils.py | def unique_rows(arr, return_index=False, return_inverse=False):
"""Returns a copy of arr with duplicate rows removed.
From Stackoverflow "Find unique rows in numpy.array."
Parameters
----------
arr : :py:class:`Array`, (`m`, `n`)
The array to find the unique rows of.
return_ind... | def unique_rows(arr, return_index=False, return_inverse=False):
"""Returns a copy of arr with duplicate rows removed.
From Stackoverflow "Find unique rows in numpy.array."
Parameters
----------
arr : :py:class:`Array`, (`m`, `n`)
The array to find the unique rows of.
return_ind... | [
"Returns",
"a",
"copy",
"of",
"arr",
"with",
"duplicate",
"rows",
"removed",
".",
"From",
"Stackoverflow",
"Find",
"unique",
"rows",
"in",
"numpy",
".",
"array",
".",
"Parameters",
"----------",
"arr",
":",
":",
"py",
":",
"class",
":",
"Array",
"(",
"m"... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/utils.py#L1666-L1721 | [
"def",
"unique_rows",
"(",
"arr",
",",
"return_index",
"=",
"False",
",",
"return_inverse",
"=",
"False",
")",
":",
"b",
"=",
"scipy",
".",
"ascontiguousarray",
"(",
"arr",
")",
".",
"view",
"(",
"scipy",
".",
"dtype",
"(",
"(",
"scipy",
".",
"void",
... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | compute_stats | Compute the average statistics (mean, std dev) for the given values.
Parameters
----------
vals : array-like, (`M`, `D`)
Values to compute the average statistics along the specified axis of.
check_nan : bool, optional
Whether or not to check for (and exclude) NaN's. Default is False... | gptools/utils.py | def compute_stats(vals, check_nan=False, robust=False, axis=1, plot_QQ=False, bins=15, name=''):
"""Compute the average statistics (mean, std dev) for the given values.
Parameters
----------
vals : array-like, (`M`, `D`)
Values to compute the average statistics along the specified axis of.
... | def compute_stats(vals, check_nan=False, robust=False, axis=1, plot_QQ=False, bins=15, name=''):
"""Compute the average statistics (mean, std dev) for the given values.
Parameters
----------
vals : array-like, (`M`, `D`)
Values to compute the average statistics along the specified axis of.
... | [
"Compute",
"the",
"average",
"statistics",
"(",
"mean",
"std",
"dev",
")",
"for",
"the",
"given",
"values",
".",
"Parameters",
"----------",
"vals",
":",
"array",
"-",
"like",
"(",
"M",
"D",
")",
"Values",
"to",
"compute",
"the",
"average",
"statistics",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/utils.py#L1767-L1899 | [
"def",
"compute_stats",
"(",
"vals",
",",
"check_nan",
"=",
"False",
",",
"robust",
"=",
"False",
",",
"axis",
"=",
"1",
",",
"plot_QQ",
"=",
"False",
",",
"bins",
"=",
"15",
",",
"name",
"=",
"''",
")",
":",
"if",
"axis",
"!=",
"1",
"and",
"robu... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | univariate_envelope_plot | Make a plot of a mean curve with uncertainty envelopes. | gptools/utils.py | def univariate_envelope_plot(x, mean, std, ax=None, base_alpha=0.375, envelopes=[1, 3], lb=None, ub=None, expansion=10, **kwargs):
"""Make a plot of a mean curve with uncertainty envelopes.
"""
if ax is None:
f = plt.figure()
ax = f.add_subplot(1, 1, 1)
elif ax == 'gca':
ax = plt... | def univariate_envelope_plot(x, mean, std, ax=None, base_alpha=0.375, envelopes=[1, 3], lb=None, ub=None, expansion=10, **kwargs):
"""Make a plot of a mean curve with uncertainty envelopes.
"""
if ax is None:
f = plt.figure()
ax = f.add_subplot(1, 1, 1)
elif ax == 'gca':
ax = plt... | [
"Make",
"a",
"plot",
"of",
"a",
"mean",
"curve",
"with",
"uncertainty",
"envelopes",
"."
] | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/utils.py#L1901-L1936 | [
"def",
"univariate_envelope_plot",
"(",
"x",
",",
"mean",
",",
"std",
",",
"ax",
"=",
"None",
",",
"base_alpha",
"=",
"0.375",
",",
"envelopes",
"=",
"[",
"1",
",",
"3",
"]",
",",
"lb",
"=",
"None",
",",
"ub",
"=",
"None",
",",
"expansion",
"=",
... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | summarize_sampler | r"""Create summary statistics of the flattened chain of the sampler.
The confidence regions are computed from the quantiles of the data.
Parameters
----------
sampler : :py:class:`emcee.Sampler` instance or array, (`n_temps`, `n_chains`, `n_samp`, `n_dim`), (`n_chains`, `n_samp`, `n_dim`) or (... | gptools/utils.py | def summarize_sampler(sampler, weights=None, burn=0, ci=0.95, chain_mask=None):
r"""Create summary statistics of the flattened chain of the sampler.
The confidence regions are computed from the quantiles of the data.
Parameters
----------
sampler : :py:class:`emcee.Sampler` instance or arr... | def summarize_sampler(sampler, weights=None, burn=0, ci=0.95, chain_mask=None):
r"""Create summary statistics of the flattened chain of the sampler.
The confidence regions are computed from the quantiles of the data.
Parameters
----------
sampler : :py:class:`emcee.Sampler` instance or arr... | [
"r",
"Create",
"summary",
"statistics",
"of",
"the",
"flattened",
"chain",
"of",
"the",
"sampler",
".",
"The",
"confidence",
"regions",
"are",
"computed",
"from",
"the",
"quantiles",
"of",
"the",
"data",
".",
"Parameters",
"----------",
"sampler",
":",
":",
... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/utils.py#L1938-L2030 | [
"def",
"summarize_sampler",
"(",
"sampler",
",",
"weights",
"=",
"None",
",",
"burn",
"=",
"0",
",",
"ci",
"=",
"0.95",
",",
"chain_mask",
"=",
"None",
")",
":",
"try",
":",
"k",
"=",
"sampler",
".",
"flatchain",
".",
"shape",
"[",
"-",
"1",
"]",
... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
train | plot_sampler | Plot the results of MCMC sampler (posterior and chains).
Loosely based on triangle.py. Provides extensive options to format the plot.
Parameters
----------
sampler : :py:class:`emcee.Sampler` instance or array, (`n_temps`, `n_chains`, `n_samp`, `n_dim`), (`n_chains`, `n_samp`, `n_dim`) or (`n_... | gptools/utils.py | def plot_sampler(
sampler, suptitle=None, labels=None, bins=50,
plot_samples=False, plot_hist=True, plot_chains=True,
burn=0, chain_mask=None, temp_idx=0, weights=None, cutoff_weight=None,
cmap='gray_r', hist_color='k', chain_alpha=0.1,
points=None, covs=None, colors=None, ci=[0.... | def plot_sampler(
sampler, suptitle=None, labels=None, bins=50,
plot_samples=False, plot_hist=True, plot_chains=True,
burn=0, chain_mask=None, temp_idx=0, weights=None, cutoff_weight=None,
cmap='gray_r', hist_color='k', chain_alpha=0.1,
points=None, covs=None, colors=None, ci=[0.... | [
"Plot",
"the",
"results",
"of",
"MCMC",
"sampler",
"(",
"posterior",
"and",
"chains",
")",
".",
"Loosely",
"based",
"on",
"triangle",
".",
"py",
".",
"Provides",
"extensive",
"options",
"to",
"format",
"the",
"plot",
".",
"Parameters",
"----------",
"sampler... | markchil/gptools | python | https://github.com/markchil/gptools/blob/225db52bfe6baef1516529ad22177aa2cf7b71e4/gptools/utils.py#L2032-L2439 | [
"def",
"plot_sampler",
"(",
"sampler",
",",
"suptitle",
"=",
"None",
",",
"labels",
"=",
"None",
",",
"bins",
"=",
"50",
",",
"plot_samples",
"=",
"False",
",",
"plot_hist",
"=",
"True",
",",
"plot_chains",
"=",
"True",
",",
"burn",
"=",
"0",
",",
"c... | 225db52bfe6baef1516529ad22177aa2cf7b71e4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.