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
PlotHandler.ridgeplot
Draw ridgeplot for each plotter. Parameters ---------- mult : float How much to multiply height by. Set this to greater than 1 to have some overlap. linewidth : float Width of line on border of ridges alpha : float Transparency of ridges ...
arviz/plots/forestplot.py
def ridgeplot(self, mult, linewidth, alpha, ax): """Draw ridgeplot for each plotter. Parameters ---------- mult : float How much to multiply height by. Set this to greater than 1 to have some overlap. linewidth : float Width of line on border of ridges ...
def ridgeplot(self, mult, linewidth, alpha, ax): """Draw ridgeplot for each plotter. Parameters ---------- mult : float How much to multiply height by. Set this to greater than 1 to have some overlap. linewidth : float Width of line on border of ridges ...
[ "Draw", "ridgeplot", "for", "each", "plotter", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/forestplot.py#L308-L335
[ "def", "ridgeplot", "(", "self", ",", "mult", ",", "linewidth", ",", "alpha", ",", "ax", ")", ":", "if", "alpha", "is", "None", ":", "alpha", "=", "1.0", "zorder", "=", "0", "for", "plotter", "in", "self", ".", "plotters", ".", "values", "(", ")", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
PlotHandler.forestplot
Draw forestplot for each plotter. Parameters ---------- credible_interval : float How wide each line should be quartiles : bool Whether to mark quartiles xt_textsize : float Size of tick text titlesize : float Size of title...
arviz/plots/forestplot.py
def forestplot( self, credible_interval, quartiles, xt_labelsize, titlesize, linewidth, markersize, ax, rope ): """Draw forestplot for each plotter. Parameters ---------- credible_interval : float How wide each line should be quartiles : bool ...
def forestplot( self, credible_interval, quartiles, xt_labelsize, titlesize, linewidth, markersize, ax, rope ): """Draw forestplot for each plotter. Parameters ---------- credible_interval : float How wide each line should be quartiles : bool ...
[ "Draw", "forestplot", "for", "each", "plotter", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/forestplot.py#L337-L399
[ "def", "forestplot", "(", "self", ",", "credible_interval", ",", "quartiles", ",", "xt_labelsize", ",", "titlesize", ",", "linewidth", ",", "markersize", ",", "ax", ",", "rope", ")", ":", "# Quantiles to be calculated", "endpoint", "=", "100", "*", "(", "1", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
PlotHandler.plot_neff
Draw effective n for each plotter.
arviz/plots/forestplot.py
def plot_neff(self, ax, xt_labelsize, titlesize, markersize): """Draw effective n for each plotter.""" for plotter in self.plotters.values(): for y, ess, color in plotter.ess(): if ess is not None: ax.plot( ess, ...
def plot_neff(self, ax, xt_labelsize, titlesize, markersize): """Draw effective n for each plotter.""" for plotter in self.plotters.values(): for y, ess, color in plotter.ess(): if ess is not None: ax.plot( ess, ...
[ "Draw", "effective", "n", "for", "each", "plotter", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/forestplot.py#L401-L418
[ "def", "plot_neff", "(", "self", ",", "ax", ",", "xt_labelsize", ",", "titlesize", ",", "markersize", ")", ":", "for", "plotter", "in", "self", ".", "plotters", ".", "values", "(", ")", ":", "for", "y", ",", "ess", ",", "color", "in", "plotter", ".",...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
PlotHandler.plot_rhat
Draw r-hat for each plotter.
arviz/plots/forestplot.py
def plot_rhat(self, ax, xt_labelsize, titlesize, markersize): """Draw r-hat for each plotter.""" for plotter in self.plotters.values(): for y, r_hat, color in plotter.r_hat(): if r_hat is not None: ax.plot(r_hat, y, "o", color=color, markersize=markersize,...
def plot_rhat(self, ax, xt_labelsize, titlesize, markersize): """Draw r-hat for each plotter.""" for plotter in self.plotters.values(): for y, r_hat, color in plotter.r_hat(): if r_hat is not None: ax.plot(r_hat, y, "o", color=color, markersize=markersize,...
[ "Draw", "r", "-", "hat", "for", "each", "plotter", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/forestplot.py#L420-L430
[ "def", "plot_rhat", "(", "self", ",", "ax", ",", "xt_labelsize", ",", "titlesize", ",", "markersize", ")", ":", "for", "plotter", "in", "self", ".", "plotters", ".", "values", "(", ")", ":", "for", "y", ",", "r_hat", ",", "color", "in", "plotter", "....
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
PlotHandler.make_bands
Draw shaded horizontal bands for each plotter.
arviz/plots/forestplot.py
def make_bands(self, ax): """Draw shaded horizontal bands for each plotter.""" y_vals, y_prev, is_zero = [0], None, False prev_color_index = 0 for plotter in self.plotters.values(): for y, *_, color in plotter.iterator(): if self.colors.index(color) < prev_col...
def make_bands(self, ax): """Draw shaded horizontal bands for each plotter.""" y_vals, y_prev, is_zero = [0], None, False prev_color_index = 0 for plotter in self.plotters.values(): for y, *_, color in plotter.iterator(): if self.colors.index(color) < prev_col...
[ "Draw", "shaded", "horizontal", "bands", "for", "each", "plotter", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/forestplot.py#L432-L452
[ "def", "make_bands", "(", "self", ",", "ax", ")", ":", "y_vals", ",", "y_prev", ",", "is_zero", "=", "[", "0", "]", ",", "None", ",", "False", "prev_color_index", "=", "0", "for", "plotter", "in", "self", ".", "plotters", ".", "values", "(", ")", "...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
PlotHandler.fig_height
Figure out the height of this plot.
arviz/plots/forestplot.py
def fig_height(self): """Figure out the height of this plot.""" # hand-tuned return ( 4 + len(self.data) * len(self.var_names) - 1 + 0.1 * sum(1 for j in self.plotters.values() for _ in j.iterator()) )
def fig_height(self): """Figure out the height of this plot.""" # hand-tuned return ( 4 + len(self.data) * len(self.var_names) - 1 + 0.1 * sum(1 for j in self.plotters.values() for _ in j.iterator()) )
[ "Figure", "out", "the", "height", "of", "this", "plot", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/forestplot.py#L454-L462
[ "def", "fig_height", "(", "self", ")", ":", "# hand-tuned", "return", "(", "4", "+", "len", "(", "self", ".", "data", ")", "*", "len", "(", "self", ".", "var_names", ")", "-", "1", "+", "0.1", "*", "sum", "(", "1", "for", "j", "in", "self", "."...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
VarHandler.iterator
Iterate over models and chains for each variable.
arviz/plots/forestplot.py
def iterator(self): """Iterate over models and chains for each variable.""" if self.combined: grouped_data = [[(0, datum)] for datum in self.data] skip_dims = {"chain"} else: grouped_data = [datum.groupby("chain") for datum in self.data] skip_dims ...
def iterator(self): """Iterate over models and chains for each variable.""" if self.combined: grouped_data = [[(0, datum)] for datum in self.data] skip_dims = {"chain"} else: grouped_data = [datum.groupby("chain") for datum in self.data] skip_dims ...
[ "Iterate", "over", "models", "and", "chains", "for", "each", "variable", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/forestplot.py#L485-L522
[ "def", "iterator", "(", "self", ")", ":", "if", "self", ".", "combined", ":", "grouped_data", "=", "[", "[", "(", "0", ",", "datum", ")", "]", "for", "datum", "in", "self", ".", "data", "]", "skip_dims", "=", "{", "\"chain\"", "}", "else", ":", "...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
VarHandler.labels_ticks_and_vals
Get labels, ticks, values, and colors for the variable.
arviz/plots/forestplot.py
def labels_ticks_and_vals(self): """Get labels, ticks, values, and colors for the variable.""" y_ticks = defaultdict(list) for y, label, _, vals, color in self.iterator(): y_ticks[label].append((y, vals, color)) labels, ticks, vals, colors = [], [], [], [] for label, ...
def labels_ticks_and_vals(self): """Get labels, ticks, values, and colors for the variable.""" y_ticks = defaultdict(list) for y, label, _, vals, color in self.iterator(): y_ticks[label].append((y, vals, color)) labels, ticks, vals, colors = [], [], [], [] for label, ...
[ "Get", "labels", "ticks", "values", "and", "colors", "for", "the", "variable", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/forestplot.py#L524-L535
[ "def", "labels_ticks_and_vals", "(", "self", ")", ":", "y_ticks", "=", "defaultdict", "(", "list", ")", "for", "y", ",", "label", ",", "_", ",", "vals", ",", "color", "in", "self", ".", "iterator", "(", ")", ":", "y_ticks", "[", "label", "]", ".", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
VarHandler.treeplot
Get data for each treeplot for the variable.
arviz/plots/forestplot.py
def treeplot(self, qlist, credible_interval): """Get data for each treeplot for the variable.""" for y, _, label, values, color in self.iterator(): ntiles = np.percentile(values.flatten(), qlist) ntiles[0], ntiles[-1] = hpd(values.flatten(), credible_interval) yield y...
def treeplot(self, qlist, credible_interval): """Get data for each treeplot for the variable.""" for y, _, label, values, color in self.iterator(): ntiles = np.percentile(values.flatten(), qlist) ntiles[0], ntiles[-1] = hpd(values.flatten(), credible_interval) yield y...
[ "Get", "data", "for", "each", "treeplot", "for", "the", "variable", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/forestplot.py#L537-L542
[ "def", "treeplot", "(", "self", ",", "qlist", ",", "credible_interval", ")", ":", "for", "y", ",", "_", ",", "label", ",", "values", ",", "color", "in", "self", ".", "iterator", "(", ")", ":", "ntiles", "=", "np", ".", "percentile", "(", "values", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
VarHandler.ridgeplot
Get data for each ridgeplot for the variable.
arviz/plots/forestplot.py
def ridgeplot(self, mult): """Get data for each ridgeplot for the variable.""" xvals, yvals, pdfs, colors = [], [], [], [] for y, *_, values, color in self.iterator(): yvals.append(y) colors.append(color) values = values.flatten() density, lower, u...
def ridgeplot(self, mult): """Get data for each ridgeplot for the variable.""" xvals, yvals, pdfs, colors = [], [], [], [] for y, *_, values, color in self.iterator(): yvals.append(y) colors.append(color) values = values.flatten() density, lower, u...
[ "Get", "data", "for", "each", "ridgeplot", "for", "the", "variable", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/forestplot.py#L544-L558
[ "def", "ridgeplot", "(", "self", ",", "mult", ")", ":", "xvals", ",", "yvals", ",", "pdfs", ",", "colors", "=", "[", "]", ",", "[", "]", ",", "[", "]", ",", "[", "]", "for", "y", ",", "*", "_", ",", "values", ",", "color", "in", "self", "."...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
VarHandler.ess
Get effective n data for the variable.
arviz/plots/forestplot.py
def ess(self): """Get effective n data for the variable.""" _, y_vals, values, colors = self.labels_ticks_and_vals() for y, value, color in zip(y_vals, values, colors): if value.ndim != 2 or value.shape[0] < 2: yield y, None, color else: yi...
def ess(self): """Get effective n data for the variable.""" _, y_vals, values, colors = self.labels_ticks_and_vals() for y, value, color in zip(y_vals, values, colors): if value.ndim != 2 or value.shape[0] < 2: yield y, None, color else: yi...
[ "Get", "effective", "n", "data", "for", "the", "variable", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/forestplot.py#L560-L567
[ "def", "ess", "(", "self", ")", ":", "_", ",", "y_vals", ",", "values", ",", "colors", "=", "self", ".", "labels_ticks_and_vals", "(", ")", "for", "y", ",", "value", ",", "color", "in", "zip", "(", "y_vals", ",", "values", ",", "colors", ")", ":", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
VarHandler.r_hat
Get rhat data for the variable.
arviz/plots/forestplot.py
def r_hat(self): """Get rhat data for the variable.""" _, y_vals, values, colors = self.labels_ticks_and_vals() for y, value, color in zip(y_vals, values, colors): if value.ndim != 2 or value.shape[0] < 2: yield y, None, color else: yield y...
def r_hat(self): """Get rhat data for the variable.""" _, y_vals, values, colors = self.labels_ticks_and_vals() for y, value, color in zip(y_vals, values, colors): if value.ndim != 2 or value.shape[0] < 2: yield y, None, color else: yield y...
[ "Get", "rhat", "data", "for", "the", "variable", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/forestplot.py#L569-L576
[ "def", "r_hat", "(", "self", ")", ":", "_", ",", "y_vals", ",", "values", ",", "colors", "=", "self", ".", "labels_ticks_and_vals", "(", ")", "for", "y", ",", "value", ",", "color", "in", "zip", "(", "y_vals", ",", "values", ",", "colors", ")", ":"...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
VarHandler.y_max
Get max y value for the variable.
arviz/plots/forestplot.py
def y_max(self): """Get max y value for the variable.""" end_y = max(y for y, *_ in self.iterator()) if self.combined: end_y += self.group_offset return end_y + 2 * self.group_offset
def y_max(self): """Get max y value for the variable.""" end_y = max(y for y, *_ in self.iterator()) if self.combined: end_y += self.group_offset return end_y + 2 * self.group_offset
[ "Get", "max", "y", "value", "for", "the", "variable", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/forestplot.py#L578-L585
[ "def", "y_max", "(", "self", ")", ":", "end_y", "=", "max", "(", "y", "for", "y", ",", "*", "_", "in", "self", ".", "iterator", "(", ")", ")", "if", "self", ".", "combined", ":", "end_y", "+=", "self", ".", "group_offset", "return", "end_y", "+",...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
plot_khat
Plot Pareto tail indices. Parameters ---------- khats : array Pareto tail indices. figsize : tuple Figure size. If None it will be defined automatically. textsize: float Text size scaling factor for labels, titles and lines. If None it will be autoscaled based on fig...
arviz/plots/khatplot.py
def plot_khat( khats, figsize=None, textsize=None, markersize=None, ax=None, hlines_kwargs=None, **kwargs ): """ Plot Pareto tail indices. Parameters ---------- khats : array Pareto tail indices. figsize : tuple Figure size. If None it will be defined automatically. text...
def plot_khat( khats, figsize=None, textsize=None, markersize=None, ax=None, hlines_kwargs=None, **kwargs ): """ Plot Pareto tail indices. Parameters ---------- khats : array Pareto tail indices. figsize : tuple Figure size. If None it will be defined automatically. text...
[ "Plot", "Pareto", "tail", "indices", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/khatplot.py#L8-L81
[ "def", "plot_khat", "(", "khats", ",", "figsize", "=", "None", ",", "textsize", "=", "None", ",", "markersize", "=", "None", ",", "ax", "=", "None", ",", "hlines_kwargs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "hlines_kwargs", "is", "N...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
plot_density
Generate KDE plots for continuous variables and histograms for discrete ones. Plots are truncated at their 100*(1-alpha)% credible intervals. Plots are grouped per variable and colors assigned to models. Parameters ---------- data : Union[Object, Iterator[Object]] Any object that can be co...
arviz/plots/densityplot.py
def plot_density( data, group="posterior", data_labels=None, var_names=None, credible_interval=0.94, point_estimate="mean", colors="cycle", outline=True, hpd_markers="", shade=0.0, bw=4.5, figsize=None, textsize=None, ): """Generate KDE plots for continuous variab...
def plot_density( data, group="posterior", data_labels=None, var_names=None, credible_interval=0.94, point_estimate="mean", colors="cycle", outline=True, hpd_markers="", shade=0.0, bw=4.5, figsize=None, textsize=None, ): """Generate KDE plots for continuous variab...
[ "Generate", "KDE", "plots", "for", "continuous", "variables", "and", "histograms", "for", "discrete", "ones", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/densityplot.py#L18-L212
[ "def", "plot_density", "(", "data", ",", "group", "=", "\"posterior\"", ",", "data_labels", "=", "None", ",", "var_names", "=", "None", ",", "credible_interval", "=", "0.94", ",", "point_estimate", "=", "\"mean\"", ",", "colors", "=", "\"cycle\"", ",", "outl...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
_d_helper
Plot an individual dimension. Parameters ---------- vec : array 1D array from trace vname : str variable name color : str matplotlib color bw : float Bandwidth scaling factor. Should be larger than 0. The higher this number the smoother the KDE will be. D...
arviz/plots/densityplot.py
def _d_helper( vec, vname, color, bw, titlesize, xt_labelsize, linewidth, markersize, credible_interval, point_estimate, hpd_markers, outline, shade, ax, ): """Plot an individual dimension. Parameters ---------- vec : array 1D array from t...
def _d_helper( vec, vname, color, bw, titlesize, xt_labelsize, linewidth, markersize, credible_interval, point_estimate, hpd_markers, outline, shade, ax, ): """Plot an individual dimension. Parameters ---------- vec : array 1D array from t...
[ "Plot", "an", "individual", "dimension", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/densityplot.py#L215-L306
[ "def", "_d_helper", "(", "vec", ",", "vname", ",", "color", ",", "bw", ",", "titlesize", ",", "xt_labelsize", ",", "linewidth", ",", "markersize", ",", "credible_interval", ",", "point_estimate", ",", "hpd_markers", ",", "outline", ",", "shade", ",", "ax", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
plot_kde
1D or 2D KDE plot taking into account boundary conditions. Parameters ---------- values : array-like Values to plot values2 : array-like, optional Values to plot. If present, a 2D KDE will be estimated cumulative : bool If true plot the estimated cumulative distribution func...
arviz/plots/kdeplot.py
def plot_kde( values, values2=None, cumulative=False, rug=False, label=None, bw=4.5, quantiles=None, rotated=False, contour=True, fill_last=True, textsize=None, plot_kwargs=None, fill_kwargs=None, rug_kwargs=None, contour_kwargs=None, contourf_kwargs=None,...
def plot_kde( values, values2=None, cumulative=False, rug=False, label=None, bw=4.5, quantiles=None, rotated=False, contour=True, fill_last=True, textsize=None, plot_kwargs=None, fill_kwargs=None, rug_kwargs=None, contour_kwargs=None, contourf_kwargs=None,...
[ "1D", "or", "2D", "KDE", "plot", "taking", "into", "account", "boundary", "conditions", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/kdeplot.py#L14-L261
[ "def", "plot_kde", "(", "values", ",", "values2", "=", "None", ",", "cumulative", "=", "False", ",", "rug", "=", "False", ",", "label", "=", "None", ",", "bw", "=", "4.5", ",", "quantiles", "=", "None", ",", "rotated", "=", "False", ",", "contour", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
_fast_kde
Fast Fourier transform-based Gaussian kernel density estimate (KDE). The code was adapted from https://github.com/mfouesneau/faststats Parameters ---------- x : Numpy array or list cumulative : bool If true, estimate the cdf instead of the pdf bw : float Bandwidth scaling facto...
arviz/plots/kdeplot.py
def _fast_kde(x, cumulative=False, bw=4.5, xmin=None, xmax=None): """Fast Fourier transform-based Gaussian kernel density estimate (KDE). The code was adapted from https://github.com/mfouesneau/faststats Parameters ---------- x : Numpy array or list cumulative : bool If true, estimate ...
def _fast_kde(x, cumulative=False, bw=4.5, xmin=None, xmax=None): """Fast Fourier transform-based Gaussian kernel density estimate (KDE). The code was adapted from https://github.com/mfouesneau/faststats Parameters ---------- x : Numpy array or list cumulative : bool If true, estimate ...
[ "Fast", "Fourier", "transform", "-", "based", "Gaussian", "kernel", "density", "estimate", "(", "KDE", ")", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/kdeplot.py#L264-L330
[ "def", "_fast_kde", "(", "x", ",", "cumulative", "=", "False", ",", "bw", "=", "4.5", ",", "xmin", "=", "None", ",", "xmax", "=", "None", ")", ":", "x", "=", "np", ".", "asarray", "(", "x", ",", "dtype", "=", "float", ")", "x", "=", "x", "[",...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
_fast_kde_2d
2D fft-based Gaussian kernel density estimate (KDE). The code was adapted from https://github.com/mfouesneau/faststats Parameters ---------- x : Numpy array or list y : Numpy array or list gridsize : tuple Number of points used to discretize data. Use powers of 2 for fft optimization ...
arviz/plots/kdeplot.py
def _fast_kde_2d(x, y, gridsize=(128, 128), circular=False): """ 2D fft-based Gaussian kernel density estimate (KDE). The code was adapted from https://github.com/mfouesneau/faststats Parameters ---------- x : Numpy array or list y : Numpy array or list gridsize : tuple Number ...
def _fast_kde_2d(x, y, gridsize=(128, 128), circular=False): """ 2D fft-based Gaussian kernel density estimate (KDE). The code was adapted from https://github.com/mfouesneau/faststats Parameters ---------- x : Numpy array or list y : Numpy array or list gridsize : tuple Number ...
[ "2D", "fft", "-", "based", "Gaussian", "kernel", "density", "estimate", "(", "KDE", ")", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/kdeplot.py#L339-L407
[ "def", "_fast_kde_2d", "(", "x", ",", "y", ",", "gridsize", "=", "(", "128", ",", "128", ")", ",", "circular", "=", "False", ")", ":", "x", "=", "np", ".", "asarray", "(", "x", ",", "dtype", "=", "float", ")", "x", "=", "x", "[", "np", ".", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
_var_names
Handle var_names input across arviz. Parameters ---------- var_names: str, list, or None data : xarray.Dataset Posterior data in an xarray Returns ------- var_name: list or None
arviz/utils.py
def _var_names(var_names, data): """Handle var_names input across arviz. Parameters ---------- var_names: str, list, or None data : xarray.Dataset Posterior data in an xarray Returns ------- var_name: list or None """ if var_names is not None: if isinstance(var_...
def _var_names(var_names, data): """Handle var_names input across arviz. Parameters ---------- var_names: str, list, or None data : xarray.Dataset Posterior data in an xarray Returns ------- var_name: list or None """ if var_names is not None: if isinstance(var_...
[ "Handle", "var_names", "input", "across", "arviz", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/utils.py#L6-L49
[ "def", "_var_names", "(", "var_names", ",", "data", ")", ":", "if", "var_names", "is", "not", "None", ":", "if", "isinstance", "(", "var_names", ",", "str", ")", ":", "var_names", "=", "[", "var_names", "]", "if", "isinstance", "(", "data", ",", "(", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
conditional_jit
Use numba's jit decorator if numba is installed. Notes ----- If called without arguments then return wrapped function. @conditional_jit def my_func(): return else called with arguments @conditional_jit(nopython=True) def my_func(): ret...
arviz/utils.py
def conditional_jit(function=None, **kwargs): # noqa: D202 """Use numba's jit decorator if numba is installed. Notes ----- If called without arguments then return wrapped function. @conditional_jit def my_func(): return else called with arguments @co...
def conditional_jit(function=None, **kwargs): # noqa: D202 """Use numba's jit decorator if numba is installed. Notes ----- If called without arguments then return wrapped function. @conditional_jit def my_func(): return else called with arguments @co...
[ "Use", "numba", "s", "jit", "decorator", "if", "numba", "is", "installed", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/utils.py#L52-L82
[ "def", "conditional_jit", "(", "function", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# noqa: D202", "def", "wrapper", "(", "function", ")", ":", "try", ":", "numba", "=", "importlib", ".", "import_module", "(", "\"numba\"", ")", "return", "numba", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
plot_pair
Plot a scatter or hexbin matrix of the sampled parameters. Parameters ---------- data : obj Any object that can be converted to an az.InferenceData object Refer to documentation of az.convert_to_dataset for details var_names : list of variable names Variables to be plotted, if N...
arviz/plots/pairplot.py
def plot_pair( data, var_names=None, coords=None, figsize=None, textsize=None, kind="scatter", gridsize="auto", contour=True, fill_last=True, divergences=False, colorbar=False, ax=None, divergences_kwargs=None, plot_kwargs=None, ): """ Plot a scatter or he...
def plot_pair( data, var_names=None, coords=None, figsize=None, textsize=None, kind="scatter", gridsize="auto", contour=True, fill_last=True, divergences=False, colorbar=False, ax=None, divergences_kwargs=None, plot_kwargs=None, ): """ Plot a scatter or he...
[ "Plot", "a", "scatter", "or", "hexbin", "matrix", "of", "the", "sampled", "parameters", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/pairplot.py#L14-L268
[ "def", "plot_pair", "(", "data", ",", "var_names", "=", "None", ",", "coords", "=", "None", ",", "figsize", "=", "None", ",", "textsize", "=", "None", ",", "kind", "=", "\"scatter\"", ",", "gridsize", "=", "\"auto\"", ",", "contour", "=", "True", ",", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
ExampleGenerator.extract_docstring
Extract a module-level docstring
doc/sphinxext/gallery_generator.py
def extract_docstring(self): """ Extract a module-level docstring """ lines = open(self.filename).readlines() start_row = 0 if lines[0].startswith('#!'): lines.pop(0) start_row = 1 docstring = '' first_par = '' line_iter = lines.__...
def extract_docstring(self): """ Extract a module-level docstring """ lines = open(self.filename).readlines() start_row = 0 if lines[0].startswith('#!'): lines.pop(0) start_row = 1 docstring = '' first_par = '' line_iter = lines.__...
[ "Extract", "a", "module", "-", "level", "docstring" ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/doc/sphinxext/gallery_generator.py#L234-L275
[ "def", "extract_docstring", "(", "self", ")", ":", "lines", "=", "open", "(", "self", ".", "filename", ")", ".", "readlines", "(", ")", "start_row", "=", "0", "if", "lines", "[", "0", "]", ".", "startswith", "(", "'#!'", ")", ":", "lines", ".", "po...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
plot_dist
Plot distribution as histogram or kernel density estimates. By default continuous variables are plotted using KDEs and discrete ones using histograms Parameters ---------- values : array-like Values to plot values2 : array-like, optional Values to plot. If present, a 2D KDE or a he...
arviz/plots/distplot.py
def plot_dist( values, values2=None, color="C0", kind="auto", cumulative=False, label=None, rotated=False, rug=False, bw=4.5, quantiles=None, contour=True, fill_last=True, textsize=None, plot_kwargs=None, fill_kwargs=None, rug_kwargs=None, contour_kwar...
def plot_dist( values, values2=None, color="C0", kind="auto", cumulative=False, label=None, rotated=False, rug=False, bw=4.5, quantiles=None, contour=True, fill_last=True, textsize=None, plot_kwargs=None, fill_kwargs=None, rug_kwargs=None, contour_kwar...
[ "Plot", "distribution", "as", "histogram", "or", "kernel", "density", "estimates", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/distplot.py#L8-L137
[ "def", "plot_dist", "(", "values", ",", "values2", "=", "None", ",", "color", "=", "\"C0\"", ",", "kind", "=", "\"auto\"", ",", "cumulative", "=", "False", ",", "label", "=", "None", ",", "rotated", "=", "False", ",", "rug", "=", "False", ",", "bw", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
_histplot_op
Add a histogram for the data to the axes.
arviz/plots/distplot.py
def _histplot_op(values, values2, rotated, ax, hist_kwargs): """Add a histogram for the data to the axes.""" if values2 is not None: raise NotImplementedError("Insert hexbin plot here") bins = hist_kwargs.pop("bins") if bins is None: bins = get_bins(values) ax.hist(values, bins=bins...
def _histplot_op(values, values2, rotated, ax, hist_kwargs): """Add a histogram for the data to the axes.""" if values2 is not None: raise NotImplementedError("Insert hexbin plot here") bins = hist_kwargs.pop("bins") if bins is None: bins = get_bins(values) ax.hist(values, bins=bins...
[ "Add", "a", "histogram", "for", "the", "data", "to", "the", "axes", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/distplot.py#L140-L155
[ "def", "_histplot_op", "(", "values", ",", "values2", ",", "rotated", ",", "ax", ",", "hist_kwargs", ")", ":", "if", "values2", "is", "not", "None", ":", "raise", "NotImplementedError", "(", "\"Insert hexbin plot here\"", ")", "bins", "=", "hist_kwargs", ".", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
plot_ppc
Plot for posterior predictive checks. Parameters ---------- data : az.InferenceData object InferenceData object containing the observed and posterior predictive data. kind : str Type of plot to display (density, cumulative, or scatter). Defaults to density. alpha : float ...
arviz/plots/ppcplot.py
def plot_ppc( data, kind="density", alpha=None, mean=True, figsize=None, textsize=None, data_pairs=None, var_names=None, coords=None, flatten=None, flatten_pp=None, num_pp_samples=None, random_seed=None, jitter=None, animated=False, animation_kwargs=None, ...
def plot_ppc( data, kind="density", alpha=None, mean=True, figsize=None, textsize=None, data_pairs=None, var_names=None, coords=None, flatten=None, flatten_pp=None, num_pp_samples=None, random_seed=None, jitter=None, animated=False, animation_kwargs=None, ...
[ "Plot", "for", "posterior", "predictive", "checks", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/ppcplot.py#L20-L480
[ "def", "plot_ppc", "(", "data", ",", "kind", "=", "\"density\"", ",", "alpha", "=", "None", ",", "mean", "=", "True", ",", "figsize", "=", "None", ",", "textsize", "=", "None", ",", "data_pairs", "=", "None", ",", "var_names", "=", "None", ",", "coor...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
to_netcdf
Save dataset as a netcdf file. WARNING: Only idempotent in case `data` is InferenceData Parameters ---------- data : InferenceData, or any object accepted by `convert_to_inference_data` Object to be saved filename : str name or path of the file to load trace group : str (option...
arviz/data/io_netcdf.py
def to_netcdf(data, filename, *, group="posterior", coords=None, dims=None): """Save dataset as a netcdf file. WARNING: Only idempotent in case `data` is InferenceData Parameters ---------- data : InferenceData, or any object accepted by `convert_to_inference_data` Object to be saved f...
def to_netcdf(data, filename, *, group="posterior", coords=None, dims=None): """Save dataset as a netcdf file. WARNING: Only idempotent in case `data` is InferenceData Parameters ---------- data : InferenceData, or any object accepted by `convert_to_inference_data` Object to be saved f...
[ "Save", "dataset", "as", "a", "netcdf", "file", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/io_netcdf.py#L18-L43
[ "def", "to_netcdf", "(", "data", ",", "filename", ",", "*", ",", "group", "=", "\"posterior\"", ",", "coords", "=", "None", ",", "dims", "=", "None", ")", ":", "inference_data", "=", "convert_to_inference_data", "(", "data", ",", "group", "=", "group", "...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
save_data
Save dataset as a netcdf file. WARNING: Only idempotent in case `data` is InferenceData Parameters ---------- data : InferenceData, or any object accepted by `convert_to_inference_data` Object to be saved filename : str name or path of the file to load trace group : str (option...
arviz/data/io_netcdf.py
def save_data(data, filename, *, group="posterior", coords=None, dims=None): """Save dataset as a netcdf file. WARNING: Only idempotent in case `data` is InferenceData Parameters ---------- data : InferenceData, or any object accepted by `convert_to_inference_data` Object to be saved f...
def save_data(data, filename, *, group="posterior", coords=None, dims=None): """Save dataset as a netcdf file. WARNING: Only idempotent in case `data` is InferenceData Parameters ---------- data : InferenceData, or any object accepted by `convert_to_inference_data` Object to be saved f...
[ "Save", "dataset", "as", "a", "netcdf", "file", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/io_netcdf.py#L66-L98
[ "def", "save_data", "(", "data", ",", "filename", ",", "*", ",", "group", "=", "\"posterior\"", ",", "coords", "=", "None", ",", "dims", "=", "None", ")", ":", "warnings", ".", "warn", "(", "\"The 'save_data' function is deprecated as of 0.3.2, use 'to_netcdf' ins...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
make_2d
Convert any array into a 2d numpy array. In case the array is already more than 2 dimensional, will ravel the dimensions after the first.
arviz/plots/plot_utils.py
def make_2d(ary): """Convert any array into a 2d numpy array. In case the array is already more than 2 dimensional, will ravel the dimensions after the first. """ dim_0, *_ = np.atleast_1d(ary).shape return ary.reshape(dim_0, -1, order="F")
def make_2d(ary): """Convert any array into a 2d numpy array. In case the array is already more than 2 dimensional, will ravel the dimensions after the first. """ dim_0, *_ = np.atleast_1d(ary).shape return ary.reshape(dim_0, -1, order="F")
[ "Convert", "any", "array", "into", "a", "2d", "numpy", "array", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/plot_utils.py#L10-L17
[ "def", "make_2d", "(", "ary", ")", ":", "dim_0", ",", "", "*", "_", "=", "np", ".", "atleast_1d", "(", "ary", ")", ".", "shape", "return", "ary", ".", "reshape", "(", "dim_0", ",", "-", "1", ",", "order", "=", "\"F\"", ")" ]
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
_scale_fig_size
Scale figure properties according to rows and cols. Parameters ---------- figsize : float or None Size of figure in inches textsize : float or None fontsize rows : int Number of rows cols : int Number of columns Returns ------- figsize : float or Non...
arviz/plots/plot_utils.py
def _scale_fig_size(figsize, textsize, rows=1, cols=1): """Scale figure properties according to rows and cols. Parameters ---------- figsize : float or None Size of figure in inches textsize : float or None fontsize rows : int Number of rows cols : int Number...
def _scale_fig_size(figsize, textsize, rows=1, cols=1): """Scale figure properties according to rows and cols. Parameters ---------- figsize : float or None Size of figure in inches textsize : float or None fontsize rows : int Number of rows cols : int Number...
[ "Scale", "figure", "properties", "according", "to", "rows", "and", "cols", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/plot_utils.py#L20-L84
[ "def", "_scale_fig_size", "(", "figsize", ",", "textsize", ",", "rows", "=", "1", ",", "cols", "=", "1", ")", ":", "params", "=", "mpl", ".", "rcParams", "rc_width", ",", "rc_height", "=", "tuple", "(", "params", "[", "\"figure.figsize\"", "]", ")", "r...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
get_bins
Automatically compute the number of bins for discrete variables. Parameters ---------- values = numpy array values Returns ------- array with the bins Notes ----- Computes the width of the bins by taking the maximun of the Sturges and the Freedman-Diaconis estimators. ...
arviz/plots/plot_utils.py
def get_bins(values): """ Automatically compute the number of bins for discrete variables. Parameters ---------- values = numpy array values Returns ------- array with the bins Notes ----- Computes the width of the bins by taking the maximun of the Sturges and the ...
def get_bins(values): """ Automatically compute the number of bins for discrete variables. Parameters ---------- values = numpy array values Returns ------- array with the bins Notes ----- Computes the width of the bins by taking the maximun of the Sturges and the ...
[ "Automatically", "compute", "the", "number", "of", "bins", "for", "discrete", "variables", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/plot_utils.py#L87-L126
[ "def", "get_bins", "(", "values", ")", ":", "x_min", "=", "values", ".", "min", "(", ")", ".", "astype", "(", "int", ")", "x_max", "=", "values", ".", "max", "(", ")", ".", "astype", "(", "int", ")", "# Sturges histogram bin estimator", "bins_sturges", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
default_grid
Make a grid for subplots. Tries to get as close to sqrt(n_items) x sqrt(n_items) as it can, but allows for custom logic Parameters ---------- n_items : int Number of panels required max_cols : int Maximum number of columns, inclusive min_cols : int Minimum number of...
arviz/plots/plot_utils.py
def default_grid(n_items, max_cols=4, min_cols=3): # noqa: D202 """Make a grid for subplots. Tries to get as close to sqrt(n_items) x sqrt(n_items) as it can, but allows for custom logic Parameters ---------- n_items : int Number of panels required max_cols : int Maximum n...
def default_grid(n_items, max_cols=4, min_cols=3): # noqa: D202 """Make a grid for subplots. Tries to get as close to sqrt(n_items) x sqrt(n_items) as it can, but allows for custom logic Parameters ---------- n_items : int Number of panels required max_cols : int Maximum n...
[ "Make", "a", "grid", "for", "subplots", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/plot_utils.py#L129-L162
[ "def", "default_grid", "(", "n_items", ",", "max_cols", "=", "4", ",", "min_cols", "=", "3", ")", ":", "# noqa: D202", "def", "in_bounds", "(", "val", ")", ":", "return", "np", ".", "clip", "(", "val", ",", "min_cols", ",", "max_cols", ")", "if", "n_...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
_create_axes_grid
Create figure and axes for grids with multiple plots. Parameters ---------- n_items : int Number of panels required rows : int Number of rows cols : int Number of columns Returns ------- fig : matplotlib figure ax : matplotlib axes
arviz/plots/plot_utils.py
def _create_axes_grid(length_plotters, rows, cols, **kwargs): """Create figure and axes for grids with multiple plots. Parameters ---------- n_items : int Number of panels required rows : int Number of rows cols : int Number of columns Returns ------- fig : ...
def _create_axes_grid(length_plotters, rows, cols, **kwargs): """Create figure and axes for grids with multiple plots. Parameters ---------- n_items : int Number of panels required rows : int Number of rows cols : int Number of columns Returns ------- fig : ...
[ "Create", "figure", "and", "axes", "for", "grids", "with", "multiple", "plots", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/plot_utils.py#L165-L190
[ "def", "_create_axes_grid", "(", "length_plotters", ",", "rows", ",", "cols", ",", "*", "*", "kwargs", ")", ":", "kwargs", ".", "setdefault", "(", "\"constrained_layout\"", ",", "True", ")", "fig", ",", "ax", "=", "plt", ".", "subplots", "(", "rows", ","...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
make_label
Consistent labelling for plots. Parameters ---------- var_name : str Name of the variable selection : dict[Any] -> Any Coordinates of the variable position : whether to position the coordinates' label "below" (default) or "beside" the name of the variable Returns...
arviz/plots/plot_utils.py
def make_label(var_name, selection, position="below"): """Consistent labelling for plots. Parameters ---------- var_name : str Name of the variable selection : dict[Any] -> Any Coordinates of the variable position : whether to position the coordinates' label "below" (default) or...
def make_label(var_name, selection, position="below"): """Consistent labelling for plots. Parameters ---------- var_name : str Name of the variable selection : dict[Any] -> Any Coordinates of the variable position : whether to position the coordinates' label "below" (default) or...
[ "Consistent", "labelling", "for", "plots", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/plot_utils.py#L208-L234
[ "def", "make_label", "(", "var_name", ",", "selection", ",", "position", "=", "\"below\"", ")", ":", "if", "selection", ":", "sel", "=", "selection_to_string", "(", "selection", ")", "if", "position", "==", "\"below\"", ":", "sep", "=", "\"\\n\"", "elif", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
purge_duplicates
Remove duplicates from list while preserving order. Parameters ---------- list_in: Iterable Returns ------- list List of first occurences in order
arviz/plots/plot_utils.py
def purge_duplicates(list_in): """Remove duplicates from list while preserving order. Parameters ---------- list_in: Iterable Returns ------- list List of first occurences in order """ _list = [] for item in list_in: if item not in _list: _list.appen...
def purge_duplicates(list_in): """Remove duplicates from list while preserving order. Parameters ---------- list_in: Iterable Returns ------- list List of first occurences in order """ _list = [] for item in list_in: if item not in _list: _list.appen...
[ "Remove", "duplicates", "from", "list", "while", "preserving", "order", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/plot_utils.py#L237-L253
[ "def", "purge_duplicates", "(", "list_in", ")", ":", "_list", "=", "[", "]", "for", "item", "in", "list_in", ":", "if", "item", "not", "in", "_list", ":", "_list", ".", "append", "(", "item", ")", "return", "_list" ]
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
xarray_var_iter
Convert xarray data to an iterator over vectors. Iterates over each var_name and all of its coordinates, returning the 1d data. Parameters ---------- data : xarray.Dataset Posterior data in an xarray var_names : iterator of strings (optional) Should be a subset of data.data_va...
arviz/plots/plot_utils.py
def xarray_var_iter(data, var_names=None, combined=False, skip_dims=None, reverse_selections=False): """Convert xarray data to an iterator over vectors. Iterates over each var_name and all of its coordinates, returning the 1d data. Parameters ---------- data : xarray.Dataset Posterior ...
def xarray_var_iter(data, var_names=None, combined=False, skip_dims=None, reverse_selections=False): """Convert xarray data to an iterator over vectors. Iterates over each var_name and all of its coordinates, returning the 1d data. Parameters ---------- data : xarray.Dataset Posterior ...
[ "Convert", "xarray", "data", "to", "an", "iterator", "over", "vectors", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/plot_utils.py#L256-L309
[ "def", "xarray_var_iter", "(", "data", ",", "var_names", "=", "None", ",", "combined", "=", "False", ",", "skip_dims", "=", "None", ",", "reverse_selections", "=", "False", ")", ":", "if", "skip_dims", "is", "None", ":", "skip_dims", "=", "set", "(", ")"...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
xarray_to_ndarray
Take xarray data and unpacks into variables and data into list and numpy array respectively. Assumes that chain and draw are in coordinates Parameters ---------- data: xarray.DataSet Data in an xarray from an InferenceData object. Examples include posterior or sample_stats var_names: iter...
arviz/plots/plot_utils.py
def xarray_to_ndarray(data, *, var_names=None, combined=True): """Take xarray data and unpacks into variables and data into list and numpy array respectively. Assumes that chain and draw are in coordinates Parameters ---------- data: xarray.DataSet Data in an xarray from an InferenceData o...
def xarray_to_ndarray(data, *, var_names=None, combined=True): """Take xarray data and unpacks into variables and data into list and numpy array respectively. Assumes that chain and draw are in coordinates Parameters ---------- data: xarray.DataSet Data in an xarray from an InferenceData o...
[ "Take", "xarray", "data", "and", "unpacks", "into", "variables", "and", "data", "into", "list", "and", "numpy", "array", "respectively", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/plot_utils.py#L312-L344
[ "def", "xarray_to_ndarray", "(", "data", ",", "*", ",", "var_names", "=", "None", ",", "combined", "=", "True", ")", ":", "unpacked_data", ",", "unpacked_var_names", ",", "=", "[", "]", ",", "[", "]", "# Merge chains and variables", "for", "var_name", ",", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
get_coords
Subselects xarray dataset object to provided coords. Raises exception if fails. Raises ------ ValueError If coords name are not available in data KeyError If coords dims are not available in data Returns ------- data: xarray xarray.Dataset object
arviz/plots/plot_utils.py
def get_coords(data, coords): """Subselects xarray dataset object to provided coords. Raises exception if fails. Raises ------ ValueError If coords name are not available in data KeyError If coords dims are not available in data Returns ------- data: xarray xar...
def get_coords(data, coords): """Subselects xarray dataset object to provided coords. Raises exception if fails. Raises ------ ValueError If coords name are not available in data KeyError If coords dims are not available in data Returns ------- data: xarray xar...
[ "Subselects", "xarray", "dataset", "object", "to", "provided", "coords", ".", "Raises", "exception", "if", "fails", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/plot_utils.py#L347-L377
[ "def", "get_coords", "(", "data", ",", "coords", ")", ":", "try", ":", "return", "data", ".", "sel", "(", "*", "*", "coords", ")", "except", "ValueError", ":", "invalid_coords", "=", "set", "(", "coords", ".", "keys", "(", ")", ")", "-", "set", "("...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
convert_to_inference_data
r"""Convert a supported object to an InferenceData object. This function sends `obj` to the right conversion function. It is idempotent, in that it will return arviz.InferenceData objects unchanged. Parameters ---------- obj : dict, str, np.ndarray, xr.Dataset, pystan fit, pymc3 trace A su...
arviz/data/converters.py
def convert_to_inference_data(obj, *, group="posterior", coords=None, dims=None, **kwargs): r"""Convert a supported object to an InferenceData object. This function sends `obj` to the right conversion function. It is idempotent, in that it will return arviz.InferenceData objects unchanged. Parameters ...
def convert_to_inference_data(obj, *, group="posterior", coords=None, dims=None, **kwargs): r"""Convert a supported object to an InferenceData object. This function sends `obj` to the right conversion function. It is idempotent, in that it will return arviz.InferenceData objects unchanged. Parameters ...
[ "r", "Convert", "a", "supported", "object", "to", "an", "InferenceData", "object", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/converters.py#L14-L87
[ "def", "convert_to_inference_data", "(", "obj", ",", "*", ",", "group", "=", "\"posterior\"", ",", "coords", "=", "None", ",", "dims", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# Cases that convert to InferenceData", "if", "isinstance", "(", "obj", ",...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
convert_to_dataset
Convert a supported object to an xarray dataset. This function is idempotent, in that it will return xarray.Dataset functions unchanged. Raises `ValueError` if the desired group can not be extracted. Note this goes through a DataInference object. See `convert_to_inference_data` for more details. Raise...
arviz/data/converters.py
def convert_to_dataset(obj, *, group="posterior", coords=None, dims=None): """Convert a supported object to an xarray dataset. This function is idempotent, in that it will return xarray.Dataset functions unchanged. Raises `ValueError` if the desired group can not be extracted. Note this goes through a...
def convert_to_dataset(obj, *, group="posterior", coords=None, dims=None): """Convert a supported object to an xarray dataset. This function is idempotent, in that it will return xarray.Dataset functions unchanged. Raises `ValueError` if the desired group can not be extracted. Note this goes through a...
[ "Convert", "a", "supported", "object", "to", "an", "xarray", "dataset", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/converters.py#L90-L132
[ "def", "convert_to_dataset", "(", "obj", ",", "*", ",", "group", "=", "\"posterior\"", ",", "coords", "=", "None", ",", "dims", "=", "None", ")", ":", "inference_data", "=", "convert_to_inference_data", "(", "obj", ",", "group", "=", "group", ",", "coords"...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
_sturges_formula
Use Sturges' formula to determine number of bins. See https://en.wikipedia.org/wiki/Histogram#Sturges'_formula or https://doi.org/10.1080%2F01621459.1926.10502161 Parameters ---------- dataset: xarray.DataSet Must have the `draw` dimension mult: float Used to scale the number ...
arviz/plots/rankplot.py
def _sturges_formula(dataset, mult=1): """Use Sturges' formula to determine number of bins. See https://en.wikipedia.org/wiki/Histogram#Sturges'_formula or https://doi.org/10.1080%2F01621459.1926.10502161 Parameters ---------- dataset: xarray.DataSet Must have the `draw` dimension ...
def _sturges_formula(dataset, mult=1): """Use Sturges' formula to determine number of bins. See https://en.wikipedia.org/wiki/Histogram#Sturges'_formula or https://doi.org/10.1080%2F01621459.1926.10502161 Parameters ---------- dataset: xarray.DataSet Must have the `draw` dimension ...
[ "Use", "Sturges", "formula", "to", "determine", "number", "of", "bins", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/rankplot.py#L16-L35
[ "def", "_sturges_formula", "(", "dataset", ",", "mult", "=", "1", ")", ":", "return", "int", "(", "np", ".", "ceil", "(", "mult", "*", "np", ".", "log2", "(", "dataset", ".", "draw", ".", "size", ")", ")", "+", "1", ")" ]
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
plot_rank
Plot rank order statistics of chains. From the paper: Rank plots are histograms of the ranked posterior draws (ranked over all chains) plotted separately for each chain. If all of the chains are targeting the same posterior, we expect the ranks in each chain to be uniform, whereas if one chain has a ...
arviz/plots/rankplot.py
def plot_rank(data, var_names=None, coords=None, bins=None, ref_line=True, figsize=None, axes=None): """Plot rank order statistics of chains. From the paper: Rank plots are histograms of the ranked posterior draws (ranked over all chains) plotted separately for each chain. If all of the chains are targ...
def plot_rank(data, var_names=None, coords=None, bins=None, ref_line=True, figsize=None, axes=None): """Plot rank order statistics of chains. From the paper: Rank plots are histograms of the ranked posterior draws (ranked over all chains) plotted separately for each chain. If all of the chains are targ...
[ "Plot", "rank", "order", "statistics", "of", "chains", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/plots/rankplot.py#L38-L155
[ "def", "plot_rank", "(", "data", ",", "var_names", "=", "None", ",", "coords", "=", "None", ",", "bins", "=", "None", ",", "ref_line", "=", "True", ",", "figsize", "=", "None", ",", "axes", "=", "None", ")", ":", "posterior_data", "=", "convert_to_data...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
CreateAdsWithCustomizations
Creates ExpandedTextAds that use ad customizations for specified AdGroups. Args: client: an AdWordsClient instance. adgroup_ids: a list containing the AdGroup ids to add ExpandedTextAds to. feed_name: the name of the feed used to apply customizations. Raises: GoogleAdsError: if no ExpandedTextAds ...
examples/adwords/v201809/advanced_operations/add_ad_customizer.py
def CreateAdsWithCustomizations(client, adgroup_ids, feed_name): """Creates ExpandedTextAds that use ad customizations for specified AdGroups. Args: client: an AdWordsClient instance. adgroup_ids: a list containing the AdGroup ids to add ExpandedTextAds to. feed_name: the name of the feed used to apply...
def CreateAdsWithCustomizations(client, adgroup_ids, feed_name): """Creates ExpandedTextAds that use ad customizations for specified AdGroups. Args: client: an AdWordsClient instance. adgroup_ids: a list containing the AdGroup ids to add ExpandedTextAds to. feed_name: the name of the feed used to apply...
[ "Creates", "ExpandedTextAds", "that", "use", "ad", "customizations", "for", "specified", "AdGroups", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/v201809/advanced_operations/add_ad_customizer.py#L40-L79
[ "def", "CreateAdsWithCustomizations", "(", "client", ",", "adgroup_ids", ",", "feed_name", ")", ":", "# Get the AdGroupAdService", "adgroup_ad_service", "=", "client", ".", "GetService", "(", "'AdGroupAdService'", ",", "'v201809'", ")", "expanded_text_ad", "=", "{", "...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
CreateCustomizerFeed
Creates a new AdCustomizerFeed. Args: client: an AdWordsClient instance. feed_name: the name for the new AdCustomizerFeed. Returns: The new AdCustomizerFeed.
examples/adwords/v201809/advanced_operations/add_ad_customizer.py
def CreateCustomizerFeed(client, feed_name): """Creates a new AdCustomizerFeed. Args: client: an AdWordsClient instance. feed_name: the name for the new AdCustomizerFeed. Returns: The new AdCustomizerFeed. """ # Get the AdCustomizerFeedService ad_customizer_feed_service = client.GetService('Ad...
def CreateCustomizerFeed(client, feed_name): """Creates a new AdCustomizerFeed. Args: client: an AdWordsClient instance. feed_name: the name for the new AdCustomizerFeed. Returns: The new AdCustomizerFeed. """ # Get the AdCustomizerFeedService ad_customizer_feed_service = client.GetService('Ad...
[ "Creates", "a", "new", "AdCustomizerFeed", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/v201809/advanced_operations/add_ad_customizer.py#L82-L125
[ "def", "CreateCustomizerFeed", "(", "client", ",", "feed_name", ")", ":", "# Get the AdCustomizerFeedService", "ad_customizer_feed_service", "=", "client", ".", "GetService", "(", "'AdCustomizerFeedService'", ",", "'v201809'", ")", "customizer_feed", "=", "{", "'feedName'...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
RestrictFeedItemToAdGroup
Restricts the feed item to an ad group. Args: client: an AdWordsClient instance. feed_item: The feed item. adgroup_id: The ad group ID.
examples/adwords/v201809/advanced_operations/add_ad_customizer.py
def RestrictFeedItemToAdGroup(client, feed_item, adgroup_id): """Restricts the feed item to an ad group. Args: client: an AdWordsClient instance. feed_item: The feed item. adgroup_id: The ad group ID. """ # Get the FeedItemTargetService feed_item_target_service = client.GetService( 'FeedIte...
def RestrictFeedItemToAdGroup(client, feed_item, adgroup_id): """Restricts the feed item to an ad group. Args: client: an AdWordsClient instance. feed_item: The feed item. adgroup_id: The ad group ID. """ # Get the FeedItemTargetService feed_item_target_service = client.GetService( 'FeedIte...
[ "Restricts", "the", "feed", "item", "to", "an", "ad", "group", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/v201809/advanced_operations/add_ad_customizer.py#L128-L158
[ "def", "RestrictFeedItemToAdGroup", "(", "client", ",", "feed_item", ",", "adgroup_id", ")", ":", "# Get the FeedItemTargetService", "feed_item_target_service", "=", "client", ".", "GetService", "(", "'FeedItemTargetService'", ",", "'v201809'", ")", "# Optional: Restrict th...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
CreateCustomizerFeedItems
Creates FeedItems for the specified AdGroups. These FeedItems contain values to use in ad customizations for the AdGroups. Args: client: an AdWordsClient instance. adgroup_ids: a list containing two AdGroup Ids. ad_customizer_feed: the AdCustomizerFeed we're associating the FeedItems with. ...
examples/adwords/v201809/advanced_operations/add_ad_customizer.py
def CreateCustomizerFeedItems(client, adgroup_ids, ad_customizer_feed): """Creates FeedItems for the specified AdGroups. These FeedItems contain values to use in ad customizations for the AdGroups. Args: client: an AdWordsClient instance. adgroup_ids: a list containing two AdGroup Ids. ad_customizer...
def CreateCustomizerFeedItems(client, adgroup_ids, ad_customizer_feed): """Creates FeedItems for the specified AdGroups. These FeedItems contain values to use in ad customizations for the AdGroups. Args: client: an AdWordsClient instance. adgroup_ids: a list containing two AdGroup Ids. ad_customizer...
[ "Creates", "FeedItems", "for", "the", "specified", "AdGroups", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/v201809/advanced_operations/add_ad_customizer.py#L161-L200
[ "def", "CreateCustomizerFeedItems", "(", "client", ",", "adgroup_ids", ",", "ad_customizer_feed", ")", ":", "# Get the FeedItemService", "feed_item_service", "=", "client", ".", "GetService", "(", "'FeedItemService'", ",", "'v201809'", ")", "now", "=", "datetime", "."...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
CreateFeedItemAddOperation
Creates a FeedItemOperation. The generated FeedItemOperation will create a FeedItem with the specified values when sent to FeedItemService.mutate. Args: name: the value for the name attribute of the FeedItem. price: the value for the price attribute of the FeedItem. date: the value for the date attr...
examples/adwords/v201809/advanced_operations/add_ad_customizer.py
def CreateFeedItemAddOperation(name, price, date, ad_customizer_feed): """Creates a FeedItemOperation. The generated FeedItemOperation will create a FeedItem with the specified values when sent to FeedItemService.mutate. Args: name: the value for the name attribute of the FeedItem. price: the value fo...
def CreateFeedItemAddOperation(name, price, date, ad_customizer_feed): """Creates a FeedItemOperation. The generated FeedItemOperation will create a FeedItem with the specified values when sent to FeedItemService.mutate. Args: name: the value for the name attribute of the FeedItem. price: the value fo...
[ "Creates", "a", "FeedItemOperation", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/v201809/advanced_operations/add_ad_customizer.py#L203-L242
[ "def", "CreateFeedItemAddOperation", "(", "name", ",", "price", ",", "date", ",", "ad_customizer_feed", ")", ":", "feed_item", "=", "{", "'feedId'", ":", "ad_customizer_feed", "[", "'feedId'", "]", ",", "'attributeValues'", ":", "[", "{", "'feedAttributeId'", ":...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
AdWordsClient.LoadFromString
Creates an AdWordsClient with information stored in a yaml string. Args: yaml_doc: The yaml string containing the cached AdWords data. Returns: An AdWordsClient initialized with the values cached in the string. Raises: A GoogleAdsValueError if the given yaml string does not contain the ...
googleads/adwords.py
def LoadFromString(cls, yaml_doc): """Creates an AdWordsClient with information stored in a yaml string. Args: yaml_doc: The yaml string containing the cached AdWords data. Returns: An AdWordsClient initialized with the values cached in the string. Raises: A GoogleAdsValueError if t...
def LoadFromString(cls, yaml_doc): """Creates an AdWordsClient with information stored in a yaml string. Args: yaml_doc: The yaml string containing the cached AdWords data. Returns: An AdWordsClient initialized with the values cached in the string. Raises: A GoogleAdsValueError if t...
[ "Creates", "an", "AdWordsClient", "with", "information", "stored", "in", "a", "yaml", "string", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L153-L169
[ "def", "LoadFromString", "(", "cls", ",", "yaml_doc", ")", ":", "return", "cls", "(", "*", "*", "googleads", ".", "common", ".", "LoadFromString", "(", "yaml_doc", ",", "cls", ".", "_YAML_KEY", ",", "cls", ".", "_REQUIRED_INIT_VALUES", ",", "cls", ".", "...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
AdWordsClient.LoadFromStorage
Creates an AdWordsClient with information stored in a yaml file. Args: [optional] path: The path string to the file containing cached AdWords data. Returns: An AdWordsClient initialized with the values cached in the file. Raises: A GoogleAdsValueError if the given yaml file does n...
googleads/adwords.py
def LoadFromStorage(cls, path=None): """Creates an AdWordsClient with information stored in a yaml file. Args: [optional] path: The path string to the file containing cached AdWords data. Returns: An AdWordsClient initialized with the values cached in the file. Raises: A Googl...
def LoadFromStorage(cls, path=None): """Creates an AdWordsClient with information stored in a yaml file. Args: [optional] path: The path string to the file containing cached AdWords data. Returns: An AdWordsClient initialized with the values cached in the file. Raises: A Googl...
[ "Creates", "an", "AdWordsClient", "with", "information", "stored", "in", "a", "yaml", "file", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L172-L192
[ "def", "LoadFromStorage", "(", "cls", ",", "path", "=", "None", ")", ":", "if", "path", "is", "None", ":", "path", "=", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "expanduser", "(", "'~'", ")", ",", "'googleads.yaml'", ")", "retur...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
AdWordsClient.GetService
Creates a service client for the given service. Args: service_name: A string identifying which AdWords service to create a service client for. [optional] version: A string identifying the AdWords version to connect to. This defaults to what is currently the latest version. Thi...
googleads/adwords.py
def GetService(self, service_name, version=None, server=None): """Creates a service client for the given service. Args: service_name: A string identifying which AdWords service to create a service client for. [optional] version: A string identifying the AdWords version to connect to...
def GetService(self, service_name, version=None, server=None): """Creates a service client for the given service. Args: service_name: A string identifying which AdWords service to create a service client for. [optional] version: A string identifying the AdWords version to connect to...
[ "Creates", "a", "service", "client", "for", "the", "given", "service", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L273-L322
[ "def", "GetService", "(", "self", ",", "service_name", ",", "version", "=", "None", ",", "server", "=", "None", ")", ":", "if", "not", "server", ":", "server", "=", "_DEFAULT_ENDPOINT", "server", "=", "server", ".", "rstrip", "(", "'/'", ")", "if", "no...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
AdWordsClient.GetBatchJobHelper
Returns a BatchJobHelper to work with the BatchJobService. This is a convenience method. It is functionally identical to calling BatchJobHelper(adwords_client, version). Args: [optional] version: A string identifying the AdWords version to connect to. This defaults to what is cur...
googleads/adwords.py
def GetBatchJobHelper(self, version=sorted(_SERVICE_MAP.keys())[-1], server=None): """Returns a BatchJobHelper to work with the BatchJobService. This is a convenience method. It is functionally identical to calling BatchJobHelper(adwords_client, version). Args: [optio...
def GetBatchJobHelper(self, version=sorted(_SERVICE_MAP.keys())[-1], server=None): """Returns a BatchJobHelper to work with the BatchJobService. This is a convenience method. It is functionally identical to calling BatchJobHelper(adwords_client, version). Args: [optio...
[ "Returns", "a", "BatchJobHelper", "to", "work", "with", "the", "BatchJobService", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L324-L348
[ "def", "GetBatchJobHelper", "(", "self", ",", "version", "=", "sorted", "(", "_SERVICE_MAP", ".", "keys", "(", ")", ")", "[", "-", "1", "]", ",", "server", "=", "None", ")", ":", "if", "not", "server", ":", "server", "=", "_DEFAULT_ENDPOINT", "request_...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
AdWordsClient.GetReportDownloader
Creates a downloader for AdWords reports. This is a convenience method. It is functionally identical to calling ReportDownloader(adwords_client, version, server). Args: [optional] version: A string identifying the AdWords version to connect to. This defaults to what is currently the ...
googleads/adwords.py
def GetReportDownloader(self, version=sorted(_SERVICE_MAP.keys())[-1], server=None): """Creates a downloader for AdWords reports. This is a convenience method. It is functionally identical to calling ReportDownloader(adwords_client, version, server). Args: [optional] ...
def GetReportDownloader(self, version=sorted(_SERVICE_MAP.keys())[-1], server=None): """Creates a downloader for AdWords reports. This is a convenience method. It is functionally identical to calling ReportDownloader(adwords_client, version, server). Args: [optional] ...
[ "Creates", "a", "downloader", "for", "AdWords", "reports", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L350-L370
[ "def", "GetReportDownloader", "(", "self", ",", "version", "=", "sorted", "(", "_SERVICE_MAP", ".", "keys", "(", ")", ")", "[", "-", "1", "]", ",", "server", "=", "None", ")", ":", "if", "not", "server", ":", "server", "=", "_DEFAULT_ENDPOINT", "return...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_AdWordsHeaderHandler.GetSOAPHeaders
Returns the SOAP headers required for request authorization. Args: create_method: The SOAP library specific method used to instantiate SOAP objects. Returns: A SOAP object containing the headers.
googleads/adwords.py
def GetSOAPHeaders(self, create_method): """Returns the SOAP headers required for request authorization. Args: create_method: The SOAP library specific method used to instantiate SOAP objects. Returns: A SOAP object containing the headers. """ header = create_method(self._SOAP_HE...
def GetSOAPHeaders(self, create_method): """Returns the SOAP headers required for request authorization. Args: create_method: The SOAP library specific method used to instantiate SOAP objects. Returns: A SOAP object containing the headers. """ header = create_method(self._SOAP_HE...
[ "Returns", "the", "SOAP", "headers", "required", "for", "request", "authorization", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L414-L432
[ "def", "GetSOAPHeaders", "(", "self", ",", "create_method", ")", ":", "header", "=", "create_method", "(", "self", ".", "_SOAP_HEADER_CLASS", "%", "self", ".", "_version", ")", "header", ".", "clientCustomerId", "=", "self", ".", "_adwords_client", ".", "clien...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_AdWordsHeaderHandler.GetHTTPHeaders
Returns the HTTP headers required for request authorization. Returns: A dictionary containing the required headers.
googleads/adwords.py
def GetHTTPHeaders(self): """Returns the HTTP headers required for request authorization. Returns: A dictionary containing the required headers. """ http_headers = self._adwords_client.oauth2_client.CreateHttpHeader() if self.enable_compression: http_headers['accept-encoding'] = 'gzip' ...
def GetHTTPHeaders(self): """Returns the HTTP headers required for request authorization. Returns: A dictionary containing the required headers. """ http_headers = self._adwords_client.oauth2_client.CreateHttpHeader() if self.enable_compression: http_headers['accept-encoding'] = 'gzip' ...
[ "Returns", "the", "HTTP", "headers", "required", "for", "request", "authorization", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L434-L446
[ "def", "GetHTTPHeaders", "(", "self", ")", ":", "http_headers", "=", "self", ".", "_adwords_client", ".", "oauth2_client", ".", "CreateHttpHeader", "(", ")", "if", "self", ".", "enable_compression", ":", "http_headers", "[", "'accept-encoding'", "]", "=", "'gzip...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_AdWordsHeaderHandler.GetReportDownloadHeaders
Returns a dictionary of headers for a report download request. Note that the given keyword arguments will override any settings configured from the googleads.yaml file. Args: **kwargs: Optional keyword arguments. Keyword Arguments: client_customer_id: A string containing a client_customer...
googleads/adwords.py
def GetReportDownloadHeaders(self, **kwargs): """Returns a dictionary of headers for a report download request. Note that the given keyword arguments will override any settings configured from the googleads.yaml file. Args: **kwargs: Optional keyword arguments. Keyword Arguments: clie...
def GetReportDownloadHeaders(self, **kwargs): """Returns a dictionary of headers for a report download request. Note that the given keyword arguments will override any settings configured from the googleads.yaml file. Args: **kwargs: Optional keyword arguments. Keyword Arguments: clie...
[ "Returns", "a", "dictionary", "of", "headers", "for", "a", "report", "download", "request", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L448-L505
[ "def", "GetReportDownloadHeaders", "(", "self", ",", "*", "*", "kwargs", ")", ":", "headers", "=", "self", ".", "_adwords_client", ".", "oauth2_client", ".", "CreateHttpHeader", "(", ")", "headers", ".", "update", "(", "{", "'Content-type'", ":", "self", "."...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_AdWordsPacker.Pack
Pack the given object using AdWords-specific logic. Args: obj: an object to be packed for SOAP using AdWords-specific logic, if applicable. version: the version of the current API, e.g. 'v201809' Returns: The given object packed with AdWords-specific logic for SOAP, if applic...
googleads/adwords.py
def Pack(cls, obj, version): """Pack the given object using AdWords-specific logic. Args: obj: an object to be packed for SOAP using AdWords-specific logic, if applicable. version: the version of the current API, e.g. 'v201809' Returns: The given object packed with AdWords-spec...
def Pack(cls, obj, version): """Pack the given object using AdWords-specific logic. Args: obj: an object to be packed for SOAP using AdWords-specific logic, if applicable. version: the version of the current API, e.g. 'v201809' Returns: The given object packed with AdWords-spec...
[ "Pack", "the", "given", "object", "using", "AdWords", "-", "specific", "logic", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L512-L526
[ "def", "Pack", "(", "cls", ",", "obj", ",", "version", ")", ":", "if", "isinstance", "(", "obj", ",", "ServiceQuery", ")", ":", "return", "str", "(", "obj", ")", "return", "obj" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
IncrementalUploadHelper.Load
Loads an IncrementalUploadHelper from the given file-like object. Args: file_input: a file-like object containing a serialized IncrementalUploadHelper. client: an AdWordsClient instance. If not specified, an AdWordsClient will be instantiated using the default configuration file. R...
googleads/adwords.py
def Load(cls, file_input, client=None): """Loads an IncrementalUploadHelper from the given file-like object. Args: file_input: a file-like object containing a serialized IncrementalUploadHelper. client: an AdWordsClient instance. If not specified, an AdWordsClient will be instantiat...
def Load(cls, file_input, client=None): """Loads an IncrementalUploadHelper from the given file-like object. Args: file_input: a file-like object containing a serialized IncrementalUploadHelper. client: an AdWordsClient instance. If not specified, an AdWordsClient will be instantiat...
[ "Loads", "an", "IncrementalUploadHelper", "from", "the", "given", "file", "-", "like", "object", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L969-L1008
[ "def", "Load", "(", "cls", ",", "file_input", ",", "client", "=", "None", ")", ":", "if", "client", "is", "None", ":", "client", "=", "AdWordsClient", ".", "LoadFromStorage", "(", ")", "try", ":", "data", "=", "yaml", ".", "safe_load", "(", "file_input...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
IncrementalUploadHelper._InitializeURL
Ensures that the URL used to upload operations is properly initialized. Args: upload_url: a string url. current_content_length: an integer identifying the current content length of data uploaded to the Batch Job. Returns: An initialized string URL, or the provided string URL if the U...
googleads/adwords.py
def _InitializeURL(self, upload_url, current_content_length): """Ensures that the URL used to upload operations is properly initialized. Args: upload_url: a string url. current_content_length: an integer identifying the current content length of data uploaded to the Batch Job. Returns:...
def _InitializeURL(self, upload_url, current_content_length): """Ensures that the URL used to upload operations is properly initialized. Args: upload_url: a string url. current_content_length: an integer identifying the current content length of data uploaded to the Batch Job. Returns:...
[ "Ensures", "that", "the", "URL", "used", "to", "upload", "operations", "is", "properly", "initialized", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1037-L1063
[ "def", "_InitializeURL", "(", "self", ",", "upload_url", ",", "current_content_length", ")", ":", "# If initialization is not necessary, return the provided upload_url.", "if", "current_content_length", "!=", "0", ":", "return", "upload_url", "headers", "=", "{", "'Content-...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
IncrementalUploadHelper.Dump
Serialize the IncrementalUploadHelper and store in file-like object. Args: output: a file-like object where the status of the IncrementalUploadHelper will be written. Raises: GoogleAdsError: If a YAMLError occurs while writing to the file.
googleads/adwords.py
def Dump(self, output): """Serialize the IncrementalUploadHelper and store in file-like object. Args: output: a file-like object where the status of the IncrementalUploadHelper will be written. Raises: GoogleAdsError: If a YAMLError occurs while writing to the file. """ data = ...
def Dump(self, output): """Serialize the IncrementalUploadHelper and store in file-like object. Args: output: a file-like object where the status of the IncrementalUploadHelper will be written. Raises: GoogleAdsError: If a YAMLError occurs while writing to the file. """ data = ...
[ "Serialize", "the", "IncrementalUploadHelper", "and", "store", "in", "file", "-", "like", "object", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1065-L1087
[ "def", "Dump", "(", "self", ",", "output", ")", ":", "data", "=", "{", "'current_content_length'", ":", "self", ".", "_current_content_length", ",", "'is_last'", ":", "self", ".", "_is_last", ",", "'server'", ":", "self", ".", "_request_builder", ".", "GetSe...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
IncrementalUploadHelper.UploadOperations
Uploads operations to the given uploadUrl in incremental steps. Note: Each list of operations is expected to contain operations of the same type, similar to how one would normally send operations in an AdWords API Service request. Args: operations: one or more lists of operations as would be sen...
googleads/adwords.py
def UploadOperations(self, operations, is_last=False): """Uploads operations to the given uploadUrl in incremental steps. Note: Each list of operations is expected to contain operations of the same type, similar to how one would normally send operations in an AdWords API Service request. Args: ...
def UploadOperations(self, operations, is_last=False): """Uploads operations to the given uploadUrl in incremental steps. Note: Each list of operations is expected to contain operations of the same type, similar to how one would normally send operations in an AdWords API Service request. Args: ...
[ "Uploads", "operations", "to", "the", "given", "uploadUrl", "in", "incremental", "steps", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1089-L1129
[ "def", "UploadOperations", "(", "self", ",", "operations", ",", "is_last", "=", "False", ")", ":", "if", "self", ".", "_is_last", ":", "raise", "googleads", ".", "errors", ".", "AdWordsBatchJobServiceInvalidOperationError", "(", "'Can\\'t add new operations to a compl...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
IncrementalUploadHelper._ExtractRequestSummaryFields
Extract fields used in the summary logs. Args: request: a urllib2.Request instance configured to make the request. [optional] error: a urllib2.HttpError instance used to retrieve error details. Returns: A dict containing the fields to be output in the summary logs.
googleads/adwords.py
def _ExtractRequestSummaryFields(self, request, error=None): """Extract fields used in the summary logs. Args: request: a urllib2.Request instance configured to make the request. [optional] error: a urllib2.HttpError instance used to retrieve error details. Returns: A dict contain...
def _ExtractRequestSummaryFields(self, request, error=None): """Extract fields used in the summary logs. Args: request: a urllib2.Request instance configured to make the request. [optional] error: a urllib2.HttpError instance used to retrieve error details. Returns: A dict contain...
[ "Extract", "fields", "used", "in", "the", "summary", "logs", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1131-L1155
[ "def", "_ExtractRequestSummaryFields", "(", "self", ",", "request", ",", "error", "=", "None", ")", ":", "headers", "=", "request", ".", "headers", "summary_fields", "=", "{", "'server'", ":", "request", ".", "get_full_url", "(", ")", ",", "'contentRange'", ...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_QueryBuilder.Where
Creates a WHERE builder using a provided field. Args: field: the field to be added as an argument in the WHERE clause. Returns: The created WHERE builder.
googleads/adwords.py
def Where(self, field): """Creates a WHERE builder using a provided field. Args: field: the field to be added as an argument in the WHERE clause. Returns: The created WHERE builder. """ where_builder = _WhereBuilder(self, field) self.where_builders.append(where_builder) return ...
def Where(self, field): """Creates a WHERE builder using a provided field. Args: field: the field to be added as an argument in the WHERE clause. Returns: The created WHERE builder. """ where_builder = _WhereBuilder(self, field) self.where_builders.append(where_builder) return ...
[ "Creates", "a", "WHERE", "builder", "using", "a", "provided", "field", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1822-L1833
[ "def", "Where", "(", "self", ",", "field", ")", ":", "where_builder", "=", "_WhereBuilder", "(", "self", ",", "field", ")", "self", ".", "where_builders", ".", "append", "(", "where_builder", ")", "return", "where_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.EqualTo
Sets the type of the WHERE clause as "equal to". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def EqualTo(self, value): """Sets the type of the WHERE clause as "equal to". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, '=') return self._query_buil...
def EqualTo(self, value): """Sets the type of the WHERE clause as "equal to". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, '=') return self._query_buil...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "equal", "to", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1856-L1866
[ "def", "EqualTo", "(", "self", ",", "value", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateSingleValueCondition", "(", "value", ",", "'='", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.NotEqualTo
Sets the type of the WHERE clause as "not equal to". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def NotEqualTo(self, value): """Sets the type of the WHERE clause as "not equal to". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, '!=') return self._qu...
def NotEqualTo(self, value): """Sets the type of the WHERE clause as "not equal to". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, '!=') return self._qu...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "not", "equal", "to", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1868-L1878
[ "def", "NotEqualTo", "(", "self", ",", "value", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateSingleValueCondition", "(", "value", ",", "'!='", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.GreaterThan
Sets the type of the WHERE clause as "greater than". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def GreaterThan(self, value): """Sets the type of the WHERE clause as "greater than". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, '>') return self._qu...
def GreaterThan(self, value): """Sets the type of the WHERE clause as "greater than". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, '>') return self._qu...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "greater", "than", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1880-L1890
[ "def", "GreaterThan", "(", "self", ",", "value", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateSingleValueCondition", "(", "value", ",", "'>'", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.GreaterThanOrEqualTo
Sets the type of the WHERE clause as "greater than or equal to". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def GreaterThanOrEqualTo(self, value): """Sets the type of the WHERE clause as "greater than or equal to". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, '>=...
def GreaterThanOrEqualTo(self, value): """Sets the type of the WHERE clause as "greater than or equal to". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, '>=...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "greater", "than", "or", "equal", "to", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1892-L1902
[ "def", "GreaterThanOrEqualTo", "(", "self", ",", "value", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateSingleValueCondition", "(", "value", ",", "'>='", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.LessThan
Sets the type of the WHERE clause as "less than". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def LessThan(self, value): """Sets the type of the WHERE clause as "less than". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, '<') return self._query_bu...
def LessThan(self, value): """Sets the type of the WHERE clause as "less than". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, '<') return self._query_bu...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "less", "than", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1904-L1914
[ "def", "LessThan", "(", "self", ",", "value", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateSingleValueCondition", "(", "value", ",", "'<'", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.LessThanOrEqualTo
Sets the type of the WHERE clause as "less than or equal to. Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def LessThanOrEqualTo(self, value): """Sets the type of the WHERE clause as "less than or equal to. Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, '<=') ...
def LessThanOrEqualTo(self, value): """Sets the type of the WHERE clause as "less than or equal to. Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, '<=') ...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "less", "than", "or", "equal", "to", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1916-L1926
[ "def", "LessThanOrEqualTo", "(", "self", ",", "value", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateSingleValueCondition", "(", "value", ",", "'<='", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.StartsWith
Sets the type of the WHERE clause as "starts with". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def StartsWith(self, value): """Sets the type of the WHERE clause as "starts with". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, 'STARTS_WITH') return ...
def StartsWith(self, value): """Sets the type of the WHERE clause as "starts with". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, 'STARTS_WITH') return ...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "starts", "with", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1928-L1938
[ "def", "StartsWith", "(", "self", ",", "value", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateSingleValueCondition", "(", "value", ",", "'STARTS_WITH'", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.StartsWithIgnoreCase
Sets the type of the WHERE clause as "starts with ignore case". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def StartsWithIgnoreCase(self, value): """Sets the type of the WHERE clause as "starts with ignore case". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, ...
def StartsWithIgnoreCase(self, value): """Sets the type of the WHERE clause as "starts with ignore case". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, ...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "starts", "with", "ignore", "case", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1940-L1951
[ "def", "StartsWithIgnoreCase", "(", "self", ",", "value", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateSingleValueCondition", "(", "value", ",", "'STARTS_WITH_IGNORE_CASE'", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.Contains
Sets the type of the WHERE clause as "contains". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def Contains(self, value): """Sets the type of the WHERE clause as "contains". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, 'CONTAINS') return self._qu...
def Contains(self, value): """Sets the type of the WHERE clause as "contains". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, 'CONTAINS') return self._qu...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "contains", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1953-L1963
[ "def", "Contains", "(", "self", ",", "value", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateSingleValueCondition", "(", "value", ",", "'CONTAINS'", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.ContainsIgnoreCase
Sets the type of the WHERE clause as "contains ignore case". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def ContainsIgnoreCase(self, value): """Sets the type of the WHERE clause as "contains ignore case". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, 'CONTAINS...
def ContainsIgnoreCase(self, value): """Sets the type of the WHERE clause as "contains ignore case". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, 'CONTAINS...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "contains", "ignore", "case", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1965-L1975
[ "def", "ContainsIgnoreCase", "(", "self", ",", "value", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateSingleValueCondition", "(", "value", ",", "'CONTAINS_IGNORE_CASE'", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.DoesNotContain
Sets the type of the WHERE clause as "does not contain". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def DoesNotContain(self, value): """Sets the type of the WHERE clause as "does not contain". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, 'DOES_NOT_CONTAIN...
def DoesNotContain(self, value): """Sets the type of the WHERE clause as "does not contain". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition(value, 'DOES_NOT_CONTAIN...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "does", "not", "contain", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1977-L1987
[ "def", "DoesNotContain", "(", "self", ",", "value", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateSingleValueCondition", "(", "value", ",", "'DOES_NOT_CONTAIN'", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.DoesNotContainIgnoreCase
Sets the type of the WHERE clause as "doesn not contain ignore case". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def DoesNotContainIgnoreCase(self, value): """Sets the type of the WHERE clause as "doesn not contain ignore case". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition( ...
def DoesNotContainIgnoreCase(self, value): """Sets the type of the WHERE clause as "doesn not contain ignore case". Args: value: The value to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateSingleValueCondition( ...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "doesn", "not", "contain", "ignore", "case", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L1989-L2000
[ "def", "DoesNotContainIgnoreCase", "(", "self", ",", "value", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateSingleValueCondition", "(", "value", ",", "'DOES_NOT_CONTAIN_IGNORE_CASE'", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.In
Sets the type of the WHERE clause as "in". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def In(self, *values): """Sets the type of the WHERE clause as "in". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateMultipleValuesCondition(values, 'IN') return self._query_build...
def In(self, *values): """Sets the type of the WHERE clause as "in". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateMultipleValuesCondition(values, 'IN') return self._query_build...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "in", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L2002-L2012
[ "def", "In", "(", "self", ",", "*", "values", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateMultipleValuesCondition", "(", "values", ",", "'IN'", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.NotIn
Sets the type of the WHERE clause as "in". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def NotIn(self, *values): """Sets the type of the WHERE clause as "in". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateMultipleValuesCondition(values, 'NOT_IN') return self._quer...
def NotIn(self, *values): """Sets the type of the WHERE clause as "in". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateMultipleValuesCondition(values, 'NOT_IN') return self._quer...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "in", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L2014-L2024
[ "def", "NotIn", "(", "self", ",", "*", "values", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateMultipleValuesCondition", "(", "values", ",", "'NOT_IN'", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.ContainsAny
Sets the type of the WHERE clause as "contains any". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def ContainsAny(self, *values): """Sets the type of the WHERE clause as "contains any". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateMultipleValuesCondition(values, 'CONTAINS_ANY')...
def ContainsAny(self, *values): """Sets the type of the WHERE clause as "contains any". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateMultipleValuesCondition(values, 'CONTAINS_ANY')...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "contains", "any", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L2026-L2036
[ "def", "ContainsAny", "(", "self", ",", "*", "values", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateMultipleValuesCondition", "(", "values", ",", "'CONTAINS_ANY'", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.ContainsNone
Sets the type of the WHERE clause as "contains none". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def ContainsNone(self, *values): """Sets the type of the WHERE clause as "contains none". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateMultipleValuesCondition(values, 'CONTAINS_NON...
def ContainsNone(self, *values): """Sets the type of the WHERE clause as "contains none". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateMultipleValuesCondition(values, 'CONTAINS_NON...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "contains", "none", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L2038-L2048
[ "def", "ContainsNone", "(", "self", ",", "*", "values", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateMultipleValuesCondition", "(", "values", ",", "'CONTAINS_NONE'", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder.ContainsAll
Sets the type of the WHERE clause as "contains all". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to.
googleads/adwords.py
def ContainsAll(self, *values): """Sets the type of the WHERE clause as "contains all". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateMultipleValuesCondition(values, 'CONTAINS_ALL')...
def ContainsAll(self, *values): """Sets the type of the WHERE clause as "contains all". Args: *values: The values to be used in the WHERE condition. Returns: The query builder that this WHERE builder links to. """ self._awql = self._CreateMultipleValuesCondition(values, 'CONTAINS_ALL')...
[ "Sets", "the", "type", "of", "the", "WHERE", "clause", "as", "contains", "all", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L2050-L2060
[ "def", "ContainsAll", "(", "self", ",", "*", "values", ")", ":", "self", ".", "_awql", "=", "self", ".", "_CreateMultipleValuesCondition", "(", "values", ",", "'CONTAINS_ALL'", ")", "return", "self", ".", "_query_builder" ]
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder._CreateSingleValueCondition
Creates a single-value condition with the provided value and operator.
googleads/adwords.py
def _CreateSingleValueCondition(self, value, operator): """Creates a single-value condition with the provided value and operator.""" if isinstance(value, str) or isinstance(value, unicode): value = '"%s"' % value return '%s %s %s' % (self._field, operator, value)
def _CreateSingleValueCondition(self, value, operator): """Creates a single-value condition with the provided value and operator.""" if isinstance(value, str) or isinstance(value, unicode): value = '"%s"' % value return '%s %s %s' % (self._field, operator, value)
[ "Creates", "a", "single", "-", "value", "condition", "with", "the", "provided", "value", "and", "operator", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L2070-L2074
[ "def", "_CreateSingleValueCondition", "(", "self", ",", "value", ",", "operator", ")", ":", "if", "isinstance", "(", "value", ",", "str", ")", "or", "isinstance", "(", "value", ",", "unicode", ")", ":", "value", "=", "'\"%s\"'", "%", "value", "return", "...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_WhereBuilder._CreateMultipleValuesCondition
Creates a condition with the provided list of values and operator.
googleads/adwords.py
def _CreateMultipleValuesCondition(self, values, operator): """Creates a condition with the provided list of values and operator.""" values = ['"%s"' % value if isinstance(value, str) or isinstance(value, unicode) else str(value) for value in values] return '%s %s [%s]' % (self._field, operato...
def _CreateMultipleValuesCondition(self, values, operator): """Creates a condition with the provided list of values and operator.""" values = ['"%s"' % value if isinstance(value, str) or isinstance(value, unicode) else str(value) for value in values] return '%s %s [%s]' % (self._field, operato...
[ "Creates", "a", "condition", "with", "the", "provided", "list", "of", "values", "and", "operator", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L2076-L2080
[ "def", "_CreateMultipleValuesCondition", "(", "self", ",", "values", ",", "operator", ")", ":", "values", "=", "[", "'\"%s\"'", "%", "value", "if", "isinstance", "(", "value", ",", "str", ")", "or", "isinstance", "(", "value", ",", "unicode", ")", "else", ...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
ServiceQuery.NextPage
Sets the LIMIT clause of the AWQL to the next page. This method is meant to be used with HasNext(). When using DataService, page is needed, as its paging mechanism is different from other services. For details, see https://developers.google.com/adwords/api/docs/guides/bid-landscapes#paging_through_resu...
googleads/adwords.py
def NextPage(self, page=None): """Sets the LIMIT clause of the AWQL to the next page. This method is meant to be used with HasNext(). When using DataService, page is needed, as its paging mechanism is different from other services. For details, see https://developers.google.com/adwords/api/docs/gui...
def NextPage(self, page=None): """Sets the LIMIT clause of the AWQL to the next page. This method is meant to be used with HasNext(). When using DataService, page is needed, as its paging mechanism is different from other services. For details, see https://developers.google.com/adwords/api/docs/gui...
[ "Sets", "the", "LIMIT", "clause", "of", "the", "AWQL", "to", "the", "next", "page", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L2416-L2451
[ "def", "NextPage", "(", "self", ",", "page", "=", "None", ")", ":", "if", "self", ".", "_start_index", "is", "None", ":", "raise", "ValueError", "(", "'Cannot page through query with no LIMIT clause.'", ")", "# DataService has a different paging mechanism, resulting in di...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
ServiceQuery.HasNext
Checks if there is still a page left to query. This method is meant to be used with NextPage(). When using DataService, the paging mechanism is different from other services. For details, see https://developers.google.com/adwords/api/docs/guides/bid-landscapes#paging_through_results. Args: page:...
googleads/adwords.py
def HasNext(self, page): """Checks if there is still a page left to query. This method is meant to be used with NextPage(). When using DataService, the paging mechanism is different from other services. For details, see https://developers.google.com/adwords/api/docs/guides/bid-landscapes#paging_through...
def HasNext(self, page): """Checks if there is still a page left to query. This method is meant to be used with NextPage(). When using DataService, the paging mechanism is different from other services. For details, see https://developers.google.com/adwords/api/docs/guides/bid-landscapes#paging_through...
[ "Checks", "if", "there", "is", "still", "a", "page", "left", "to", "query", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L2453-L2491
[ "def", "HasNext", "(", "self", ",", "page", ")", ":", "if", "self", ".", "_start_index", "is", "None", ":", "raise", "ValueError", "(", "'Cannot page through query with no LIMIT clause.'", ")", "if", "page", "is", "None", ":", "raise", "ValueError", "(", "'The...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
ServiceQuery.Pager
A page generator for this service query and the provided service. This generates a page as a result from using the provided service's query() method until there are no more results to fetch. Args: service: The service object for making a query using this service query. Yields: A resulting...
googleads/adwords.py
def Pager(self, service): """A page generator for this service query and the provided service. This generates a page as a result from using the provided service's query() method until there are no more results to fetch. Args: service: The service object for making a query using this service quer...
def Pager(self, service): """A page generator for this service query and the provided service. This generates a page as a result from using the provided service's query() method until there are no more results to fetch. Args: service: The service object for making a query using this service quer...
[ "A", "page", "generator", "for", "this", "service", "query", "and", "the", "provided", "service", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/adwords.py#L2493-L2511
[ "def", "Pager", "(", "self", ",", "service", ")", ":", "has_page", "=", "True", "while", "has_page", ":", "page", "=", "service", ".", "query", "(", "self", ")", "yield", "page", "has_page", "=", "self", ".", "HasNext", "(", "page", ")", "if", "has_p...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
InitUser
Initialize application user. Retrieve existing user credentials from datastore or add new user. Returns: AppUser instance of the application user.
examples/adwords/adwords_appengine_demo/handlers/ndb_handler.py
def InitUser(): """Initialize application user. Retrieve existing user credentials from datastore or add new user. Returns: AppUser instance of the application user. """ result = AppUser.query(AppUser.user == users.get_current_user()).fetch() if result: app_user = result[0] else: app_user =...
def InitUser(): """Initialize application user. Retrieve existing user credentials from datastore or add new user. Returns: AppUser instance of the application user. """ result = AppUser.query(AppUser.user == users.get_current_user()).fetch() if result: app_user = result[0] else: app_user =...
[ "Initialize", "application", "user", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/adwords_appengine_demo/handlers/ndb_handler.py#L25-L42
[ "def", "InitUser", "(", ")", ":", "result", "=", "AppUser", ".", "query", "(", "AppUser", ".", "user", "==", "users", ".", "get_current_user", "(", ")", ")", ".", "fetch", "(", ")", "if", "result", ":", "app_user", "=", "result", "[", "0", "]", "el...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
UpdateUserCredentials
Update the credentials associated with application user. Args: client_id: str Client Id retrieved from the developer's console. client_secret: str Client Secret retrieved from the developer's console. refresh_token: str Refresh token generated with the above client id/secret. adwords_manager_cid: str...
examples/adwords/adwords_appengine_demo/handlers/ndb_handler.py
def UpdateUserCredentials(client_id, client_secret, refresh_token, adwords_manager_cid, developer_token): """Update the credentials associated with application user. Args: client_id: str Client Id retrieved from the developer's console. client_secret: str Client Secret retrieved f...
def UpdateUserCredentials(client_id, client_secret, refresh_token, adwords_manager_cid, developer_token): """Update the credentials associated with application user. Args: client_id: str Client Id retrieved from the developer's console. client_secret: str Client Secret retrieved f...
[ "Update", "the", "credentials", "associated", "with", "application", "user", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/adwords_appengine_demo/handlers/ndb_handler.py#L45-L64
[ "def", "UpdateUserCredentials", "(", "client_id", ",", "client_secret", ",", "refresh_token", ",", "adwords_manager_cid", ",", "developer_token", ")", ":", "app_user", "=", "AppUser", ".", "query", "(", "AppUser", ".", "user", "==", "users", ".", "get_current_user...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
CreateDefaultPartition
Creates a default partition. Args: client: an AdWordsClient instance. ad_group_id: an integer ID for an ad group.
examples/adwords/v201809/shopping/add_shopping_campaign.py
def CreateDefaultPartition(client, ad_group_id): """Creates a default partition. Args: client: an AdWordsClient instance. ad_group_id: an integer ID for an ad group. """ ad_group_criterion_service = client.GetService('AdGroupCriterionService', version='v...
def CreateDefaultPartition(client, ad_group_id): """Creates a default partition. Args: client: an AdWordsClient instance. ad_group_id: an integer ID for an ad group. """ ad_group_criterion_service = client.GetService('AdGroupCriterionService', version='v...
[ "Creates", "a", "default", "partition", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/v201809/shopping/add_shopping_campaign.py#L128-L165
[ "def", "CreateDefaultPartition", "(", "client", ",", "ad_group_id", ")", ":", "ad_group_criterion_service", "=", "client", ".", "GetService", "(", "'AdGroupCriterionService'", ",", "version", "=", "'v201809'", ")", "operations", "=", "[", "{", "'operator'", ":", "...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
ConvertValueForCsv
Sanitizes a field value from a Value object to a CSV suitable format. Args: pql_value: dict a dictionary containing the data for a single field of an entity. Returns: str a CSV writer friendly value formatted by Value.Type.
examples/ad_manager/v201811/publisher_query_language_service/get_recent_changes.py
def ConvertValueForCsv(pql_value): """Sanitizes a field value from a Value object to a CSV suitable format. Args: pql_value: dict a dictionary containing the data for a single field of an entity. Returns: str a CSV writer friendly value formatted by Value.Type. """ if 'value' in pql...
def ConvertValueForCsv(pql_value): """Sanitizes a field value from a Value object to a CSV suitable format. Args: pql_value: dict a dictionary containing the data for a single field of an entity. Returns: str a CSV writer friendly value formatted by Value.Type. """ if 'value' in pql...
[ "Sanitizes", "a", "field", "value", "from", "a", "Value", "object", "to", "a", "CSV", "suitable", "format", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/ad_manager/v201811/publisher_query_language_service/get_recent_changes.py#L86-L123
[ "def", "ConvertValueForCsv", "(", "pql_value", ")", ":", "if", "'value'", "in", "pql_value", ":", "field", "=", "pql_value", "[", "'value'", "]", "elif", "'values'", "in", "pql_value", ":", "field", "=", "pql_value", "[", "'values'", "]", "else", ":", "fie...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
ConvertDateTimeToOffset
Converts the PQL formatted response for a dateTime object. Output conforms to ISO 8061 format, e.g. 'YYYY-MM-DDTHH:MM:SSz.' Args: date_time_value: dict The date time value from the PQL response. Returns: str: A string representation of the date time value uniform to ReportService.
examples/ad_manager/v201811/publisher_query_language_service/get_recent_changes.py
def ConvertDateTimeToOffset(date_time_value): """Converts the PQL formatted response for a dateTime object. Output conforms to ISO 8061 format, e.g. 'YYYY-MM-DDTHH:MM:SSz.' Args: date_time_value: dict The date time value from the PQL response. Returns: str: A string representation of the date time va...
def ConvertDateTimeToOffset(date_time_value): """Converts the PQL formatted response for a dateTime object. Output conforms to ISO 8061 format, e.g. 'YYYY-MM-DDTHH:MM:SSz.' Args: date_time_value: dict The date time value from the PQL response. Returns: str: A string representation of the date time va...
[ "Converts", "the", "PQL", "formatted", "response", "for", "a", "dateTime", "object", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/ad_manager/v201811/publisher_query_language_service/get_recent_changes.py#L126-L150
[ "def", "ConvertDateTimeToOffset", "(", "date_time_value", ")", ":", "date_time_obj", "=", "datetime", "(", "int", "(", "date_time_value", "[", "'date'", "]", "[", "'year'", "]", ")", ",", "int", "(", "date_time_value", "[", "'date'", "]", "[", "'month'", "]"...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_CreateUserIdentifier
Creates a user identifier from the specified type and value. Args: identifier_type: a str specifying the type of user identifier. value: a str value of the identifier; to be hashed using SHA-256 if needed. Returns: A dict specifying a user identifier, with a value hashed using SHA-256 if needed.
examples/adwords/v201809/remarketing/upload_offline_data.py
def _CreateUserIdentifier(identifier_type=None, value=None): """Creates a user identifier from the specified type and value. Args: identifier_type: a str specifying the type of user identifier. value: a str value of the identifier; to be hashed using SHA-256 if needed. Returns: A dict specifying a u...
def _CreateUserIdentifier(identifier_type=None, value=None): """Creates a user identifier from the specified type and value. Args: identifier_type: a str specifying the type of user identifier. value: a str value of the identifier; to be hashed using SHA-256 if needed. Returns: A dict specifying a u...
[ "Creates", "a", "user", "identifier", "from", "the", "specified", "type", "and", "value", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/v201809/remarketing/upload_offline_data.py#L192-L213
[ "def", "_CreateUserIdentifier", "(", "identifier_type", "=", "None", ",", "value", "=", "None", ")", ":", "if", "identifier_type", "in", "_HASHED_IDENTIFIER_TYPES", ":", "# If the user identifier type is a hashed type, normalize and hash the", "# value.", "value", "=", "has...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
_GetFieldPathElementIndex
Retrieve the index of a given field in the api_error's fieldPathElements. Args: api_error: a dict containing a partialFailureError returned from the AdWords API. field: a str field for which this determines the index in the api_error's fieldPathElements. Returns: An int index of the field ...
examples/adwords/v201809/remarketing/upload_offline_data.py
def _GetFieldPathElementIndex(api_error, field): """Retrieve the index of a given field in the api_error's fieldPathElements. Args: api_error: a dict containing a partialFailureError returned from the AdWords API. field: a str field for which this determines the index in the api_error's fieldPa...
def _GetFieldPathElementIndex(api_error, field): """Retrieve the index of a given field in the api_error's fieldPathElements. Args: api_error: a dict containing a partialFailureError returned from the AdWords API. field: a str field for which this determines the index in the api_error's fieldPa...
[ "Retrieve", "the", "index", "of", "a", "given", "field", "in", "the", "api_error", "s", "fieldPathElements", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/v201809/remarketing/upload_offline_data.py#L216-L238
[ "def", "_GetFieldPathElementIndex", "(", "api_error", ",", "field", ")", ":", "field_path_elements", "=", "api_error", "[", "'fieldPathElements'", "]", "if", "field_path_elements", ":", "found_index", "=", "[", "field_path_element", "[", "'index'", "]", "for", "fiel...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
ShowBudget.post
Handle post request.
examples/adwords/adwords_appengine_demo/views/show_budget_view.py
def post(self): """Handle post request.""" client_customer_id = self.request.get('clientCustomerId') budget_id = self.request.get('budgetId') if not client_customer_id or not budget_id: self.redirect('/') else: self.redirect('/showBudget?clientCustomerId=%s&budgetId=%s' ...
def post(self): """Handle post request.""" client_customer_id = self.request.get('clientCustomerId') budget_id = self.request.get('budgetId') if not client_customer_id or not budget_id: self.redirect('/') else: self.redirect('/showBudget?clientCustomerId=%s&budgetId=%s' ...
[ "Handle", "post", "request", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/adwords_appengine_demo/views/show_budget_view.py#L68-L76
[ "def", "post", "(", "self", ")", ":", "client_customer_id", "=", "self", ".", "request", ".", "get", "(", "'clientCustomerId'", ")", "budget_id", "=", "self", ".", "request", ".", "get", "(", "'budgetId'", ")", "if", "not", "client_customer_id", "or", "not...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
PatchHelper._ApplySudsJurkoAppenderPatch
Appends a Monkey Patch to the suds.mx.appender module. This resolves an issue where empty objects are ignored and stripped from the request output. More details can be found on the suds-jurko issue tracker: https://goo.gl/uyYw0C
googleads/util.py
def _ApplySudsJurkoAppenderPatch(self): """Appends a Monkey Patch to the suds.mx.appender module. This resolves an issue where empty objects are ignored and stripped from the request output. More details can be found on the suds-jurko issue tracker: https://goo.gl/uyYw0C """ def PatchedAppend(s...
def _ApplySudsJurkoAppenderPatch(self): """Appends a Monkey Patch to the suds.mx.appender module. This resolves an issue where empty objects are ignored and stripped from the request output. More details can be found on the suds-jurko issue tracker: https://goo.gl/uyYw0C """ def PatchedAppend(s...
[ "Appends", "a", "Monkey", "Patch", "to", "the", "suds", ".", "mx", ".", "appender", "module", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/util.py#L84-L99
[ "def", "_ApplySudsJurkoAppenderPatch", "(", "self", ")", ":", "def", "PatchedAppend", "(", "self", ",", "parent", ",", "content", ")", ":", "obj", "=", "content", ".", "value", "child", "=", "self", ".", "node", "(", "content", ")", "parent", ".", "appen...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
PatchHelper._ApplySudsJurkoSendPatch
Appends a Monkey Patch to the suds.transport.http module. This allows the suds library to decompress the SOAP body when compression is enabled. For more details on SOAP Compression, see: https://developers.google.com/adwords/api/docs/guides/bestpractices?hl=en#use_compression
googleads/util.py
def _ApplySudsJurkoSendPatch(self): """Appends a Monkey Patch to the suds.transport.http module. This allows the suds library to decompress the SOAP body when compression is enabled. For more details on SOAP Compression, see: https://developers.google.com/adwords/api/docs/guides/bestpractices?hl=en#use...
def _ApplySudsJurkoSendPatch(self): """Appends a Monkey Patch to the suds.transport.http module. This allows the suds library to decompress the SOAP body when compression is enabled. For more details on SOAP Compression, see: https://developers.google.com/adwords/api/docs/guides/bestpractices?hl=en#use...
[ "Appends", "a", "Monkey", "Patch", "to", "the", "suds", ".", "transport", ".", "http", "module", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/util.py#L101-L153
[ "def", "_ApplySudsJurkoSendPatch", "(", "self", ")", ":", "def", "GetInflateStream", "(", "msg", ")", ":", "stream", "=", "io", ".", "BytesIO", "(", ")", "stream", ".", "write", "(", "msg", ")", "stream", ".", "flush", "(", ")", "stream", ".", "seek", ...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
ZeepLogger.ingress
Overrides the ingress function for response logging. Args: envelope: An Element with the SOAP request data. http_headers: A dict of the current http headers. operation: The SoapOperation instance. Returns: A tuple of the envelope and headers.
googleads/util.py
def ingress(self, envelope, http_headers, operation): """Overrides the ingress function for response logging. Args: envelope: An Element with the SOAP request data. http_headers: A dict of the current http headers. operation: The SoapOperation instance. Returns: A tuple of the enve...
def ingress(self, envelope, http_headers, operation): """Overrides the ingress function for response logging. Args: envelope: An Element with the SOAP request data. http_headers: A dict of the current http headers. operation: The SoapOperation instance. Returns: A tuple of the enve...
[ "Overrides", "the", "ingress", "function", "for", "response", "logging", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/util.py#L329-L365
[ "def", "ingress", "(", "self", ",", "envelope", ",", "http_headers", ",", "operation", ")", ":", "if", "self", ".", "_logger", ".", "isEnabledFor", "(", "logging", ".", "DEBUG", ")", ":", "self", ".", "_logger", ".", "debug", "(", "_RESPONSE_XML_LOG_LINE",...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
ZeepLogger.egress
Overrides the egress function ror request logging. Args: envelope: An Element with the SOAP request data. http_headers: A dict of the current http headers. operation: The SoapOperation instance. binding_options: An options dict for the SOAP binding. Returns: A tuple of the envelo...
googleads/util.py
def egress(self, envelope, http_headers, operation, binding_options): """Overrides the egress function ror request logging. Args: envelope: An Element with the SOAP request data. http_headers: A dict of the current http headers. operation: The SoapOperation instance. binding_options: An...
def egress(self, envelope, http_headers, operation, binding_options): """Overrides the egress function ror request logging. Args: envelope: An Element with the SOAP request data. http_headers: A dict of the current http headers. operation: The SoapOperation instance. binding_options: An...
[ "Overrides", "the", "egress", "function", "ror", "request", "logging", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/googleads/util.py#L367-L395
[ "def", "egress", "(", "self", ",", "envelope", ",", "http_headers", ",", "operation", ",", "binding_options", ")", ":", "if", "self", ".", "_logger", ".", "isEnabledFor", "(", "logging", ".", "INFO", ")", ":", "service_name", "=", "operation", ".", "bindin...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
RestrictFeedItemToGeoTarget
Restrict a feed item to a geo target location. Args: client: An AdWordsClient instance. feed_item: A FeedItem. location_id: The Id of the location to restrict to.
examples/adwords/v201809/extensions/add_site_links_using_feeds.py
def RestrictFeedItemToGeoTarget(client, feed_item, location_id): """Restrict a feed item to a geo target location. Args: client: An AdWordsClient instance. feed_item: A FeedItem. location_id: The Id of the location to restrict to. """ # Retrieve the FeedItemTargetService feed_item_target_service ...
def RestrictFeedItemToGeoTarget(client, feed_item, location_id): """Restrict a feed item to a geo target location. Args: client: An AdWordsClient instance. feed_item: A FeedItem. location_id: The Id of the location to restrict to. """ # Retrieve the FeedItemTargetService feed_item_target_service ...
[ "Restrict", "a", "feed", "item", "to", "a", "geo", "target", "location", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/v201809/extensions/add_site_links_using_feeds.py#L49-L83
[ "def", "RestrictFeedItemToGeoTarget", "(", "client", ",", "feed_item", ",", "location_id", ")", ":", "# Retrieve the FeedItemTargetService", "feed_item_target_service", "=", "client", ".", "GetService", "(", "'FeedItemTargetService'", ",", "version", "=", "'v201809'", ")"...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
CreateSmartCampaign
Adds a new Smart Shopping campaign. Args: client: an AdWordsClient instance. budget_id: the str ID of the budget to be associated with the Shopping campaign. merchant_id: the str ID of the merchant account to be associated with the Shopping campaign. Returns: A campaign ID.
examples/adwords/v201809/shopping/add_smart_shopping_ad.py
def CreateSmartCampaign(client, budget_id, merchant_id): """Adds a new Smart Shopping campaign. Args: client: an AdWordsClient instance. budget_id: the str ID of the budget to be associated with the Shopping campaign. merchant_id: the str ID of the merchant account to be associated with the ...
def CreateSmartCampaign(client, budget_id, merchant_id): """Adds a new Smart Shopping campaign. Args: client: an AdWordsClient instance. budget_id: the str ID of the budget to be associated with the Shopping campaign. merchant_id: the str ID of the merchant account to be associated with the ...
[ "Adds", "a", "new", "Smart", "Shopping", "campaign", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/v201809/shopping/add_smart_shopping_ad.py#L80-L129
[ "def", "CreateSmartCampaign", "(", "client", ",", "budget_id", ",", "merchant_id", ")", ":", "campaign_service", "=", "client", ".", "GetService", "(", "'CampaignService'", ",", "version", "=", "'v201809'", ")", "# Create campaign with required and optional settings.", ...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
CreateSmartShoppingAdGroup
Adds a new Smart Shopping ad group. Args: client: an AdWordsClient instance. campaign_id: the str ID of a Smart Shopping campaign. Returns: An ad group ID.
examples/adwords/v201809/shopping/add_smart_shopping_ad.py
def CreateSmartShoppingAdGroup(client, campaign_id): """Adds a new Smart Shopping ad group. Args: client: an AdWordsClient instance. campaign_id: the str ID of a Smart Shopping campaign. Returns: An ad group ID. """ ad_group_service = client.GetService('AdGroupService', version='v201809') # Cre...
def CreateSmartShoppingAdGroup(client, campaign_id): """Adds a new Smart Shopping ad group. Args: client: an AdWordsClient instance. campaign_id: the str ID of a Smart Shopping campaign. Returns: An ad group ID. """ ad_group_service = client.GetService('AdGroupService', version='v201809') # Cre...
[ "Adds", "a", "new", "Smart", "Shopping", "ad", "group", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/v201809/shopping/add_smart_shopping_ad.py#L132-L162
[ "def", "CreateSmartShoppingAdGroup", "(", "client", ",", "campaign_id", ")", ":", "ad_group_service", "=", "client", ".", "GetService", "(", "'AdGroupService'", ",", "version", "=", "'v201809'", ")", "# Create the ad group.", "ad_group", "=", "{", "'campaignId'", ":...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874
train
CreateSmartShoppingAd
Adds a new Smart Shopping ad. Args: client: an AdWordsClient instance. ad_group_id: an integer ID for an ad group.
examples/adwords/v201809/shopping/add_smart_shopping_ad.py
def CreateSmartShoppingAd(client, ad_group_id): """Adds a new Smart Shopping ad. Args: client: an AdWordsClient instance. ad_group_id: an integer ID for an ad group. """ ad_group_ad_service = client.GetService('AdGroupAdService', version='v201809') # Create an AdGroup Ad. adgroup_ad = { 'adGr...
def CreateSmartShoppingAd(client, ad_group_id): """Adds a new Smart Shopping ad. Args: client: an AdWordsClient instance. ad_group_id: an integer ID for an ad group. """ ad_group_ad_service = client.GetService('AdGroupAdService', version='v201809') # Create an AdGroup Ad. adgroup_ad = { 'adGr...
[ "Adds", "a", "new", "Smart", "Shopping", "ad", "." ]
googleads/googleads-python-lib
python
https://github.com/googleads/googleads-python-lib/blob/aa3b1b474b0f9789ca55ca46f4b2b57aeae38874/examples/adwords/v201809/shopping/add_smart_shopping_ad.py#L165-L191
[ "def", "CreateSmartShoppingAd", "(", "client", ",", "ad_group_id", ")", ":", "ad_group_ad_service", "=", "client", ".", "GetService", "(", "'AdGroupAdService'", ",", "version", "=", "'v201809'", ")", "# Create an AdGroup Ad.", "adgroup_ad", "=", "{", "'adGroupId'", ...
aa3b1b474b0f9789ca55ca46f4b2b57aeae38874