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 | JointProbabilityDistribution.conditional_distribution | Returns Conditional Probability Distribution after setting values to 1.
Parameters
----------
values: list or array_like
A list of tuples of the form (variable_name, variable_state).
The values on which to condition the Joint Probability Distribution.
inplace: Bo... | pgmpy/factors/discrete/JointProbabilityDistribution.py | def conditional_distribution(self, values, inplace=True):
"""
Returns Conditional Probability Distribution after setting values to 1.
Parameters
----------
values: list or array_like
A list of tuples of the form (variable_name, variable_state).
The values... | def conditional_distribution(self, values, inplace=True):
"""
Returns Conditional Probability Distribution after setting values to 1.
Parameters
----------
values: list or array_like
A list of tuples of the form (variable_name, variable_state).
The values... | [
"Returns",
"Conditional",
"Probability",
"Distribution",
"after",
"setting",
"values",
"to",
"1",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/factors/discrete/JointProbabilityDistribution.py#L238-L268 | [
"def",
"conditional_distribution",
"(",
"self",
",",
"values",
",",
"inplace",
"=",
"True",
")",
":",
"JPD",
"=",
"self",
"if",
"inplace",
"else",
"self",
".",
"copy",
"(",
")",
"JPD",
".",
"reduce",
"(",
"values",
")",
"JPD",
".",
"normalize",
"(",
... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | JointProbabilityDistribution.minimal_imap | Returns a Bayesian Model which is minimal IMap of the Joint Probability Distribution
considering the order of the variables.
Parameters
----------
order: array-like
The order of the random variables.
Examples
--------
>>> import numpy as np
>... | pgmpy/factors/discrete/JointProbabilityDistribution.py | def minimal_imap(self, order):
"""
Returns a Bayesian Model which is minimal IMap of the Joint Probability Distribution
considering the order of the variables.
Parameters
----------
order: array-like
The order of the random variables.
Examples
... | def minimal_imap(self, order):
"""
Returns a Bayesian Model which is minimal IMap of the Joint Probability Distribution
considering the order of the variables.
Parameters
----------
order: array-like
The order of the random variables.
Examples
... | [
"Returns",
"a",
"Bayesian",
"Model",
"which",
"is",
"minimal",
"IMap",
"of",
"the",
"Joint",
"Probability",
"Distribution",
"considering",
"the",
"order",
"of",
"the",
"variables",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/factors/discrete/JointProbabilityDistribution.py#L290-L325 | [
"def",
"minimal_imap",
"(",
"self",
",",
"order",
")",
":",
"from",
"pgmpy",
".",
"models",
"import",
"BayesianModel",
"def",
"get_subsets",
"(",
"u",
")",
":",
"for",
"r",
"in",
"range",
"(",
"len",
"(",
"u",
")",
"+",
"1",
")",
":",
"for",
"i",
... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | JointProbabilityDistribution.is_imap | Checks whether the given BayesianModel is Imap of JointProbabilityDistribution
Parameters
-----------
model : An instance of BayesianModel Class, for which you want to
check the Imap
Returns
--------
boolean : True if given bayesian model is Imap for Joint P... | pgmpy/factors/discrete/JointProbabilityDistribution.py | def is_imap(self, model):
"""
Checks whether the given BayesianModel is Imap of JointProbabilityDistribution
Parameters
-----------
model : An instance of BayesianModel Class, for which you want to
check the Imap
Returns
--------
boolean : Tr... | def is_imap(self, model):
"""
Checks whether the given BayesianModel is Imap of JointProbabilityDistribution
Parameters
-----------
model : An instance of BayesianModel Class, for which you want to
check the Imap
Returns
--------
boolean : Tr... | [
"Checks",
"whether",
"the",
"given",
"BayesianModel",
"is",
"Imap",
"of",
"JointProbabilityDistribution"
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/factors/discrete/JointProbabilityDistribution.py#L327-L370 | [
"def",
"is_imap",
"(",
"self",
",",
"model",
")",
":",
"from",
"pgmpy",
".",
"models",
"import",
"BayesianModel",
"if",
"not",
"isinstance",
"(",
"model",
",",
"BayesianModel",
")",
":",
"raise",
"TypeError",
"(",
"\"model must be an instance of BayesianModel\"",
... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | HamiltonianMC._acceptance_prob | Returns the acceptance probability for given new position(position) and momentum | pgmpy/sampling/HMC.py | def _acceptance_prob(self, position, position_bar, momentum, momentum_bar):
"""
Returns the acceptance probability for given new position(position) and momentum
"""
# Parameters to help in evaluating Joint distribution P(position, momentum)
_, logp = self.grad_log_pdf(position, ... | def _acceptance_prob(self, position, position_bar, momentum, momentum_bar):
"""
Returns the acceptance probability for given new position(position) and momentum
"""
# Parameters to help in evaluating Joint distribution P(position, momentum)
_, logp = self.grad_log_pdf(position, ... | [
"Returns",
"the",
"acceptance",
"probability",
"for",
"given",
"new",
"position",
"(",
"position",
")",
"and",
"momentum"
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/sampling/HMC.py#L88-L102 | [
"def",
"_acceptance_prob",
"(",
"self",
",",
"position",
",",
"position_bar",
",",
"momentum",
",",
"momentum_bar",
")",
":",
"# Parameters to help in evaluating Joint distribution P(position, momentum)",
"_",
",",
"logp",
"=",
"self",
".",
"grad_log_pdf",
"(",
"positio... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | HamiltonianMC._get_condition | Temporary method to fix issue in numpy 0.12 #852 | pgmpy/sampling/HMC.py | def _get_condition(self, acceptance_prob, a):
"""
Temporary method to fix issue in numpy 0.12 #852
"""
if a == 1:
return (acceptance_prob ** a) > (1/(2**a))
else:
return (1/(acceptance_prob ** a)) > (2**(-a)) | def _get_condition(self, acceptance_prob, a):
"""
Temporary method to fix issue in numpy 0.12 #852
"""
if a == 1:
return (acceptance_prob ** a) > (1/(2**a))
else:
return (1/(acceptance_prob ** a)) > (2**(-a)) | [
"Temporary",
"method",
"to",
"fix",
"issue",
"in",
"numpy",
"0",
".",
"12",
"#852"
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/sampling/HMC.py#L104-L111 | [
"def",
"_get_condition",
"(",
"self",
",",
"acceptance_prob",
",",
"a",
")",
":",
"if",
"a",
"==",
"1",
":",
"return",
"(",
"acceptance_prob",
"**",
"a",
")",
">",
"(",
"1",
"/",
"(",
"2",
"**",
"a",
")",
")",
"else",
":",
"return",
"(",
"1",
"... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | HamiltonianMC._find_reasonable_stepsize | Method for choosing initial value of stepsize
References
-----------
Matthew D. Hoffman, Andrew Gelman, The No-U-Turn Sampler: Adaptively
Setting Path Lengths in Hamiltonian Monte Carlo. Journal of
Machine Learning Research 15 (2014) 1351-1381
Algorithm 4 : Heuristic for... | pgmpy/sampling/HMC.py | def _find_reasonable_stepsize(self, position, stepsize_app=1):
"""
Method for choosing initial value of stepsize
References
-----------
Matthew D. Hoffman, Andrew Gelman, The No-U-Turn Sampler: Adaptively
Setting Path Lengths in Hamiltonian Monte Carlo. Journal of
... | def _find_reasonable_stepsize(self, position, stepsize_app=1):
"""
Method for choosing initial value of stepsize
References
-----------
Matthew D. Hoffman, Andrew Gelman, The No-U-Turn Sampler: Adaptively
Setting Path Lengths in Hamiltonian Monte Carlo. Journal of
... | [
"Method",
"for",
"choosing",
"initial",
"value",
"of",
"stepsize"
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/sampling/HMC.py#L113-L150 | [
"def",
"_find_reasonable_stepsize",
"(",
"self",
",",
"position",
",",
"stepsize_app",
"=",
"1",
")",
":",
"# momentum = N(0, I)",
"momentum",
"=",
"np",
".",
"reshape",
"(",
"np",
".",
"random",
".",
"normal",
"(",
"0",
",",
"1",
",",
"len",
"(",
"posit... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | HamiltonianMC._sample | Runs a single sampling iteration to return a sample | pgmpy/sampling/HMC.py | def _sample(self, position, trajectory_length, stepsize, lsteps=None):
"""
Runs a single sampling iteration to return a sample
"""
# Resampling momentum
momentum = np.reshape(np.random.normal(0, 1, len(position)), position.shape)
# position_m here will be the previous sa... | def _sample(self, position, trajectory_length, stepsize, lsteps=None):
"""
Runs a single sampling iteration to return a sample
"""
# Resampling momentum
momentum = np.reshape(np.random.normal(0, 1, len(position)), position.shape)
# position_m here will be the previous sa... | [
"Runs",
"a",
"single",
"sampling",
"iteration",
"to",
"return",
"a",
"sample"
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/sampling/HMC.py#L152-L183 | [
"def",
"_sample",
"(",
"self",
",",
"position",
",",
"trajectory_length",
",",
"stepsize",
",",
"lsteps",
"=",
"None",
")",
":",
"# Resampling momentum",
"momentum",
"=",
"np",
".",
"reshape",
"(",
"np",
".",
"random",
".",
"normal",
"(",
"0",
",",
"1",
... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | HamiltonianMC.sample | Method to return samples using Hamiltonian Monte Carlo
Parameters
----------
initial_pos: A 1d array like object
Vector representing values of parameter position, the starting
state in markov chain.
num_samples: int
Number of samples to be generated
... | pgmpy/sampling/HMC.py | def sample(self, initial_pos, num_samples, trajectory_length, stepsize=None, return_type='dataframe'):
"""
Method to return samples using Hamiltonian Monte Carlo
Parameters
----------
initial_pos: A 1d array like object
Vector representing values of parameter positio... | def sample(self, initial_pos, num_samples, trajectory_length, stepsize=None, return_type='dataframe'):
"""
Method to return samples using Hamiltonian Monte Carlo
Parameters
----------
initial_pos: A 1d array like object
Vector representing values of parameter positio... | [
"Method",
"to",
"return",
"samples",
"using",
"Hamiltonian",
"Monte",
"Carlo"
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/sampling/HMC.py#L185-L269 | [
"def",
"sample",
"(",
"self",
",",
"initial_pos",
",",
"num_samples",
",",
"trajectory_length",
",",
"stepsize",
"=",
"None",
",",
"return_type",
"=",
"'dataframe'",
")",
":",
"self",
".",
"accepted_proposals",
"=",
"1.0",
"initial_pos",
"=",
"_check_1d_array_ob... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | HamiltonianMC.generate_sample | Method returns a generator type object whose each iteration yields a sample
using Hamiltonian Monte Carlo
Parameters
----------
initial_pos: A 1d array like object
Vector representing values of parameter position, the starting
state in markov chain.
num_... | pgmpy/sampling/HMC.py | def generate_sample(self, initial_pos, num_samples, trajectory_length, stepsize=None):
"""
Method returns a generator type object whose each iteration yields a sample
using Hamiltonian Monte Carlo
Parameters
----------
initial_pos: A 1d array like object
Vect... | def generate_sample(self, initial_pos, num_samples, trajectory_length, stepsize=None):
"""
Method returns a generator type object whose each iteration yields a sample
using Hamiltonian Monte Carlo
Parameters
----------
initial_pos: A 1d array like object
Vect... | [
"Method",
"returns",
"a",
"generator",
"type",
"object",
"whose",
"each",
"iteration",
"yields",
"a",
"sample",
"using",
"Hamiltonian",
"Monte",
"Carlo"
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/sampling/HMC.py#L271-L341 | [
"def",
"generate_sample",
"(",
"self",
",",
"initial_pos",
",",
"num_samples",
",",
"trajectory_length",
",",
"stepsize",
"=",
"None",
")",
":",
"self",
".",
"accepted_proposals",
"=",
"0",
"initial_pos",
"=",
"_check_1d_array_object",
"(",
"initial_pos",
",",
"... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | HamiltonianMCDA._adapt_params | Run tha adaptation for stepsize for better proposals of position | pgmpy/sampling/HMC.py | def _adapt_params(self, stepsize, stepsize_bar, h_bar, mu, index_i, alpha, n_alpha=1):
"""
Run tha adaptation for stepsize for better proposals of position
"""
gamma = 0.05 # free parameter that controls the amount of shrinkage towards mu
t0 = 10.0 # free parameter that stabili... | def _adapt_params(self, stepsize, stepsize_bar, h_bar, mu, index_i, alpha, n_alpha=1):
"""
Run tha adaptation for stepsize for better proposals of position
"""
gamma = 0.05 # free parameter that controls the amount of shrinkage towards mu
t0 = 10.0 # free parameter that stabili... | [
"Run",
"tha",
"adaptation",
"for",
"stepsize",
"for",
"better",
"proposals",
"of",
"position"
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/sampling/HMC.py#L408-L424 | [
"def",
"_adapt_params",
"(",
"self",
",",
"stepsize",
",",
"stepsize_bar",
",",
"h_bar",
",",
"mu",
",",
"index_i",
",",
"alpha",
",",
"n_alpha",
"=",
"1",
")",
":",
"gamma",
"=",
"0.05",
"# free parameter that controls the amount of shrinkage towards mu",
"t0",
... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | HamiltonianMCDA.generate_sample | Method returns a generator type object whose each iteration yields a sample
using Hamiltonian Monte Carlo
Parameters
----------
initial_pos: A 1d array like object
Vector representing values of parameter position, the starting
state in markov chain.
num_... | pgmpy/sampling/HMC.py | def generate_sample(self, initial_pos, num_adapt, num_samples, trajectory_length, stepsize=None):
"""
Method returns a generator type object whose each iteration yields a sample
using Hamiltonian Monte Carlo
Parameters
----------
initial_pos: A 1d array like object
... | def generate_sample(self, initial_pos, num_adapt, num_samples, trajectory_length, stepsize=None):
"""
Method returns a generator type object whose each iteration yields a sample
using Hamiltonian Monte Carlo
Parameters
----------
initial_pos: A 1d array like object
... | [
"Method",
"returns",
"a",
"generator",
"type",
"object",
"whose",
"each",
"iteration",
"yields",
"a",
"sample",
"using",
"Hamiltonian",
"Monte",
"Carlo"
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/sampling/HMC.py#L518-L594 | [
"def",
"generate_sample",
"(",
"self",
",",
"initial_pos",
",",
"num_adapt",
",",
"num_samples",
",",
"trajectory_length",
",",
"stepsize",
"=",
"None",
")",
":",
"self",
".",
"accepted_proposals",
"=",
"0",
"initial_pos",
"=",
"_check_1d_array_object",
"(",
"in... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | StateNameDecorator.is_list_of_states | A list of states example -
[('x1', 'easy'), ('x2', 'hard')]
Returns
-------
True, if arg is a list of states else False. | pgmpy/utils/state_name.py | def is_list_of_states(self, arg):
"""
A list of states example -
[('x1', 'easy'), ('x2', 'hard')]
Returns
-------
True, if arg is a list of states else False.
"""
return isinstance(arg, list) and all(isinstance(i, tuple) for i in arg) | def is_list_of_states(self, arg):
"""
A list of states example -
[('x1', 'easy'), ('x2', 'hard')]
Returns
-------
True, if arg is a list of states else False.
"""
return isinstance(arg, list) and all(isinstance(i, tuple) for i in arg) | [
"A",
"list",
"of",
"states",
"example",
"-",
"[",
"(",
"x1",
"easy",
")",
"(",
"x2",
"hard",
")",
"]"
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/utils/state_name.py#L67-L77 | [
"def",
"is_list_of_states",
"(",
"self",
",",
"arg",
")",
":",
"return",
"isinstance",
"(",
"arg",
",",
"list",
")",
"and",
"all",
"(",
"isinstance",
"(",
"i",
",",
"tuple",
")",
"for",
"i",
"in",
"arg",
")"
] | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | StateNameDecorator.is_list_of_list_of_states | A list of list of states example -
[[('x1', 'easy'), ('x2', 'hard')], [('x1', 'hard'), ('x2', 'medium')]]
Returns
-------
True, if arg is a list of list of states else False. | pgmpy/utils/state_name.py | def is_list_of_list_of_states(self, arg):
"""
A list of list of states example -
[[('x1', 'easy'), ('x2', 'hard')], [('x1', 'hard'), ('x2', 'medium')]]
Returns
-------
True, if arg is a list of list of states else False.
"""
if arg is None:
r... | def is_list_of_list_of_states(self, arg):
"""
A list of list of states example -
[[('x1', 'easy'), ('x2', 'hard')], [('x1', 'hard'), ('x2', 'medium')]]
Returns
-------
True, if arg is a list of list of states else False.
"""
if arg is None:
r... | [
"A",
"list",
"of",
"list",
"of",
"states",
"example",
"-",
"[[",
"(",
"x1",
"easy",
")",
"(",
"x2",
"hard",
")",
"]",
"[",
"(",
"x1",
"hard",
")",
"(",
"x2",
"medium",
")",
"]]"
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/utils/state_name.py#L79-L93 | [
"def",
"is_list_of_list_of_states",
"(",
"self",
",",
"arg",
")",
":",
"if",
"arg",
"is",
"None",
":",
"return",
"False",
"return",
"all",
"(",
"[",
"isinstance",
"(",
"arg",
",",
"list",
")",
",",
"all",
"(",
"isinstance",
"(",
"i",
",",
"list",
")"... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | UndirectedGraph.add_edge | Add an edge between u and v.
The nodes u and v will be automatically added if they are
not already in the graph.
Parameters
----------
u, v : nodes
Nodes can be any hashable Python object.
weight: int, float (default=None)
The weight of the edge... | pgmpy/base/UndirectedGraph.py | def add_edge(self, u, v, weight=None):
"""
Add an edge between u and v.
The nodes u and v will be automatically added if they are
not already in the graph.
Parameters
----------
u, v : nodes
Nodes can be any hashable Python object.
weight: i... | def add_edge(self, u, v, weight=None):
"""
Add an edge between u and v.
The nodes u and v will be automatically added if they are
not already in the graph.
Parameters
----------
u, v : nodes
Nodes can be any hashable Python object.
weight: i... | [
"Add",
"an",
"edge",
"between",
"u",
"and",
"v",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/base/UndirectedGraph.py#L154-L192 | [
"def",
"add_edge",
"(",
"self",
",",
"u",
",",
"v",
",",
"weight",
"=",
"None",
")",
":",
"super",
"(",
"UndirectedGraph",
",",
"self",
")",
".",
"add_edge",
"(",
"u",
",",
"v",
",",
"weight",
"=",
"weight",
")"
] | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | UndirectedGraph.is_clique | Check if the given nodes form a clique.
Parameters
----------
nodes: list, array-like
List of nodes to check if they are a part of any clique.
Examples
--------
>>> from pgmpy.base import UndirectedGraph
>>> G = UndirectedGraph(ebunch=[('A', 'B'), ('... | pgmpy/base/UndirectedGraph.py | def is_clique(self, nodes):
"""
Check if the given nodes form a clique.
Parameters
----------
nodes: list, array-like
List of nodes to check if they are a part of any clique.
Examples
--------
>>> from pgmpy.base import UndirectedGraph
... | def is_clique(self, nodes):
"""
Check if the given nodes form a clique.
Parameters
----------
nodes: list, array-like
List of nodes to check if they are a part of any clique.
Examples
--------
>>> from pgmpy.base import UndirectedGraph
... | [
"Check",
"if",
"the",
"given",
"nodes",
"form",
"a",
"clique",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/base/UndirectedGraph.py#L253-L281 | [
"def",
"is_clique",
"(",
"self",
",",
"nodes",
")",
":",
"for",
"node1",
",",
"node2",
"in",
"itertools",
".",
"combinations",
"(",
"nodes",
",",
"2",
")",
":",
"if",
"not",
"self",
".",
"has_edge",
"(",
"node1",
",",
"node2",
")",
":",
"return",
"... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | MarkovChain.set_start_state | Set the start state of the Markov Chain. If the start_state is given as a array-like iterable, its contents
are reordered in the internal representation.
Parameters:
-----------
start_state: dict or array-like iterable object
Dict (or list) of tuples representing the startin... | pgmpy/models/MarkovChain.py | def set_start_state(self, start_state):
"""
Set the start state of the Markov Chain. If the start_state is given as a array-like iterable, its contents
are reordered in the internal representation.
Parameters:
-----------
start_state: dict or array-like iterable object
... | def set_start_state(self, start_state):
"""
Set the start state of the Markov Chain. If the start_state is given as a array-like iterable, its contents
are reordered in the internal representation.
Parameters:
-----------
start_state: dict or array-like iterable object
... | [
"Set",
"the",
"start",
"state",
"of",
"the",
"Markov",
"Chain",
".",
"If",
"the",
"start_state",
"is",
"given",
"as",
"a",
"array",
"-",
"like",
"iterable",
"its",
"contents",
"are",
"reordered",
"in",
"the",
"internal",
"representation",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/MarkovChain.py#L86-L110 | [
"def",
"set_start_state",
"(",
"self",
",",
"start_state",
")",
":",
"if",
"start_state",
"is",
"not",
"None",
":",
"if",
"not",
"hasattr",
"(",
"start_state",
",",
"'__iter__'",
")",
"or",
"isinstance",
"(",
"start_state",
",",
"six",
".",
"string_types",
... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | MarkovChain._check_state | Checks if a list representing the state of the variables is valid. | pgmpy/models/MarkovChain.py | def _check_state(self, state):
"""
Checks if a list representing the state of the variables is valid.
"""
if not hasattr(state, '__iter__') or isinstance(state, six.string_types):
raise ValueError('Start state must be a non-string iterable object.')
state_vars = {s.va... | def _check_state(self, state):
"""
Checks if a list representing the state of the variables is valid.
"""
if not hasattr(state, '__iter__') or isinstance(state, six.string_types):
raise ValueError('Start state must be a non-string iterable object.')
state_vars = {s.va... | [
"Checks",
"if",
"a",
"list",
"representing",
"the",
"state",
"of",
"the",
"variables",
"is",
"valid",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/MarkovChain.py#L112-L126 | [
"def",
"_check_state",
"(",
"self",
",",
"state",
")",
":",
"if",
"not",
"hasattr",
"(",
"state",
",",
"'__iter__'",
")",
"or",
"isinstance",
"(",
"state",
",",
"six",
".",
"string_types",
")",
":",
"raise",
"ValueError",
"(",
"'Start state must be a non-str... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | MarkovChain.add_variable | Add a variable to the model.
Parameters:
-----------
variable: any hashable python object
card: int
Representing the cardinality of the variable to be added.
Examples:
---------
>>> from pgmpy.models import MarkovChain as MC
>>> model = MC()... | pgmpy/models/MarkovChain.py | def add_variable(self, variable, card=0):
"""
Add a variable to the model.
Parameters:
-----------
variable: any hashable python object
card: int
Representing the cardinality of the variable to be added.
Examples:
---------
>>> from ... | def add_variable(self, variable, card=0):
"""
Add a variable to the model.
Parameters:
-----------
variable: any hashable python object
card: int
Representing the cardinality of the variable to be added.
Examples:
---------
>>> from ... | [
"Add",
"a",
"variable",
"to",
"the",
"model",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/MarkovChain.py#L128-L150 | [
"def",
"add_variable",
"(",
"self",
",",
"variable",
",",
"card",
"=",
"0",
")",
":",
"if",
"variable",
"not",
"in",
"self",
".",
"variables",
":",
"self",
".",
"variables",
".",
"append",
"(",
"variable",
")",
"else",
":",
"warn",
"(",
"'Variable {var... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | MarkovChain.add_variables_from | Add several variables to the model at once.
Parameters:
-----------
variables: array-like iterable object
List of variables to be added.
cards: array-like iterable object
List of cardinalities of the variables to be added.
Examples:
---------
... | pgmpy/models/MarkovChain.py | def add_variables_from(self, variables, cards):
"""
Add several variables to the model at once.
Parameters:
-----------
variables: array-like iterable object
List of variables to be added.
cards: array-like iterable object
List of cardinalities o... | def add_variables_from(self, variables, cards):
"""
Add several variables to the model at once.
Parameters:
-----------
variables: array-like iterable object
List of variables to be added.
cards: array-like iterable object
List of cardinalities o... | [
"Add",
"several",
"variables",
"to",
"the",
"model",
"at",
"once",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/MarkovChain.py#L152-L171 | [
"def",
"add_variables_from",
"(",
"self",
",",
"variables",
",",
"cards",
")",
":",
"for",
"var",
",",
"card",
"in",
"zip",
"(",
"variables",
",",
"cards",
")",
":",
"self",
".",
"add_variable",
"(",
"var",
",",
"card",
")"
] | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | MarkovChain.add_transition_model | Adds a transition model for a particular variable.
Parameters:
-----------
variable: any hashable python object
must be an existing variable of the model.
transition_model: dict or 2d array
dict representing valid transition probabilities defined for every possib... | pgmpy/models/MarkovChain.py | def add_transition_model(self, variable, transition_model):
"""
Adds a transition model for a particular variable.
Parameters:
-----------
variable: any hashable python object
must be an existing variable of the model.
transition_model: dict or 2d array
... | def add_transition_model(self, variable, transition_model):
"""
Adds a transition model for a particular variable.
Parameters:
-----------
variable: any hashable python object
must be an existing variable of the model.
transition_model: dict or 2d array
... | [
"Adds",
"a",
"transition",
"model",
"for",
"a",
"particular",
"variable",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/MarkovChain.py#L173-L234 | [
"def",
"add_transition_model",
"(",
"self",
",",
"variable",
",",
"transition_model",
")",
":",
"if",
"isinstance",
"(",
"transition_model",
",",
"list",
")",
":",
"transition_model",
"=",
"np",
".",
"array",
"(",
"transition_model",
")",
"# check if the transitio... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | MarkovChain.sample | Sample from the Markov Chain.
Parameters:
-----------
start_state: dict or array-like iterable
Representing the starting states of the variables. If None is passed, a random start_state is chosen.
size: int
Number of samples to be generated.
Return Type:... | pgmpy/models/MarkovChain.py | def sample(self, start_state=None, size=1):
"""
Sample from the Markov Chain.
Parameters:
-----------
start_state: dict or array-like iterable
Representing the starting states of the variables. If None is passed, a random start_state is chosen.
size: int
... | def sample(self, start_state=None, size=1):
"""
Sample from the Markov Chain.
Parameters:
-----------
start_state: dict or array-like iterable
Representing the starting states of the variables. If None is passed, a random start_state is chosen.
size: int
... | [
"Sample",
"from",
"the",
"Markov",
"Chain",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/MarkovChain.py#L236-L294 | [
"def",
"sample",
"(",
"self",
",",
"start_state",
"=",
"None",
",",
"size",
"=",
"1",
")",
":",
"if",
"start_state",
"is",
"None",
":",
"if",
"self",
".",
"state",
"is",
"None",
":",
"self",
".",
"state",
"=",
"self",
".",
"random_state",
"(",
")",... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | MarkovChain.prob_from_sample | Given an instantiation (partial or complete) of the variables of the model,
compute the probability of observing it over multiple windows in a given sample.
If 'sample' is not passed as an argument, generate the statistic by sampling from the
Markov Chain, starting with a random initial state.
... | pgmpy/models/MarkovChain.py | def prob_from_sample(self, state, sample=None, window_size=None):
"""
Given an instantiation (partial or complete) of the variables of the model,
compute the probability of observing it over multiple windows in a given sample.
If 'sample' is not passed as an argument, generate the stati... | def prob_from_sample(self, state, sample=None, window_size=None):
"""
Given an instantiation (partial or complete) of the variables of the model,
compute the probability of observing it over multiple windows in a given sample.
If 'sample' is not passed as an argument, generate the stati... | [
"Given",
"an",
"instantiation",
"(",
"partial",
"or",
"complete",
")",
"of",
"the",
"variables",
"of",
"the",
"model",
"compute",
"the",
"probability",
"of",
"observing",
"it",
"over",
"multiple",
"windows",
"in",
"a",
"given",
"sample",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/MarkovChain.py#L296-L331 | [
"def",
"prob_from_sample",
"(",
"self",
",",
"state",
",",
"sample",
"=",
"None",
",",
"window_size",
"=",
"None",
")",
":",
"if",
"sample",
"is",
"None",
":",
"# generate sample of size 10000",
"sample",
"=",
"self",
".",
"sample",
"(",
"self",
".",
"rand... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | MarkovChain.generate_sample | Generator version of self.sample
Return Type:
------------
List of State namedtuples, representing the assignment to all variables of the model.
Examples:
---------
>>> from pgmpy.models.MarkovChain import MarkovChain
>>> from pgmpy.factors.discrete import State... | pgmpy/models/MarkovChain.py | def generate_sample(self, start_state=None, size=1):
"""
Generator version of self.sample
Return Type:
------------
List of State namedtuples, representing the assignment to all variables of the model.
Examples:
---------
>>> from pgmpy.models.MarkovChai... | def generate_sample(self, start_state=None, size=1):
"""
Generator version of self.sample
Return Type:
------------
List of State namedtuples, representing the assignment to all variables of the model.
Examples:
---------
>>> from pgmpy.models.MarkovChai... | [
"Generator",
"version",
"of",
"self",
".",
"sample"
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/MarkovChain.py#L333-L369 | [
"def",
"generate_sample",
"(",
"self",
",",
"start_state",
"=",
"None",
",",
"size",
"=",
"1",
")",
":",
"if",
"start_state",
"is",
"None",
":",
"if",
"self",
".",
"state",
"is",
"None",
":",
"self",
".",
"state",
"=",
"self",
".",
"random_state",
"(... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | MarkovChain.is_stationarity | Checks if the given markov chain is stationary and checks the steady state
probablity values for the state are consistent.
Parameters:
-----------
tolerance: float
represents the diff between actual steady state value and the computed value
sample: [State(i,j)]
... | pgmpy/models/MarkovChain.py | def is_stationarity(self, tolerance=0.2, sample=None):
"""
Checks if the given markov chain is stationary and checks the steady state
probablity values for the state are consistent.
Parameters:
-----------
tolerance: float
represents the diff between actual s... | def is_stationarity(self, tolerance=0.2, sample=None):
"""
Checks if the given markov chain is stationary and checks the steady state
probablity values for the state are consistent.
Parameters:
-----------
tolerance: float
represents the diff between actual s... | [
"Checks",
"if",
"the",
"given",
"markov",
"chain",
"is",
"stationary",
"and",
"checks",
"the",
"steady",
"state",
"probablity",
"values",
"for",
"the",
"state",
"are",
"consistent",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/MarkovChain.py#L371-L421 | [
"def",
"is_stationarity",
"(",
"self",
",",
"tolerance",
"=",
"0.2",
",",
"sample",
"=",
"None",
")",
":",
"keys",
"=",
"self",
".",
"transition_models",
".",
"keys",
"(",
")",
"return_val",
"=",
"True",
"for",
"k",
"in",
"keys",
":",
"# convert dict to ... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | MarkovChain.random_state | Generates a random state of the Markov Chain.
Return Type:
------------
List of namedtuples, representing a random assignment to all variables of the model.
Examples:
---------
>>> from pgmpy.models import MarkovChain as MC
>>> model = MC(['intel', 'diff'], [2, ... | pgmpy/models/MarkovChain.py | def random_state(self):
"""
Generates a random state of the Markov Chain.
Return Type:
------------
List of namedtuples, representing a random assignment to all variables of the model.
Examples:
---------
>>> from pgmpy.models import MarkovChain as MC
... | def random_state(self):
"""
Generates a random state of the Markov Chain.
Return Type:
------------
List of namedtuples, representing a random assignment to all variables of the model.
Examples:
---------
>>> from pgmpy.models import MarkovChain as MC
... | [
"Generates",
"a",
"random",
"state",
"of",
"the",
"Markov",
"Chain",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/MarkovChain.py#L423-L438 | [
"def",
"random_state",
"(",
"self",
")",
":",
"return",
"[",
"State",
"(",
"var",
",",
"np",
".",
"random",
".",
"randint",
"(",
"self",
".",
"cardinalities",
"[",
"var",
"]",
")",
")",
"for",
"var",
"in",
"self",
".",
"variables",
"]"
] | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | MarkovChain.copy | Returns a copy of Markov Chain Model.
Return Type:
------------
MarkovChain : Copy of MarkovChain.
Examples:
---------
>>> from pgmpy.models import MarkovChain
>>> from pgmpy.factors.discrete import State
>>> model = MarkovChain()
>>> model.add_v... | pgmpy/models/MarkovChain.py | def copy(self):
"""
Returns a copy of Markov Chain Model.
Return Type:
------------
MarkovChain : Copy of MarkovChain.
Examples:
---------
>>> from pgmpy.models import MarkovChain
>>> from pgmpy.factors.discrete import State
>>> model = M... | def copy(self):
"""
Returns a copy of Markov Chain Model.
Return Type:
------------
MarkovChain : Copy of MarkovChain.
Examples:
---------
>>> from pgmpy.models import MarkovChain
>>> from pgmpy.factors.discrete import State
>>> model = M... | [
"Returns",
"a",
"copy",
"of",
"Markov",
"Chain",
"Model",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/MarkovChain.py#L440-L469 | [
"def",
"copy",
"(",
"self",
")",
":",
"markovchain_copy",
"=",
"MarkovChain",
"(",
"variables",
"=",
"list",
"(",
"self",
".",
"cardinalities",
".",
"keys",
"(",
")",
")",
",",
"card",
"=",
"list",
"(",
"self",
".",
"cardinalities",
".",
"values",
"(",... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | Independencies.contains | Returns `True` if `assertion` is contained in this `Independencies`-object,
otherwise `False`.
Parameters
----------
assertion: IndependenceAssertion()-object
Examples
--------
>>> from pgmpy.independencies import Independencies, IndependenceAssertion
>>... | pgmpy/independencies/Independencies.py | def contains(self, assertion):
"""
Returns `True` if `assertion` is contained in this `Independencies`-object,
otherwise `False`.
Parameters
----------
assertion: IndependenceAssertion()-object
Examples
--------
>>> from pgmpy.independencies impo... | def contains(self, assertion):
"""
Returns `True` if `assertion` is contained in this `Independencies`-object,
otherwise `False`.
Parameters
----------
assertion: IndependenceAssertion()-object
Examples
--------
>>> from pgmpy.independencies impo... | [
"Returns",
"True",
"if",
"assertion",
"is",
"contained",
"in",
"this",
"Independencies",
"-",
"object",
"otherwise",
"False",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/independencies/Independencies.py#L68-L94 | [
"def",
"contains",
"(",
"self",
",",
"assertion",
")",
":",
"if",
"not",
"isinstance",
"(",
"assertion",
",",
"IndependenceAssertion",
")",
":",
"raise",
"TypeError",
"(",
"\"' in <Independencies()>' requires IndependenceAssertion\"",
"+",
"\" as left operand, not {0}\"",... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | Independencies.add_assertions | Adds assertions to independencies.
Parameters
----------
assertions: Lists or Tuples
Each assertion is a list or tuple of variable, independent_of and given.
Examples
--------
>>> from pgmpy.independencies import Independencies
>>> independencies... | pgmpy/independencies/Independencies.py | def add_assertions(self, *assertions):
"""
Adds assertions to independencies.
Parameters
----------
assertions: Lists or Tuples
Each assertion is a list or tuple of variable, independent_of and given.
Examples
--------
>>> from pgmpy.inde... | def add_assertions(self, *assertions):
"""
Adds assertions to independencies.
Parameters
----------
assertions: Lists or Tuples
Each assertion is a list or tuple of variable, independent_of and given.
Examples
--------
>>> from pgmpy.inde... | [
"Adds",
"assertions",
"to",
"independencies",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/independencies/Independencies.py#L110-L133 | [
"def",
"add_assertions",
"(",
"self",
",",
"*",
"assertions",
")",
":",
"for",
"assertion",
"in",
"assertions",
":",
"if",
"isinstance",
"(",
"assertion",
",",
"IndependenceAssertion",
")",
":",
"self",
".",
"independencies",
".",
"append",
"(",
"assertion",
... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | Independencies.closure | Returns a new `Independencies()`-object that additionally contains those `IndependenceAssertions`
that are implied by the the current independencies (using with the `semi-graphoid axioms
<https://en.wikipedia.org/w/index.php?title=Conditional_independence&oldid=708760689#Rules_of_conditional_independenc... | pgmpy/independencies/Independencies.py | def closure(self):
"""
Returns a new `Independencies()`-object that additionally contains those `IndependenceAssertions`
that are implied by the the current independencies (using with the `semi-graphoid axioms
<https://en.wikipedia.org/w/index.php?title=Conditional_independence&oldid=708... | def closure(self):
"""
Returns a new `Independencies()`-object that additionally contains those `IndependenceAssertions`
that are implied by the the current independencies (using with the `semi-graphoid axioms
<https://en.wikipedia.org/w/index.php?title=Conditional_independence&oldid=708... | [
"Returns",
"a",
"new",
"Independencies",
"()",
"-",
"object",
"that",
"additionally",
"contains",
"those",
"IndependenceAssertions",
"that",
"are",
"implied",
"by",
"the",
"the",
"current",
"independencies",
"(",
"using",
"with",
"the",
"semi",
"-",
"graphoid",
... | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/independencies/Independencies.py#L135-L239 | [
"def",
"closure",
"(",
"self",
")",
":",
"def",
"single_var",
"(",
"var",
")",
":",
"\"Checks if var represents a single variable\"",
"if",
"not",
"hasattr",
"(",
"var",
",",
"'__iter__'",
")",
":",
"return",
"True",
"else",
":",
"return",
"len",
"(",
"var",... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | Independencies.entails | Returns `True` if the `entailed_independencies` are implied by this `Independencies`-object, otherwise `False`.
Entailment is checked using the semi-graphoid axioms.
Might be very slow if more than six variables are involved.
Parameters
----------
entailed_independencies: Indep... | pgmpy/independencies/Independencies.py | def entails(self, entailed_independencies):
"""
Returns `True` if the `entailed_independencies` are implied by this `Independencies`-object, otherwise `False`.
Entailment is checked using the semi-graphoid axioms.
Might be very slow if more than six variables are involved.
Para... | def entails(self, entailed_independencies):
"""
Returns `True` if the `entailed_independencies` are implied by this `Independencies`-object, otherwise `False`.
Entailment is checked using the semi-graphoid axioms.
Might be very slow if more than six variables are involved.
Para... | [
"Returns",
"True",
"if",
"the",
"entailed_independencies",
"are",
"implied",
"by",
"this",
"Independencies",
"-",
"object",
"otherwise",
"False",
".",
"Entailment",
"is",
"checked",
"using",
"the",
"semi",
"-",
"graphoid",
"axioms",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/independencies/Independencies.py#L241-L266 | [
"def",
"entails",
"(",
"self",
",",
"entailed_independencies",
")",
":",
"if",
"not",
"isinstance",
"(",
"entailed_independencies",
",",
"Independencies",
")",
":",
"return",
"False",
"implications",
"=",
"self",
".",
"closure",
"(",
")",
".",
"get_assertions",
... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | NaiveBayes.add_edge | Add an edge between u and v.
The nodes u and v will be automatically added if they are
not already in the graph
Parameters
----------
u,v : nodes
Nodes can be any hashable python object.
Examples
--------
>>> from pgmpy.models import Naive... | pgmpy/models/NaiveBayes.py | def add_edge(self, u, v, *kwargs):
"""
Add an edge between u and v.
The nodes u and v will be automatically added if they are
not already in the graph
Parameters
----------
u,v : nodes
Nodes can be any hashable python object.
Examples
... | def add_edge(self, u, v, *kwargs):
"""
Add an edge between u and v.
The nodes u and v will be automatically added if they are
not already in the graph
Parameters
----------
u,v : nodes
Nodes can be any hashable python object.
Examples
... | [
"Add",
"an",
"edge",
"between",
"u",
"and",
"v",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/NaiveBayes.py#L70-L97 | [
"def",
"add_edge",
"(",
"self",
",",
"u",
",",
"v",
",",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"parent_node",
"and",
"u",
"!=",
"self",
".",
"parent_node",
":",
"raise",
"ValueError",
"(",
"\"Model can have only one parent node.\"",
")",
"self",
".",... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | NaiveBayes._get_ancestors_of | Returns a list of all ancestors of all the observed nodes.
Parameters
----------
obs_nodes_list: string, list-type
name of all the observed nodes | pgmpy/models/NaiveBayes.py | def _get_ancestors_of(self, obs_nodes_list):
"""
Returns a list of all ancestors of all the observed nodes.
Parameters
----------
obs_nodes_list: string, list-type
name of all the observed nodes
"""
if not obs_nodes_list:
return set()
... | def _get_ancestors_of(self, obs_nodes_list):
"""
Returns a list of all ancestors of all the observed nodes.
Parameters
----------
obs_nodes_list: string, list-type
name of all the observed nodes
"""
if not obs_nodes_list:
return set()
... | [
"Returns",
"a",
"list",
"of",
"all",
"ancestors",
"of",
"all",
"the",
"observed",
"nodes",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/NaiveBayes.py#L99-L110 | [
"def",
"_get_ancestors_of",
"(",
"self",
",",
"obs_nodes_list",
")",
":",
"if",
"not",
"obs_nodes_list",
":",
"return",
"set",
"(",
")",
"return",
"set",
"(",
"obs_nodes_list",
")",
"|",
"set",
"(",
"self",
".",
"parent_node",
")"
] | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | NaiveBayes.active_trail_nodes | Returns all the nodes reachable from start via an active trail.
Parameters
----------
start: Graph node
observed : List of nodes (optional)
If given the active trail would be computed assuming these nodes to be observed.
Examples
--------
>>> from p... | pgmpy/models/NaiveBayes.py | def active_trail_nodes(self, start, observed=None):
"""
Returns all the nodes reachable from start via an active trail.
Parameters
----------
start: Graph node
observed : List of nodes (optional)
If given the active trail would be computed assuming these nod... | def active_trail_nodes(self, start, observed=None):
"""
Returns all the nodes reachable from start via an active trail.
Parameters
----------
start: Graph node
observed : List of nodes (optional)
If given the active trail would be computed assuming these nod... | [
"Returns",
"all",
"the",
"nodes",
"reachable",
"from",
"start",
"via",
"an",
"active",
"trail",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/NaiveBayes.py#L112-L140 | [
"def",
"active_trail_nodes",
"(",
"self",
",",
"start",
",",
"observed",
"=",
"None",
")",
":",
"if",
"observed",
"and",
"self",
".",
"parent_node",
"in",
"observed",
":",
"return",
"set",
"(",
"start",
")",
"else",
":",
"return",
"set",
"(",
"self",
"... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | NaiveBayes.local_independencies | Returns an instance of Independencies containing the local independencies
of each of the variables.
Parameters
----------
variables: str or array like
variables whose local independencies are to found.
Examples
--------
>>> from pgmpy.models import ... | pgmpy/models/NaiveBayes.py | def local_independencies(self, variables):
"""
Returns an instance of Independencies containing the local independencies
of each of the variables.
Parameters
----------
variables: str or array like
variables whose local independencies are to found.
... | def local_independencies(self, variables):
"""
Returns an instance of Independencies containing the local independencies
of each of the variables.
Parameters
----------
variables: str or array like
variables whose local independencies are to found.
... | [
"Returns",
"an",
"instance",
"of",
"Independencies",
"containing",
"the",
"local",
"independencies",
"of",
"each",
"of",
"the",
"variables",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/NaiveBayes.py#L142-L168 | [
"def",
"local_independencies",
"(",
"self",
",",
"variables",
")",
":",
"independencies",
"=",
"Independencies",
"(",
")",
"for",
"variable",
"in",
"[",
"variables",
"]",
"if",
"isinstance",
"(",
"variables",
",",
"str",
")",
"else",
"variables",
":",
"if",
... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | NaiveBayes.fit | Computes the CPD for each node from a given data in the form of a pandas dataframe.
If a variable from the data is not present in the model, it adds that node into the model.
Parameters
----------
data : pandas DataFrame object
A DataFrame object with column names same as th... | pgmpy/models/NaiveBayes.py | def fit(self, data, parent_node=None, estimator=None):
"""
Computes the CPD for each node from a given data in the form of a pandas dataframe.
If a variable from the data is not present in the model, it adds that node into the model.
Parameters
----------
data : pandas D... | def fit(self, data, parent_node=None, estimator=None):
"""
Computes the CPD for each node from a given data in the form of a pandas dataframe.
If a variable from the data is not present in the model, it adds that node into the model.
Parameters
----------
data : pandas D... | [
"Computes",
"the",
"CPD",
"for",
"each",
"node",
"from",
"a",
"given",
"data",
"in",
"the",
"form",
"of",
"a",
"pandas",
"dataframe",
".",
"If",
"a",
"variable",
"from",
"the",
"data",
"is",
"not",
"present",
"in",
"the",
"model",
"it",
"adds",
"that",... | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/models/NaiveBayes.py#L170-L216 | [
"def",
"fit",
"(",
"self",
",",
"data",
",",
"parent_node",
"=",
"None",
",",
"estimator",
"=",
"None",
")",
":",
"if",
"not",
"parent_node",
":",
"if",
"not",
"self",
".",
"parent_node",
":",
"raise",
"ValueError",
"(",
"\"parent node must be specified for ... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | StructureScore.score | Computes a score to measure how well the given `BayesianModel` fits to the data set.
(This method relies on the `local_score`-method that is implemented in each subclass.)
Parameters
----------
model: `BayesianModel` instance
The Bayesian network that is to be scored. Nodes ... | pgmpy/estimators/StructureScore.py | def score(self, model):
"""
Computes a score to measure how well the given `BayesianModel` fits to the data set.
(This method relies on the `local_score`-method that is implemented in each subclass.)
Parameters
----------
model: `BayesianModel` instance
The B... | def score(self, model):
"""
Computes a score to measure how well the given `BayesianModel` fits to the data set.
(This method relies on the `local_score`-method that is implemented in each subclass.)
Parameters
----------
model: `BayesianModel` instance
The B... | [
"Computes",
"a",
"score",
"to",
"measure",
"how",
"well",
"the",
"given",
"BayesianModel",
"fits",
"to",
"the",
"data",
"set",
".",
"(",
"This",
"method",
"relies",
"on",
"the",
"local_score",
"-",
"method",
"that",
"is",
"implemented",
"in",
"each",
"subc... | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/estimators/StructureScore.py#L38-L72 | [
"def",
"score",
"(",
"self",
",",
"model",
")",
":",
"score",
"=",
"0",
"for",
"node",
"in",
"model",
".",
"nodes",
"(",
")",
":",
"score",
"+=",
"self",
".",
"local_score",
"(",
"node",
",",
"model",
".",
"predecessors",
"(",
"node",
")",
")",
"... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | BicScore.local_score | Computes a score that measures how much a \
given variable is \"influenced\" by a given list of potential parents. | pgmpy/estimators/BicScore.py | def local_score(self, variable, parents):
"Computes a score that measures how much a \
given variable is \"influenced\" by a given list of potential parents."
var_states = self.state_names[variable]
var_cardinality = len(var_states)
state_counts = self.state_counts(variable, par... | def local_score(self, variable, parents):
"Computes a score that measures how much a \
given variable is \"influenced\" by a given list of potential parents."
var_states = self.state_names[variable]
var_cardinality = len(var_states)
state_counts = self.state_counts(variable, par... | [
"Computes",
"a",
"score",
"that",
"measures",
"how",
"much",
"a",
"\\",
"given",
"variable",
"is",
"\\",
"influenced",
"\\",
"by",
"a",
"given",
"list",
"of",
"potential",
"parents",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/estimators/BicScore.py#L43-L64 | [
"def",
"local_score",
"(",
"self",
",",
"variable",
",",
"parents",
")",
":",
"var_states",
"=",
"self",
".",
"state_names",
"[",
"variable",
"]",
"var_cardinality",
"=",
"len",
"(",
"var_states",
")",
"state_counts",
"=",
"self",
".",
"state_counts",
"(",
... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | cartesian | Generate a cartesian product of input arrays.
Parameters
----------
arrays : list of array-like
1-D arrays to form the cartesian product of.
out : ndarray
Array to place the cartesian product in.
Returns
-------
out : ndarray
2-D array of shape (M, len(arrays)) cont... | pgmpy/utils/mathext.py | def cartesian(arrays, out=None):
"""Generate a cartesian product of input arrays.
Parameters
----------
arrays : list of array-like
1-D arrays to form the cartesian product of.
out : ndarray
Array to place the cartesian product in.
Returns
-------
out : ndarray
... | def cartesian(arrays, out=None):
"""Generate a cartesian product of input arrays.
Parameters
----------
arrays : list of array-like
1-D arrays to form the cartesian product of.
out : ndarray
Array to place the cartesian product in.
Returns
-------
out : ndarray
... | [
"Generate",
"a",
"cartesian",
"product",
"of",
"input",
"arrays",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/utils/mathext.py#L11-L57 | [
"def",
"cartesian",
"(",
"arrays",
",",
"out",
"=",
"None",
")",
":",
"arrays",
"=",
"[",
"np",
".",
"asarray",
"(",
"x",
")",
"for",
"x",
"in",
"arrays",
"]",
"shape",
"=",
"(",
"len",
"(",
"x",
")",
"for",
"x",
"in",
"arrays",
")",
"dtype",
... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | sample_discrete | Generate a sample of given size, given a probability mass function.
Parameters
----------
values: numpy.array: Array of all possible values that the random variable
can take.
weights: numpy.array or list of numpy.array: Array(s) representing the PMF of the random variable.
size: int: Si... | pgmpy/utils/mathext.py | def sample_discrete(values, weights, size=1):
"""
Generate a sample of given size, given a probability mass function.
Parameters
----------
values: numpy.array: Array of all possible values that the random variable
can take.
weights: numpy.array or list of numpy.array: Array(s) repr... | def sample_discrete(values, weights, size=1):
"""
Generate a sample of given size, given a probability mass function.
Parameters
----------
values: numpy.array: Array of all possible values that the random variable
can take.
weights: numpy.array or list of numpy.array: Array(s) repr... | [
"Generate",
"a",
"sample",
"of",
"given",
"size",
"given",
"a",
"probability",
"mass",
"function",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/utils/mathext.py#L60-L89 | [
"def",
"sample_discrete",
"(",
"values",
",",
"weights",
",",
"size",
"=",
"1",
")",
":",
"weights",
"=",
"np",
".",
"array",
"(",
"weights",
")",
"if",
"weights",
".",
"ndim",
"==",
"1",
":",
"return",
"np",
".",
"random",
".",
"choice",
"(",
"val... | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | powerset | Generates all subsets of list `l` (as tuples).
Example
-------
>>> from pgmpy.utils.mathext import powerset
>>> list(powerset([1,2,3]))
[(), (1,), (2,), (3,), (1,2), (1,3), (2,3), (1,2,3)] | pgmpy/utils/mathext.py | def powerset(l):
"""
Generates all subsets of list `l` (as tuples).
Example
-------
>>> from pgmpy.utils.mathext import powerset
>>> list(powerset([1,2,3]))
[(), (1,), (2,), (3,), (1,2), (1,3), (2,3), (1,2,3)]
"""
return chain.from_iterable(combinations(l, r) for r in range(len(l)+1... | def powerset(l):
"""
Generates all subsets of list `l` (as tuples).
Example
-------
>>> from pgmpy.utils.mathext import powerset
>>> list(powerset([1,2,3]))
[(), (1,), (2,), (3,), (1,2), (1,3), (2,3), (1,2,3)]
"""
return chain.from_iterable(combinations(l, r) for r in range(len(l)+1... | [
"Generates",
"all",
"subsets",
"of",
"list",
"l",
"(",
"as",
"tuples",
")",
"."
] | pgmpy/pgmpy | python | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/utils/mathext.py#L92-L102 | [
"def",
"powerset",
"(",
"l",
")",
":",
"return",
"chain",
".",
"from_iterable",
"(",
"combinations",
"(",
"l",
",",
"r",
")",
"for",
"r",
"in",
"range",
"(",
"len",
"(",
"l",
")",
"+",
"1",
")",
")"
] | 9381a66aba3c3871d3ccd00672b148d17d63239e |
train | clean_draft_pages_from_space | Remove draft pages from space using datetime.now
:param confluence:
:param space_key:
:param count:
:param date_now:
:return: int counter | examples/confluence-draft-page-cleaner.py | def clean_draft_pages_from_space(confluence, space_key, count, date_now):
"""
Remove draft pages from space using datetime.now
:param confluence:
:param space_key:
:param count:
:param date_now:
:return: int counter
"""
pages = confluence.get_all_draft_pages_from_space(space=space_ke... | def clean_draft_pages_from_space(confluence, space_key, count, date_now):
"""
Remove draft pages from space using datetime.now
:param confluence:
:param space_key:
:param count:
:param date_now:
:return: int counter
"""
pages = confluence.get_all_draft_pages_from_space(space=space_ke... | [
"Remove",
"draft",
"pages",
"from",
"space",
"using",
"datetime",
".",
"now",
":",
"param",
"confluence",
":",
":",
"param",
"space_key",
":",
":",
"param",
"count",
":",
":",
"param",
"date_now",
":",
":",
"return",
":",
"int",
"counter"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/examples/confluence-draft-page-cleaner.py#L13-L33 | [
"def",
"clean_draft_pages_from_space",
"(",
"confluence",
",",
"space_key",
",",
"count",
",",
"date_now",
")",
":",
"pages",
"=",
"confluence",
".",
"get_all_draft_pages_from_space",
"(",
"space",
"=",
"space_key",
",",
"start",
"=",
"0",
",",
"limit",
"=",
"... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | clean_all_draft_pages_from_all_spaces | Remove all draft pages for all spaces older than DRAFT_DAYS
:param days: int
:param confluence:
:return: | examples/confluence-draft-page-cleaner.py | def clean_all_draft_pages_from_all_spaces(confluence, days=30):
"""
Remove all draft pages for all spaces older than DRAFT_DAYS
:param days: int
:param confluence:
:return:
"""
date_now = datetime.datetime.now()
count = 0
limit = 50
flag = True
i = 0
while flag:
s... | def clean_all_draft_pages_from_all_spaces(confluence, days=30):
"""
Remove all draft pages for all spaces older than DRAFT_DAYS
:param days: int
:param confluence:
:return:
"""
date_now = datetime.datetime.now()
count = 0
limit = 50
flag = True
i = 0
while flag:
s... | [
"Remove",
"all",
"draft",
"pages",
"for",
"all",
"spaces",
"older",
"than",
"DRAFT_DAYS",
":",
"param",
"days",
":",
"int",
":",
"param",
"confluence",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/examples/confluence-draft-page-cleaner.py#L36-L58 | [
"def",
"clean_all_draft_pages_from_all_spaces",
"(",
"confluence",
",",
"days",
"=",
"30",
")",
":",
"date_now",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
"count",
"=",
"0",
"limit",
"=",
"50",
"flag",
"=",
"True",
"i",
"=",
"0",
"while",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_page_child_by_type | Provide content by type (page, blog, comment)
:param page_id: A string containing the id of the type content container.
:param type:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: how many items should be returned after the... | atlassian/confluence.py | def get_page_child_by_type(self, page_id, type='page', start=None, limit=None):
"""
Provide content by type (page, blog, comment)
:param page_id: A string containing the id of the type content container.
:param type:
:param start: OPTIONAL: The start point of the collection to re... | def get_page_child_by_type(self, page_id, type='page', start=None, limit=None):
"""
Provide content by type (page, blog, comment)
:param page_id: A string containing the id of the type content container.
:param type:
:param start: OPTIONAL: The start point of the collection to re... | [
"Provide",
"content",
"by",
"type",
"(",
"page",
"blog",
"comment",
")",
":",
"param",
"page_id",
":",
"A",
"string",
"containing",
"the",
"id",
"of",
"the",
"type",
"content",
"container",
".",
":",
"param",
"type",
":",
":",
"param",
"start",
":",
"O... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L33-L54 | [
"def",
"get_page_child_by_type",
"(",
"self",
",",
"page_id",
",",
"type",
"=",
"'page'",
",",
"start",
"=",
"None",
",",
"limit",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"start",
"is",
"not",
"None",
":",
"params",
"[",
"'start'",
"]",... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_page_by_title | Returns the list of labels on a piece of Content.
:param space: Space key
:param title: Title of the page
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of labels to return, this may be restricted by... | atlassian/confluence.py | def get_page_by_title(self, space, title, start=None, limit=None):
"""
Returns the list of labels on a piece of Content.
:param space: Space key
:param title: Title of the page
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param ... | def get_page_by_title(self, space, title, start=None, limit=None):
"""
Returns the list of labels on a piece of Content.
:param space: Space key
:param title: Title of the page
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param ... | [
"Returns",
"the",
"list",
"of",
"labels",
"on",
"a",
"piece",
"of",
"Content",
".",
":",
"param",
"space",
":",
"Space",
"key",
":",
"param",
"title",
":",
"Title",
"of",
"the",
"page",
":",
"param",
"start",
":",
"OPTIONAL",
":",
"The",
"start",
"po... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L81-L107 | [
"def",
"get_page_by_title",
"(",
"self",
",",
"space",
",",
"title",
",",
"start",
"=",
"None",
",",
"limit",
"=",
"None",
")",
":",
"url",
"=",
"'rest/api/content'",
"params",
"=",
"{",
"}",
"if",
"start",
"is",
"not",
"None",
":",
"params",
"[",
"'... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_page_by_id | Get page by ID
:param page_id: Content ID
:param expand: OPTIONAL: expand e.g. history
:return: | atlassian/confluence.py | def get_page_by_id(self, page_id, expand=None):
"""
Get page by ID
:param page_id: Content ID
:param expand: OPTIONAL: expand e.g. history
:return:
"""
url = 'rest/api/content/{page_id}?expand={expand}'.format(page_id=page_id, expand=expand)
return self.ge... | def get_page_by_id(self, page_id, expand=None):
"""
Get page by ID
:param page_id: Content ID
:param expand: OPTIONAL: expand e.g. history
:return:
"""
url = 'rest/api/content/{page_id}?expand={expand}'.format(page_id=page_id, expand=expand)
return self.ge... | [
"Get",
"page",
"by",
"ID",
":",
"param",
"page_id",
":",
"Content",
"ID",
":",
"param",
"expand",
":",
"OPTIONAL",
":",
"expand",
"e",
".",
"g",
".",
"history",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L109-L117 | [
"def",
"get_page_by_id",
"(",
"self",
",",
"page_id",
",",
"expand",
"=",
"None",
")",
":",
"url",
"=",
"'rest/api/content/{page_id}?expand={expand}'",
".",
"format",
"(",
"page_id",
"=",
"page_id",
",",
"expand",
"=",
"expand",
")",
"return",
"self",
".",
"... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_page_labels | Returns the list of labels on a piece of Content.
:param page_id: A string containing the id of the labels content container.
:param prefix: OPTIONAL: The prefixes to filter the labels with {@see Label.Prefix}.
Default: None.
:param start: OPTIONAL: The start poin... | atlassian/confluence.py | def get_page_labels(self, page_id, prefix=None, start=None, limit=None):
"""
Returns the list of labels on a piece of Content.
:param page_id: A string containing the id of the labels content container.
:param prefix: OPTIONAL: The prefixes to filter the labels with {@see Label.Prefix}.
... | def get_page_labels(self, page_id, prefix=None, start=None, limit=None):
"""
Returns the list of labels on a piece of Content.
:param page_id: A string containing the id of the labels content container.
:param prefix: OPTIONAL: The prefixes to filter the labels with {@see Label.Prefix}.
... | [
"Returns",
"the",
"list",
"of",
"labels",
"on",
"a",
"piece",
"of",
"Content",
".",
":",
"param",
"page_id",
":",
"A",
"string",
"containing",
"the",
"id",
"of",
"the",
"labels",
"content",
"container",
".",
":",
"param",
"prefix",
":",
"OPTIONAL",
":",
... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L119-L139 | [
"def",
"get_page_labels",
"(",
"self",
",",
"page_id",
",",
"prefix",
"=",
"None",
",",
"start",
"=",
"None",
",",
"limit",
"=",
"None",
")",
":",
"url",
"=",
"'rest/api/content/{id}/label'",
".",
"format",
"(",
"id",
"=",
"page_id",
")",
"params",
"=",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_draft_page_by_id | Provide content by id with status = draft
:param page_id:
:param status:
:return: | atlassian/confluence.py | def get_draft_page_by_id(self, page_id, status='draft'):
"""
Provide content by id with status = draft
:param page_id:
:param status:
:return:
"""
url = 'rest/api/content/{page_id}?status={status}'.format(page_id=page_id, status=status)
return self.get(url... | def get_draft_page_by_id(self, page_id, status='draft'):
"""
Provide content by id with status = draft
:param page_id:
:param status:
:return:
"""
url = 'rest/api/content/{page_id}?status={status}'.format(page_id=page_id, status=status)
return self.get(url... | [
"Provide",
"content",
"by",
"id",
"with",
"status",
"=",
"draft",
":",
"param",
"page_id",
":",
":",
"param",
"status",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L141-L149 | [
"def",
"get_draft_page_by_id",
"(",
"self",
",",
"page_id",
",",
"status",
"=",
"'draft'",
")",
":",
"url",
"=",
"'rest/api/content/{page_id}?status={status}'",
".",
"format",
"(",
"page_id",
"=",
"page_id",
",",
"status",
"=",
"status",
")",
"return",
"self",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_all_pages_by_label | Get all page by label
:param label:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
fixed system limits. Default: 50
:return: | atlassian/confluence.py | def get_all_pages_by_label(self, label, start=0, limit=50):
"""
Get all page by label
:param label:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted b... | def get_all_pages_by_label(self, label, start=0, limit=50):
"""
Get all page by label
:param label:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted b... | [
"Get",
"all",
"page",
"by",
"label",
":",
"param",
"label",
":",
":",
"param",
"start",
":",
"OPTIONAL",
":",
"The",
"start",
"point",
"of",
"the",
"collection",
"to",
"return",
".",
"Default",
":",
"None",
"(",
"0",
")",
".",
":",
"param",
"limit",
... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L151-L169 | [
"def",
"get_all_pages_by_label",
"(",
"self",
",",
"label",
",",
"start",
"=",
"0",
",",
"limit",
"=",
"50",
")",
":",
"url",
"=",
"'rest/api/content/search'",
"params",
"=",
"{",
"}",
"if",
"label",
":",
"params",
"[",
"'cql'",
"]",
"=",
"'type={type}%2... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_all_pages_from_space | Get all pages from space
:param space:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
fixed system limits. Default: 50
:param... | atlassian/confluence.py | def get_all_pages_from_space(self, space, start=0, limit=500, status=None):
"""
Get all pages from space
:param space:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of pages to return, this ... | def get_all_pages_from_space(self, space, start=0, limit=500, status=None):
"""
Get all pages from space
:param space:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of pages to return, this ... | [
"Get",
"all",
"pages",
"from",
"space",
":",
"param",
"space",
":",
":",
"param",
"start",
":",
"OPTIONAL",
":",
"The",
"start",
"point",
"of",
"the",
"collection",
"to",
"return",
".",
"Default",
":",
"None",
"(",
"0",
")",
".",
":",
"param",
"limit... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L171-L191 | [
"def",
"get_all_pages_from_space",
"(",
"self",
",",
"space",
",",
"start",
"=",
"0",
",",
"limit",
"=",
"500",
",",
"status",
"=",
"None",
")",
":",
"url",
"=",
"'rest/api/content'",
"params",
"=",
"{",
"}",
"if",
"space",
":",
"params",
"[",
"'spaceK... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_all_pages_from_space_trash | Get list of pages from trash
:param space:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
fixed system limits. Default: 500
:... | atlassian/confluence.py | def get_all_pages_from_space_trash(self, space, start=0, limit=500, status='trashed'):
"""
Get list of pages from trash
:param space:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of pages t... | def get_all_pages_from_space_trash(self, space, start=0, limit=500, status='trashed'):
"""
Get list of pages from trash
:param space:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of pages t... | [
"Get",
"list",
"of",
"pages",
"from",
"trash",
":",
"param",
"space",
":",
":",
"param",
"start",
":",
"OPTIONAL",
":",
"The",
"start",
"point",
"of",
"the",
"collection",
"to",
"return",
".",
"Default",
":",
"None",
"(",
"0",
")",
".",
":",
"param",... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L193-L203 | [
"def",
"get_all_pages_from_space_trash",
"(",
"self",
",",
"space",
",",
"start",
"=",
"0",
",",
"limit",
"=",
"500",
",",
"status",
"=",
"'trashed'",
")",
":",
"return",
"self",
".",
"get_all_pages_from_space",
"(",
"space",
",",
"start",
",",
"limit",
",... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_all_draft_pages_from_space | Get list of draft pages from space
Use case is cleanup old drafts from Confluence
:param space:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
... | atlassian/confluence.py | def get_all_draft_pages_from_space(self, space, start=0, limit=500, status='draft'):
"""
Get list of draft pages from space
Use case is cleanup old drafts from Confluence
:param space:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
... | def get_all_draft_pages_from_space(self, space, start=0, limit=500, status='draft'):
"""
Get list of draft pages from space
Use case is cleanup old drafts from Confluence
:param space:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
... | [
"Get",
"list",
"of",
"draft",
"pages",
"from",
"space",
"Use",
"case",
"is",
"cleanup",
"old",
"drafts",
"from",
"Confluence",
":",
"param",
"space",
":",
":",
"param",
"start",
":",
"OPTIONAL",
":",
"The",
"start",
"point",
"of",
"the",
"collection",
"t... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L205-L216 | [
"def",
"get_all_draft_pages_from_space",
"(",
"self",
",",
"space",
",",
"start",
"=",
"0",
",",
"limit",
"=",
"500",
",",
"status",
"=",
"'draft'",
")",
":",
"return",
"self",
".",
"get_all_pages_from_space",
"(",
"space",
",",
"start",
",",
"limit",
",",... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_all_draft_pages_from_space_through_cql | Search list of draft pages by space key
Use case is cleanup old drafts from Confluence
:param space: Space Key
:param status: Can be changed
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of ... | atlassian/confluence.py | def get_all_draft_pages_from_space_through_cql(self, space, start=0, limit=500, status='draft'):
"""
Search list of draft pages by space key
Use case is cleanup old drafts from Confluence
:param space: Space Key
:param status: Can be changed
:param start: OPTIONAL: The st... | def get_all_draft_pages_from_space_through_cql(self, space, start=0, limit=500, status='draft'):
"""
Search list of draft pages by space key
Use case is cleanup old drafts from Confluence
:param space: Space Key
:param status: Can be changed
:param start: OPTIONAL: The st... | [
"Search",
"list",
"of",
"draft",
"pages",
"by",
"space",
"key",
"Use",
"case",
"is",
"cleanup",
"old",
"drafts",
"from",
"Confluence",
":",
"param",
"space",
":",
"Space",
"Key",
":",
"param",
"status",
":",
"Can",
"be",
"changed",
":",
"param",
"start",... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L218-L236 | [
"def",
"get_all_draft_pages_from_space_through_cql",
"(",
"self",
",",
"space",
",",
"start",
"=",
"0",
",",
"limit",
"=",
"500",
",",
"status",
"=",
"'draft'",
")",
":",
"url",
"=",
"'rest/api/content?cql=space=spaceKey={space} and status={status}'",
".",
"format",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.remove_page | This method removes a page, if it has recursive flag, method removes including child pages
:param page_id:
:param status: OPTIONAL: type of page
:param recursive: OPTIONAL: if True - will recursively delete all children pages too
:return: | atlassian/confluence.py | def remove_page(self, page_id, status=None, recursive=False):
"""
This method removes a page, if it has recursive flag, method removes including child pages
:param page_id:
:param status: OPTIONAL: type of page
:param recursive: OPTIONAL: if True - will recursively delete all chi... | def remove_page(self, page_id, status=None, recursive=False):
"""
This method removes a page, if it has recursive flag, method removes including child pages
:param page_id:
:param status: OPTIONAL: type of page
:param recursive: OPTIONAL: if True - will recursively delete all chi... | [
"This",
"method",
"removes",
"a",
"page",
"if",
"it",
"has",
"recursive",
"flag",
"method",
"removes",
"including",
"child",
"pages",
":",
"param",
"page_id",
":",
":",
"param",
"status",
":",
"OPTIONAL",
":",
"type",
"of",
"page",
":",
"param",
"recursive... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L263-L279 | [
"def",
"remove_page",
"(",
"self",
",",
"page_id",
",",
"status",
"=",
"None",
",",
"recursive",
"=",
"False",
")",
":",
"url",
"=",
"'rest/api/content/{page_id}'",
".",
"format",
"(",
"page_id",
"=",
"page_id",
")",
"if",
"recursive",
":",
"children_pages",... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.create_page | Create page from scratch
:param space:
:param title:
:param body:
:param parent_id:
:param type:
:return: | atlassian/confluence.py | def create_page(self, space, title, body, parent_id=None, type='page'):
"""
Create page from scratch
:param space:
:param title:
:param body:
:param parent_id:
:param type:
:return:
"""
log.info('Creating {type} "{space}" -> "{title}"'.form... | def create_page(self, space, title, body, parent_id=None, type='page'):
"""
Create page from scratch
:param space:
:param title:
:param body:
:param parent_id:
:param type:
:return:
"""
log.info('Creating {type} "{space}" -> "{title}"'.form... | [
"Create",
"page",
"from",
"scratch",
":",
"param",
"space",
":",
":",
"param",
"title",
":",
":",
"param",
"body",
":",
":",
"param",
"parent_id",
":",
":",
"param",
"type",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L281-L302 | [
"def",
"create_page",
"(",
"self",
",",
"space",
",",
"title",
",",
"body",
",",
"parent_id",
"=",
"None",
",",
"type",
"=",
"'page'",
")",
":",
"log",
".",
"info",
"(",
"'Creating {type} \"{space}\" -> \"{title}\"'",
".",
"format",
"(",
"space",
"=",
"spa... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_all_spaces | Get all spaces with provided limit
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
fixed system limits. Default: 500 | atlassian/confluence.py | def get_all_spaces(self, start=0, limit=500):
"""
Get all spaces with provided limit
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
... | def get_all_spaces(self, start=0, limit=500):
"""
Get all spaces with provided limit
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
... | [
"Get",
"all",
"spaces",
"with",
"provided",
"limit",
":",
"param",
"start",
":",
"OPTIONAL",
":",
"The",
"start",
"point",
"of",
"the",
"collection",
"to",
"return",
".",
"Default",
":",
"None",
"(",
"0",
")",
".",
":",
"param",
"limit",
":",
"OPTIONAL... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L304-L317 | [
"def",
"get_all_spaces",
"(",
"self",
",",
"start",
"=",
"0",
",",
"limit",
"=",
"500",
")",
":",
"url",
"=",
"'rest/api/space'",
"params",
"=",
"{",
"}",
"if",
"limit",
":",
"params",
"[",
"'limit'",
"]",
"=",
"limit",
"if",
"start",
":",
"params",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.add_comment | Add comment into page
:param page_id
:param text | atlassian/confluence.py | def add_comment(self, page_id, text):
"""
Add comment into page
:param page_id
:param text
"""
data = {'type': 'comment',
'container': {'id': page_id, 'type': 'page', 'status': 'current'},
'body': {'storage': {'value': text, 'representation... | def add_comment(self, page_id, text):
"""
Add comment into page
:param page_id
:param text
"""
data = {'type': 'comment',
'container': {'id': page_id, 'type': 'page', 'status': 'current'},
'body': {'storage': {'value': text, 'representation... | [
"Add",
"comment",
"into",
"page",
":",
"param",
"page_id",
":",
"param",
"text"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L319-L328 | [
"def",
"add_comment",
"(",
"self",
",",
"page_id",
",",
"text",
")",
":",
"data",
"=",
"{",
"'type'",
":",
"'comment'",
",",
"'container'",
":",
"{",
"'id'",
":",
"page_id",
",",
"'type'",
":",
"'page'",
",",
"'status'",
":",
"'current'",
"}",
",",
"... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.attach_file | Attach (upload) a file to a page, if it exists it will update the
automatically version the new file and keep the old one.
:param title: The page name
:type title: ``str``
:param space: The space name
:type space: ``str``
:param page_id: The page id to which we would li... | atlassian/confluence.py | def attach_file(self, filename, page_id=None, title=None, space=None, comment=None):
"""
Attach (upload) a file to a page, if it exists it will update the
automatically version the new file and keep the old one.
:param title: The page name
:type title: ``str``
:param spa... | def attach_file(self, filename, page_id=None, title=None, space=None, comment=None):
"""
Attach (upload) a file to a page, if it exists it will update the
automatically version the new file and keep the old one.
:param title: The page name
:type title: ``str``
:param spa... | [
"Attach",
"(",
"upload",
")",
"a",
"file",
"to",
"a",
"page",
"if",
"it",
"exists",
"it",
"will",
"update",
"the",
"automatically",
"version",
"the",
"new",
"file",
"and",
"keep",
"the",
"old",
"one",
".",
":",
"param",
"title",
":",
"The",
"page",
"... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L330-L372 | [
"def",
"attach_file",
"(",
"self",
",",
"filename",
",",
"page_id",
"=",
"None",
",",
"title",
"=",
"None",
",",
"space",
"=",
"None",
",",
"comment",
"=",
"None",
")",
":",
"page_id",
"=",
"self",
".",
"get_page_id",
"(",
"space",
"=",
"space",
",",... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.set_page_label | Set a label on the page
:param page_id: content_id format
:param label: label to add
:return: | atlassian/confluence.py | def set_page_label(self, page_id, label):
"""
Set a label on the page
:param page_id: content_id format
:param label: label to add
:return:
"""
url = 'rest/api/content/{page_id}/label'.format(page_id=page_id)
data = {'prefix': 'global',
'na... | def set_page_label(self, page_id, label):
"""
Set a label on the page
:param page_id: content_id format
:param label: label to add
:return:
"""
url = 'rest/api/content/{page_id}/label'.format(page_id=page_id)
data = {'prefix': 'global',
'na... | [
"Set",
"a",
"label",
"on",
"the",
"page",
":",
"param",
"page_id",
":",
"content_id",
"format",
":",
"param",
"label",
":",
"label",
"to",
"add",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L374-L384 | [
"def",
"set_page_label",
"(",
"self",
",",
"page_id",
",",
"label",
")",
":",
"url",
"=",
"'rest/api/content/{page_id}/label'",
".",
"format",
"(",
"page_id",
"=",
"page_id",
")",
"data",
"=",
"{",
"'prefix'",
":",
"'global'",
",",
"'name'",
":",
"label",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.remove_content_history | Remove content history. It works as experimental method
:param page_id:
:param version_number: version number
:return: | atlassian/confluence.py | def remove_content_history(self, page_id, version_number):
"""
Remove content history. It works as experimental method
:param page_id:
:param version_number: version number
:return:
"""
url = 'rest/experimental/content/{id}/version/{versionNumber}'.format(id=page_... | def remove_content_history(self, page_id, version_number):
"""
Remove content history. It works as experimental method
:param page_id:
:param version_number: version number
:return:
"""
url = 'rest/experimental/content/{id}/version/{versionNumber}'.format(id=page_... | [
"Remove",
"content",
"history",
".",
"It",
"works",
"as",
"experimental",
"method",
":",
"param",
"page_id",
":",
":",
"param",
"version_number",
":",
"version",
"number",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L397-L405 | [
"def",
"remove_content_history",
"(",
"self",
",",
"page_id",
",",
"version_number",
")",
":",
"url",
"=",
"'rest/experimental/content/{id}/version/{versionNumber}'",
".",
"format",
"(",
"id",
"=",
"page_id",
",",
"versionNumber",
"=",
"version_number",
")",
"self",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.remove_content_history_in_cloud | Remove content history. It works in CLOUD
:param page_id:
:param version_id:
:return: | atlassian/confluence.py | def remove_content_history_in_cloud(self, page_id, version_id):
"""
Remove content history. It works in CLOUD
:param page_id:
:param version_id:
:return:
"""
url = 'rest/api/content/{id}/version/{versionId}'.format(id=page_id, versionId=version_id)
self.de... | def remove_content_history_in_cloud(self, page_id, version_id):
"""
Remove content history. It works in CLOUD
:param page_id:
:param version_id:
:return:
"""
url = 'rest/api/content/{id}/version/{versionId}'.format(id=page_id, versionId=version_id)
self.de... | [
"Remove",
"content",
"history",
".",
"It",
"works",
"in",
"CLOUD",
":",
"param",
"page_id",
":",
":",
"param",
"version_id",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L407-L415 | [
"def",
"remove_content_history_in_cloud",
"(",
"self",
",",
"page_id",
",",
"version_id",
")",
":",
"url",
"=",
"'rest/api/content/{id}/version/{versionId}'",
".",
"format",
"(",
"id",
"=",
"page_id",
",",
"versionId",
"=",
"version_id",
")",
"self",
".",
"delete"... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.has_unknown_attachment_error | Check has unknown attachment error on page
:param page_id:
:return: | atlassian/confluence.py | def has_unknown_attachment_error(self, page_id):
"""
Check has unknown attachment error on page
:param page_id:
:return:
"""
unknown_attachment_identifier = 'plugins/servlet/confluence/placeholder/unknown-attachment'
result = self.get_page_by_id(page_id, expand='b... | def has_unknown_attachment_error(self, page_id):
"""
Check has unknown attachment error on page
:param page_id:
:return:
"""
unknown_attachment_identifier = 'plugins/servlet/confluence/placeholder/unknown-attachment'
result = self.get_page_by_id(page_id, expand='b... | [
"Check",
"has",
"unknown",
"attachment",
"error",
"on",
"page",
":",
"param",
"page_id",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L417-L430 | [
"def",
"has_unknown_attachment_error",
"(",
"self",
",",
"page_id",
")",
":",
"unknown_attachment_identifier",
"=",
"'plugins/servlet/confluence/placeholder/unknown-attachment'",
"result",
"=",
"self",
".",
"get_page_by_id",
"(",
"page_id",
",",
"expand",
"=",
"'body.view'"... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.is_page_content_is_already_updated | Compare content and check is already updated or not
:param page_id: Content ID for retrieve storage value
:param body: Body for compare it
:return: True if the same | atlassian/confluence.py | def is_page_content_is_already_updated(self, page_id, body):
"""
Compare content and check is already updated or not
:param page_id: Content ID for retrieve storage value
:param body: Body for compare it
:return: True if the same
"""
confluence_content = (self.get... | def is_page_content_is_already_updated(self, page_id, body):
"""
Compare content and check is already updated or not
:param page_id: Content ID for retrieve storage value
:param body: Body for compare it
:return: True if the same
"""
confluence_content = (self.get... | [
"Compare",
"content",
"and",
"check",
"is",
"already",
"updated",
"or",
"not",
":",
"param",
"page_id",
":",
"Content",
"ID",
"for",
"retrieve",
"storage",
"value",
":",
"param",
"body",
":",
"Body",
"for",
"compare",
"it",
":",
"return",
":",
"True",
"i... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L432-L451 | [
"def",
"is_page_content_is_already_updated",
"(",
"self",
",",
"page_id",
",",
"body",
")",
":",
"confluence_content",
"=",
"(",
"self",
".",
"get_page_by_id",
"(",
"page_id",
",",
"expand",
"=",
"'body.storage'",
")",
".",
"get",
"(",
"'body'",
")",
"or",
"... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.update_page | Update page if already exist
:param parent_id:
:param page_id:
:param title:
:param body:
:param type:
:param minor_edit: Indicates whether to notify watchers about changes.
If False then notifications will be sent.
:return: | atlassian/confluence.py | def update_page(self, parent_id, page_id, title, body, type='page',
minor_edit=False):
"""
Update page if already exist
:param parent_id:
:param page_id:
:param title:
:param body:
:param type:
:param minor_edit: Indicates whether to no... | def update_page(self, parent_id, page_id, title, body, type='page',
minor_edit=False):
"""
Update page if already exist
:param parent_id:
:param page_id:
:param title:
:param body:
:param type:
:param minor_edit: Indicates whether to no... | [
"Update",
"page",
"if",
"already",
"exist",
":",
"param",
"parent_id",
":",
":",
"param",
"page_id",
":",
":",
"param",
"title",
":",
":",
"param",
"body",
":",
":",
"param",
"type",
":",
":",
"param",
"minor_edit",
":",
"Indicates",
"whether",
"to",
"... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L453-L487 | [
"def",
"update_page",
"(",
"self",
",",
"parent_id",
",",
"page_id",
",",
"title",
",",
"body",
",",
"type",
"=",
"'page'",
",",
"minor_edit",
"=",
"False",
")",
":",
"log",
".",
"info",
"(",
"'Updating {type} \"{title}\"'",
".",
"format",
"(",
"title",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.update_or_create | Update page or create a page if it is not exists
:param parent_id:
:param title:
:param body:
:return: | atlassian/confluence.py | def update_or_create(self, parent_id, title, body):
"""
Update page or create a page if it is not exists
:param parent_id:
:param title:
:param body:
:return:
"""
space = self.get_page_space(parent_id)
if self.page_exists(space, title):
... | def update_or_create(self, parent_id, title, body):
"""
Update page or create a page if it is not exists
:param parent_id:
:param title:
:param body:
:return:
"""
space = self.get_page_space(parent_id)
if self.page_exists(space, title):
... | [
"Update",
"page",
"or",
"create",
"a",
"page",
"if",
"it",
"is",
"not",
"exists",
":",
"param",
"parent_id",
":",
":",
"param",
"title",
":",
":",
"param",
"body",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L489-L507 | [
"def",
"update_or_create",
"(",
"self",
",",
"parent_id",
",",
"title",
",",
"body",
")",
":",
"space",
"=",
"self",
".",
"get_page_space",
"(",
"parent_id",
")",
"if",
"self",
".",
"page_exists",
"(",
"space",
",",
"title",
")",
":",
"page_id",
"=",
"... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.set_page_property | Set the page (content) property e.g. add hash parameters
:param page_id: content_id format
:param data: data should be as json data
:return: | atlassian/confluence.py | def set_page_property(self, page_id, data):
"""
Set the page (content) property e.g. add hash parameters
:param page_id: content_id format
:param data: data should be as json data
:return:
"""
url = 'rest/api/content/{page_id}/property'.format(page_id=page_id)
... | def set_page_property(self, page_id, data):
"""
Set the page (content) property e.g. add hash parameters
:param page_id: content_id format
:param data: data should be as json data
:return:
"""
url = 'rest/api/content/{page_id}/property'.format(page_id=page_id)
... | [
"Set",
"the",
"page",
"(",
"content",
")",
"property",
"e",
".",
"g",
".",
"add",
"hash",
"parameters",
":",
"param",
"page_id",
":",
"content_id",
"format",
":",
"param",
"data",
":",
"data",
"should",
"be",
"as",
"json",
"data",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L529-L538 | [
"def",
"set_page_property",
"(",
"self",
",",
"page_id",
",",
"data",
")",
":",
"url",
"=",
"'rest/api/content/{page_id}/property'",
".",
"format",
"(",
"page_id",
"=",
"page_id",
")",
"json_data",
"=",
"data",
"return",
"self",
".",
"post",
"(",
"path",
"="... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.delete_page_property | Delete the page (content) property e.g. delete key of hash
:param page_id: content_id format
:param page_property: key of property
:return: | atlassian/confluence.py | def delete_page_property(self, page_id, page_property):
"""
Delete the page (content) property e.g. delete key of hash
:param page_id: content_id format
:param page_property: key of property
:return:
"""
url = 'rest/api/content/{page_id}/property/{page_property}'.... | def delete_page_property(self, page_id, page_property):
"""
Delete the page (content) property e.g. delete key of hash
:param page_id: content_id format
:param page_property: key of property
:return:
"""
url = 'rest/api/content/{page_id}/property/{page_property}'.... | [
"Delete",
"the",
"page",
"(",
"content",
")",
"property",
"e",
".",
"g",
".",
"delete",
"key",
"of",
"hash",
":",
"param",
"page_id",
":",
"content_id",
"format",
":",
"param",
"page_property",
":",
"key",
"of",
"property",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L540-L549 | [
"def",
"delete_page_property",
"(",
"self",
",",
"page_id",
",",
"page_property",
")",
":",
"url",
"=",
"'rest/api/content/{page_id}/property/{page_property}'",
".",
"format",
"(",
"page_id",
"=",
"page_id",
",",
"page_property",
"=",
"str",
"(",
"page_property",
")... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_page_property | Get the page (content) property e.g. get key of hash
:param page_id: content_id format
:param page_property_key: key of property
:return: | atlassian/confluence.py | def get_page_property(self, page_id, page_property_key):
"""
Get the page (content) property e.g. get key of hash
:param page_id: content_id format
:param page_property_key: key of property
:return:
"""
url = 'rest/api/content/{page_id}/property/{key}'.format(page... | def get_page_property(self, page_id, page_property_key):
"""
Get the page (content) property e.g. get key of hash
:param page_id: content_id format
:param page_property_key: key of property
:return:
"""
url = 'rest/api/content/{page_id}/property/{key}'.format(page... | [
"Get",
"the",
"page",
"(",
"content",
")",
"property",
"e",
".",
"g",
".",
"get",
"key",
"of",
"hash",
":",
"param",
"page_id",
":",
"content_id",
"format",
":",
"param",
"page_property_key",
":",
"key",
"of",
"property",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L551-L560 | [
"def",
"get_page_property",
"(",
"self",
",",
"page_id",
",",
"page_property_key",
")",
":",
"url",
"=",
"'rest/api/content/{page_id}/property/{key}'",
".",
"format",
"(",
"page_id",
"=",
"page_id",
",",
"key",
"=",
"str",
"(",
"page_property_key",
")",
")",
"re... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_page_properties | Get the page (content) properties
:param page_id: content_id format
:return: get properties | atlassian/confluence.py | def get_page_properties(self, page_id):
"""
Get the page (content) properties
:param page_id: content_id format
:return: get properties
"""
url = 'rest/api/content/{page_id}/property'.format(page_id=page_id)
return self.get(path=url) | def get_page_properties(self, page_id):
"""
Get the page (content) properties
:param page_id: content_id format
:return: get properties
"""
url = 'rest/api/content/{page_id}/property'.format(page_id=page_id)
return self.get(path=url) | [
"Get",
"the",
"page",
"(",
"content",
")",
"properties",
":",
"param",
"page_id",
":",
"content_id",
"format",
":",
"return",
":",
"get",
"properties"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L562-L569 | [
"def",
"get_page_properties",
"(",
"self",
",",
"page_id",
")",
":",
"url",
"=",
"'rest/api/content/{page_id}/property'",
".",
"format",
"(",
"page_id",
"=",
"page_id",
")",
"return",
"self",
".",
"get",
"(",
"path",
"=",
"url",
")"
] | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_page_ancestors | Provide the ancestors from the page (content) id
:param page_id: content_id format
:return: get properties | atlassian/confluence.py | def get_page_ancestors(self, page_id):
"""
Provide the ancestors from the page (content) id
:param page_id: content_id format
:return: get properties
"""
url = 'rest/api/content/{page_id}?expand=ancestors'.format(page_id=page_id)
return (self.get(path=url) or {}).... | def get_page_ancestors(self, page_id):
"""
Provide the ancestors from the page (content) id
:param page_id: content_id format
:return: get properties
"""
url = 'rest/api/content/{page_id}?expand=ancestors'.format(page_id=page_id)
return (self.get(path=url) or {}).... | [
"Provide",
"the",
"ancestors",
"from",
"the",
"page",
"(",
"content",
")",
"id",
":",
"param",
"page_id",
":",
"content_id",
"format",
":",
"return",
":",
"get",
"properties"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L571-L578 | [
"def",
"get_page_ancestors",
"(",
"self",
",",
"page_id",
")",
":",
"url",
"=",
"'rest/api/content/{page_id}?expand=ancestors'",
".",
"format",
"(",
"page_id",
"=",
"page_id",
")",
"return",
"(",
"self",
".",
"get",
"(",
"path",
"=",
"url",
")",
"or",
"{",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.clean_package_cache | Clean caches from cache management
e.g.
com.gliffy.cache.gon
org.hibernate.cache.internal.StandardQueryCache_v5 | atlassian/confluence.py | def clean_package_cache(self, cache_name='com.gliffy.cache.gon'):
""" Clean caches from cache management
e.g.
com.gliffy.cache.gon
org.hibernate.cache.internal.StandardQueryCache_v5
"""
headers = self.form_token_headers
data = {'cacheName': cache_name}... | def clean_package_cache(self, cache_name='com.gliffy.cache.gon'):
""" Clean caches from cache management
e.g.
com.gliffy.cache.gon
org.hibernate.cache.internal.StandardQueryCache_v5
"""
headers = self.form_token_headers
data = {'cacheName': cache_name}... | [
"Clean",
"caches",
"from",
"cache",
"management",
"e",
".",
"g",
".",
"com",
".",
"gliffy",
".",
"cache",
".",
"gon",
"org",
".",
"hibernate",
".",
"cache",
".",
"internal",
".",
"StandardQueryCache_v5"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L585-L593 | [
"def",
"clean_package_cache",
"(",
"self",
",",
"cache_name",
"=",
"'com.gliffy.cache.gon'",
")",
":",
"headers",
"=",
"self",
".",
"form_token_headers",
"data",
"=",
"{",
"'cacheName'",
":",
"cache_name",
"}",
"return",
"self",
".",
"delete",
"(",
"'rest/cacheM... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_all_groups | Get all groups from Confluence User management
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of groups to return, this may be restricted by
fixed system limits. Default: 1000
... | atlassian/confluence.py | def get_all_groups(self, start=0, limit=1000):
"""
Get all groups from Confluence User management
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of groups to return, this may be restricted by
... | def get_all_groups(self, start=0, limit=1000):
"""
Get all groups from Confluence User management
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of groups to return, this may be restricted by
... | [
"Get",
"all",
"groups",
"from",
"Confluence",
"User",
"management",
":",
"param",
"start",
":",
"OPTIONAL",
":",
"The",
"start",
"point",
"of",
"the",
"collection",
"to",
"return",
".",
"Default",
":",
"None",
"(",
"0",
")",
".",
":",
"param",
"limit",
... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L595-L606 | [
"def",
"get_all_groups",
"(",
"self",
",",
"start",
"=",
"0",
",",
"limit",
"=",
"1000",
")",
":",
"url",
"=",
"'rest/api/group?limit={limit}&start={start}'",
".",
"format",
"(",
"limit",
"=",
"limit",
",",
"start",
"=",
"start",
")",
"return",
"(",
"self"... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_group_members | Get a paginated collection of users in the given group
:param group_name
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit of the number of users to return, this may be restricted by
fixed system ... | atlassian/confluence.py | def get_group_members(self, group_name='confluence-users', start=0, limit=1000):
"""
Get a paginated collection of users in the given group
:param group_name
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit ... | def get_group_members(self, group_name='confluence-users', start=0, limit=1000):
"""
Get a paginated collection of users in the given group
:param group_name
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: The limit ... | [
"Get",
"a",
"paginated",
"collection",
"of",
"users",
"in",
"the",
"given",
"group",
":",
"param",
"group_name",
":",
"param",
"start",
":",
"OPTIONAL",
":",
"The",
"start",
"point",
"of",
"the",
"collection",
"to",
"return",
".",
"Default",
":",
"None",
... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L608-L620 | [
"def",
"get_group_members",
"(",
"self",
",",
"group_name",
"=",
"'confluence-users'",
",",
"start",
"=",
"0",
",",
"limit",
"=",
"1000",
")",
":",
"url",
"=",
"'rest/api/group/{group_name}/member?limit={limit}&start={start}'",
".",
"format",
"(",
"group_name",
"=",... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_space | Get information about a space through space key
:param space_key: The unique space key name
:param expand: OPTIONAL: additional info from description, homepage
:return: Returns the space along with its ID | atlassian/confluence.py | def get_space(self, space_key, expand='description.plain,homepage'):
"""
Get information about a space through space key
:param space_key: The unique space key name
:param expand: OPTIONAL: additional info from description, homepage
:return: Returns the space along with its ID
... | def get_space(self, space_key, expand='description.plain,homepage'):
"""
Get information about a space through space key
:param space_key: The unique space key name
:param expand: OPTIONAL: additional info from description, homepage
:return: Returns the space along with its ID
... | [
"Get",
"information",
"about",
"a",
"space",
"through",
"space",
"key",
":",
"param",
"space_key",
":",
"The",
"unique",
"space",
"key",
"name",
":",
"param",
"expand",
":",
"OPTIONAL",
":",
"additional",
"info",
"from",
"description",
"homepage",
":",
"retu... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L622-L631 | [
"def",
"get_space",
"(",
"self",
",",
"space_key",
",",
"expand",
"=",
"'description.plain,homepage'",
")",
":",
"url",
"=",
"'rest/api/space/{space_key}?expand={expand}'",
".",
"format",
"(",
"space_key",
"=",
"space_key",
",",
"expand",
"=",
"expand",
")",
"retu... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_user_details_by_username | Get information about a user through username
:param username: The user name
:param expand: OPTIONAL expand for get status of user.
Possible param is "status". Results are "Active, Deactivated"
:return: Returns the user details | atlassian/confluence.py | def get_user_details_by_username(self, username, expand=None):
"""
Get information about a user through username
:param username: The user name
:param expand: OPTIONAL expand for get status of user.
Possible param is "status". Results are "Active, Deactivated"
:re... | def get_user_details_by_username(self, username, expand=None):
"""
Get information about a user through username
:param username: The user name
:param expand: OPTIONAL expand for get status of user.
Possible param is "status". Results are "Active, Deactivated"
:re... | [
"Get",
"information",
"about",
"a",
"user",
"through",
"username",
":",
"param",
"username",
":",
"The",
"user",
"name",
":",
"param",
"expand",
":",
"OPTIONAL",
"expand",
"for",
"get",
"status",
"of",
"user",
".",
"Possible",
"param",
"is",
"status",
".",... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L633-L647 | [
"def",
"get_user_details_by_username",
"(",
"self",
",",
"username",
",",
"expand",
"=",
"None",
")",
":",
"if",
"expand",
":",
"url",
"=",
"'rest/api/user?username={username}&expand={expand}'",
".",
"format",
"(",
"username",
"=",
"username",
",",
"expand",
"=",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_user_details_by_userkey | Get information about a user through user key
:param userkey: The user key
:param expand: OPTIONAL expand for get status of user.
Possible param is "status". Results are "Active, Deactivated"
:return: Returns the user details | atlassian/confluence.py | def get_user_details_by_userkey(self, userkey, expand=None):
"""
Get information about a user through user key
:param userkey: The user key
:param expand: OPTIONAL expand for get status of user.
Possible param is "status". Results are "Active, Deactivated"
:return... | def get_user_details_by_userkey(self, userkey, expand=None):
"""
Get information about a user through user key
:param userkey: The user key
:param expand: OPTIONAL expand for get status of user.
Possible param is "status". Results are "Active, Deactivated"
:return... | [
"Get",
"information",
"about",
"a",
"user",
"through",
"user",
"key",
":",
"param",
"userkey",
":",
"The",
"user",
"key",
":",
"param",
"expand",
":",
"OPTIONAL",
"expand",
"for",
"get",
"status",
"of",
"user",
".",
"Possible",
"param",
"is",
"status",
"... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L649-L662 | [
"def",
"get_user_details_by_userkey",
"(",
"self",
",",
"userkey",
",",
"expand",
"=",
"None",
")",
":",
"if",
"expand",
":",
"url",
"=",
"'rest/api/user?key={userkey}&expand={expand}'",
".",
"format",
"(",
"userkey",
"=",
"userkey",
",",
"expand",
"=",
"expand"... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.cql | Get results from cql search result with all related fields
Search for entities in Confluence using the Confluence Query Language (CQL)
:param cql:
:param start: OPTIONAL: The start point of the collection to return. Default: 0.
:param limit: OPTIONAL: The limit of the number of issues to... | atlassian/confluence.py | def cql(self, cql, start=0, limit=None, expand=None, include_archived_spaces=None, excerpt=None):
"""
Get results from cql search result with all related fields
Search for entities in Confluence using the Confluence Query Language (CQL)
:param cql:
:param start: OPTIONAL: The sta... | def cql(self, cql, start=0, limit=None, expand=None, include_archived_spaces=None, excerpt=None):
"""
Get results from cql search result with all related fields
Search for entities in Confluence using the Confluence Query Language (CQL)
:param cql:
:param start: OPTIONAL: The sta... | [
"Get",
"results",
"from",
"cql",
"search",
"result",
"with",
"all",
"related",
"fields",
"Search",
"for",
"entities",
"in",
"Confluence",
"using",
"the",
"Confluence",
"Query",
"Language",
"(",
"CQL",
")",
":",
"param",
"cql",
":",
":",
"param",
"start",
"... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L664-L694 | [
"def",
"cql",
"(",
"self",
",",
"cql",
",",
"start",
"=",
"0",
",",
"limit",
"=",
"None",
",",
"expand",
"=",
"None",
",",
"include_archived_spaces",
"=",
"None",
",",
"excerpt",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"start",
"is",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_page_as_pdf | Export page as standard pdf exporter
:param page_id: Page ID
:return: PDF File | atlassian/confluence.py | def get_page_as_pdf(self, page_id):
"""
Export page as standard pdf exporter
:param page_id: Page ID
:return: PDF File
"""
headers = self.form_token_headers
url = 'spaces/flyingpdf/pdfpageexport.action?pageId={pageId}'.format(pageId=page_id)
return self.ge... | def get_page_as_pdf(self, page_id):
"""
Export page as standard pdf exporter
:param page_id: Page ID
:return: PDF File
"""
headers = self.form_token_headers
url = 'spaces/flyingpdf/pdfpageexport.action?pageId={pageId}'.format(pageId=page_id)
return self.ge... | [
"Export",
"page",
"as",
"standard",
"pdf",
"exporter",
":",
"param",
"page_id",
":",
"Page",
"ID",
":",
"return",
":",
"PDF",
"File"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L696-L704 | [
"def",
"get_page_as_pdf",
"(",
"self",
",",
"page_id",
")",
":",
"headers",
"=",
"self",
".",
"form_token_headers",
"url",
"=",
"'spaces/flyingpdf/pdfpageexport.action?pageId={pageId}'",
".",
"format",
"(",
"pageId",
"=",
"page_id",
")",
"return",
"self",
".",
"ge... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.get_descendant_page_id | Provide space, parent_id and title of the descendant page, it will return the descendant page_id
:param space: str
:param parent_id: int
:param title: str
:return: page_id of the page whose title is passed in argument | atlassian/confluence.py | def get_descendant_page_id(self, space, parent_id, title):
"""
Provide space, parent_id and title of the descendant page, it will return the descendant page_id
:param space: str
:param parent_id: int
:param title: str
:return: page_id of the page whose title is passed in... | def get_descendant_page_id(self, space, parent_id, title):
"""
Provide space, parent_id and title of the descendant page, it will return the descendant page_id
:param space: str
:param parent_id: int
:param title: str
:return: page_id of the page whose title is passed in... | [
"Provide",
"space",
"parent_id",
"and",
"title",
"of",
"the",
"descendant",
"page",
"it",
"will",
"return",
"the",
"descendant",
"page_id",
":",
"param",
"space",
":",
"str",
":",
"param",
"parent_id",
":",
"int",
":",
"param",
"title",
":",
"str",
":",
... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L714-L733 | [
"def",
"get_descendant_page_id",
"(",
"self",
",",
"space",
",",
"parent_id",
",",
"title",
")",
":",
"page_id",
"=",
"\"\"",
"url",
"=",
"'rest/api/content/search?cql=parent={}%20AND%20space=\"{}\"'",
".",
"format",
"(",
"parent_id",
",",
"space",
")",
"response",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Confluence.health_check | Get health status
https://confluence.atlassian.com/jirakb/how-to-retrieve-health-check-results-using-rest-api-867195158.html
:return: | atlassian/confluence.py | def health_check(self):
"""
Get health status
https://confluence.atlassian.com/jirakb/how-to-retrieve-health-check-results-using-rest-api-867195158.html
:return:
"""
# check as Troubleshooting & Support Tools Plugin
response = self.get('rest/troubleshooting/1.0/ch... | def health_check(self):
"""
Get health status
https://confluence.atlassian.com/jirakb/how-to-retrieve-health-check-results-using-rest-api-867195158.html
:return:
"""
# check as Troubleshooting & Support Tools Plugin
response = self.get('rest/troubleshooting/1.0/ch... | [
"Get",
"health",
"status",
"https",
":",
"//",
"confluence",
".",
"atlassian",
".",
"com",
"/",
"jirakb",
"/",
"how",
"-",
"to",
"-",
"retrieve",
"-",
"health",
"-",
"check",
"-",
"results",
"-",
"using",
"-",
"rest",
"-",
"api",
"-",
"867195158",
".... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/confluence.py#L751-L762 | [
"def",
"health_check",
"(",
"self",
")",
":",
"# check as Troubleshooting & Support Tools Plugin",
"response",
"=",
"self",
".",
"get",
"(",
"'rest/troubleshooting/1.0/check/'",
")",
"if",
"not",
"response",
":",
"# check as support tools",
"response",
"=",
"self",
".",... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.reindex | Reindex the Jira instance
Kicks off a reindex. Need Admin permissions to perform this reindex.
:param comments: Indicates that comments should also be reindexed. Not relevant for foreground reindex,
where comments are always reindexed.
:param change_history: Indicates that changeHistory ... | atlassian/jira.py | def reindex(self, comments=True, change_history=True, worklogs=True):
"""
Reindex the Jira instance
Kicks off a reindex. Need Admin permissions to perform this reindex.
:param comments: Indicates that comments should also be reindexed. Not relevant for foreground reindex,
where c... | def reindex(self, comments=True, change_history=True, worklogs=True):
"""
Reindex the Jira instance
Kicks off a reindex. Need Admin permissions to perform this reindex.
:param comments: Indicates that comments should also be reindexed. Not relevant for foreground reindex,
where c... | [
"Reindex",
"the",
"Jira",
"instance",
"Kicks",
"off",
"a",
"reindex",
".",
"Need",
"Admin",
"permissions",
"to",
"perform",
"this",
"reindex",
".",
":",
"param",
"comments",
":",
"Indicates",
"that",
"comments",
"should",
"also",
"be",
"reindexed",
".",
"Not... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L13-L32 | [
"def",
"reindex",
"(",
"self",
",",
"comments",
"=",
"True",
",",
"change_history",
"=",
"True",
",",
"worklogs",
"=",
"True",
")",
":",
"params",
"=",
"{",
"}",
"if",
"not",
"comments",
":",
"params",
"[",
"'indexComments'",
"]",
"=",
"comments",
"if"... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.jql | Get issues from jql search result with all related fields
:param jql:
:param fields: list of fields, for example: ['priority', 'summary', 'customfield_10007']
:param start: OPTIONAL: The start point of the collection to return. Default: 0.
:param limit: OPTIONAL: The limit of the number ... | atlassian/jira.py | def jql(self, jql, fields='*all', start=0, limit=None):
"""
Get issues from jql search result with all related fields
:param jql:
:param fields: list of fields, for example: ['priority', 'summary', 'customfield_10007']
:param start: OPTIONAL: The start point of the collection to ... | def jql(self, jql, fields='*all', start=0, limit=None):
"""
Get issues from jql search result with all related fields
:param jql:
:param fields: list of fields, for example: ['priority', 'summary', 'customfield_10007']
:param start: OPTIONAL: The start point of the collection to ... | [
"Get",
"issues",
"from",
"jql",
"search",
"result",
"with",
"all",
"related",
"fields",
":",
"param",
"jql",
":",
":",
"param",
"fields",
":",
"list",
"of",
"fields",
"for",
"example",
":",
"[",
"priority",
"summary",
"customfield_10007",
"]",
":",
"param"... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L55-L76 | [
"def",
"jql",
"(",
"self",
",",
"jql",
",",
"fields",
"=",
"'*all'",
",",
"start",
"=",
"0",
",",
"limit",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"start",
"is",
"not",
"None",
":",
"params",
"[",
"'startAt'",
"]",
"=",
"int",
"("... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.csv | Get issues from jql search result with all related fields
:param jql: JQL query
:param limit: max results in the output file
:return: CSV file | atlassian/jira.py | def csv(self, jql, limit=1000):
"""
Get issues from jql search result with all related fields
:param jql: JQL query
:param limit: max results in the output file
:return: CSV file
"""
url = 'sr/jira.issueviews:searchrequest-csv-all-fields/temp/SearchRequest.csv?tem... | def csv(self, jql, limit=1000):
"""
Get issues from jql search result with all related fields
:param jql: JQL query
:param limit: max results in the output file
:return: CSV file
"""
url = 'sr/jira.issueviews:searchrequest-csv-all-fields/temp/SearchRequest.csv?tem... | [
"Get",
"issues",
"from",
"jql",
"search",
"result",
"with",
"all",
"related",
"fields",
":",
"param",
"jql",
":",
"JQL",
"query",
":",
"param",
"limit",
":",
"max",
"results",
"in",
"the",
"output",
"file",
":",
"return",
":",
"CSV",
"file"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L78-L87 | [
"def",
"csv",
"(",
"self",
",",
"jql",
",",
"limit",
"=",
"1000",
")",
":",
"url",
"=",
"'sr/jira.issueviews:searchrequest-csv-all-fields/temp/SearchRequest.csv?tempMax={limit}&jqlQuery={jql}'",
".",
"format",
"(",
"limit",
"=",
"limit",
",",
"jql",
"=",
"jql",
")",... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.user_update | Update user attributes based on json
:param username:
:param data:
:return: | atlassian/jira.py | def user_update(self, username, data):
"""
Update user attributes based on json
:param username:
:param data:
:return:
"""
url = 'rest/api/2/user?username={0}'.format(username)
return self.put(url, data=data) | def user_update(self, username, data):
"""
Update user attributes based on json
:param username:
:param data:
:return:
"""
url = 'rest/api/2/user?username={0}'.format(username)
return self.put(url, data=data) | [
"Update",
"user",
"attributes",
"based",
"on",
"json",
":",
"param",
"username",
":",
":",
"param",
"data",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L100-L108 | [
"def",
"user_update",
"(",
"self",
",",
"username",
",",
"data",
")",
":",
"url",
"=",
"'rest/api/2/user?username={0}'",
".",
"format",
"(",
"username",
")",
"return",
"self",
".",
"put",
"(",
"url",
",",
"data",
"=",
"data",
")"
] | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.user_update_email | Update user email for new domain changes
:param username:
:param email:
:return: | atlassian/jira.py | def user_update_email(self, username, email):
"""
Update user email for new domain changes
:param username:
:param email:
:return:
"""
data = {'name': username, 'emailAddress': email}
return self.user_update(username, data=data) | def user_update_email(self, username, email):
"""
Update user email for new domain changes
:param username:
:param email:
:return:
"""
data = {'name': username, 'emailAddress': email}
return self.user_update(username, data=data) | [
"Update",
"user",
"email",
"for",
"new",
"domain",
"changes",
":",
"param",
"username",
":",
":",
"param",
"email",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L110-L118 | [
"def",
"user_update_email",
"(",
"self",
",",
"username",
",",
"email",
")",
":",
"data",
"=",
"{",
"'name'",
":",
"username",
",",
"'emailAddress'",
":",
"email",
"}",
"return",
"self",
".",
"user_update",
"(",
"username",
",",
"data",
"=",
"data",
")"
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.user_deactivate | Disable user
:param username:
:return: | atlassian/jira.py | def user_deactivate(self, username):
"""
Disable user
:param username:
:return:
"""
url = 'secure/admin/user/EditUser.jspa'
headers = self.form_token_headers
user = self.user(username)
user_update_info = {
'inline': 'true',
... | def user_deactivate(self, username):
"""
Disable user
:param username:
:return:
"""
url = 'secure/admin/user/EditUser.jspa'
headers = self.form_token_headers
user = self.user(username)
user_update_info = {
'inline': 'true',
... | [
"Disable",
"user",
":",
"param",
"username",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L120-L137 | [
"def",
"user_deactivate",
"(",
"self",
",",
"username",
")",
":",
"url",
"=",
"'secure/admin/user/EditUser.jspa'",
"headers",
"=",
"self",
".",
"form_token_headers",
"user",
"=",
"self",
".",
"user",
"(",
"username",
")",
"user_update_info",
"=",
"{",
"'inline'"... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.user_disable_throw_rest_endpoint | The disable method throw own rest enpoint | atlassian/jira.py | def user_disable_throw_rest_endpoint(self, username, url='rest/scriptrunner/latest/custom/disableUser',
param='userName'):
"""The disable method throw own rest enpoint"""
url = "{}?{}={}".format(url, param, username)
return self.get(path=url) | def user_disable_throw_rest_endpoint(self, username, url='rest/scriptrunner/latest/custom/disableUser',
param='userName'):
"""The disable method throw own rest enpoint"""
url = "{}?{}={}".format(url, param, username)
return self.get(path=url) | [
"The",
"disable",
"method",
"throw",
"own",
"rest",
"enpoint"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L143-L147 | [
"def",
"user_disable_throw_rest_endpoint",
"(",
"self",
",",
"username",
",",
"url",
"=",
"'rest/scriptrunner/latest/custom/disableUser'",
",",
"param",
"=",
"'userName'",
")",
":",
"url",
"=",
"\"{}?{}={}\"",
".",
"format",
"(",
"url",
",",
"param",
",",
"usernam... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.user_get_websudo | Get web sudo cookies using normal http request | atlassian/jira.py | def user_get_websudo(self):
""" Get web sudo cookies using normal http request"""
url = 'secure/admin/WebSudoAuthenticate.jspa'
headers = self.form_token_headers
data = {
'webSudoPassword': self.password,
}
return self.post(path=url, data=data, headers=headers... | def user_get_websudo(self):
""" Get web sudo cookies using normal http request"""
url = 'secure/admin/WebSudoAuthenticate.jspa'
headers = self.form_token_headers
data = {
'webSudoPassword': self.password,
}
return self.post(path=url, data=data, headers=headers... | [
"Get",
"web",
"sudo",
"cookies",
"using",
"normal",
"http",
"request"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L149-L156 | [
"def",
"user_get_websudo",
"(",
"self",
")",
":",
"url",
"=",
"'secure/admin/WebSudoAuthenticate.jspa'",
"headers",
"=",
"self",
".",
"form_token_headers",
"data",
"=",
"{",
"'webSudoPassword'",
":",
"self",
".",
"password",
",",
"}",
"return",
"self",
".",
"pos... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.user_find_by_user_string | Fuzzy search using username and display name
:param username: Use '.' to find all users
:param start: OPTIONAL: The start point of the collection to return. Default: 0.
:param limit: OPTIONAL: The limit of the number of users to return, this may be restricted by
fixed system limi... | atlassian/jira.py | def user_find_by_user_string(self, username, start=0, limit=50, include_inactive_users=False, include_active_users=True):
"""
Fuzzy search using username and display name
:param username: Use '.' to find all users
:param start: OPTIONAL: The start point of the collection to return. Defau... | def user_find_by_user_string(self, username, start=0, limit=50, include_inactive_users=False, include_active_users=True):
"""
Fuzzy search using username and display name
:param username: Use '.' to find all users
:param start: OPTIONAL: The start point of the collection to return. Defau... | [
"Fuzzy",
"search",
"using",
"username",
"and",
"display",
"name",
":",
"param",
"username",
":",
"Use",
".",
"to",
"find",
"all",
"users",
":",
"param",
"start",
":",
"OPTIONAL",
":",
"The",
"start",
"point",
"of",
"the",
"collection",
"to",
"return",
".... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L158-L172 | [
"def",
"user_find_by_user_string",
"(",
"self",
",",
"username",
",",
"start",
"=",
"0",
",",
"limit",
"=",
"50",
",",
"include_inactive_users",
"=",
"False",
",",
"include_active_users",
"=",
"True",
")",
":",
"url",
"=",
"'rest/api/2/user/search'",
"url",
"+... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.get_project_versions | Contains a full representation of a the specified project's versions.
:param key:
:param expand: the parameters to expand
:return: | atlassian/jira.py | def get_project_versions(self, key, expand=None):
"""
Contains a full representation of a the specified project's versions.
:param key:
:param expand: the parameters to expand
:return:
"""
params = {}
if expand is not None:
params['expand'] = e... | def get_project_versions(self, key, expand=None):
"""
Contains a full representation of a the specified project's versions.
:param key:
:param expand: the parameters to expand
:return:
"""
params = {}
if expand is not None:
params['expand'] = e... | [
"Contains",
"a",
"full",
"representation",
"of",
"a",
"the",
"specified",
"project",
"s",
"versions",
".",
":",
"param",
"key",
":",
":",
"param",
"expand",
":",
"the",
"parameters",
"to",
"expand",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L199-L209 | [
"def",
"get_project_versions",
"(",
"self",
",",
"key",
",",
"expand",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"expand",
"is",
"not",
"None",
":",
"params",
"[",
"'expand'",
"]",
"=",
"expand",
"return",
"self",
".",
"get",
"(",
"'rest/... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.get_project_versions_paginated | Returns all versions for the specified project. Results are paginated.
Results can be ordered by the following fields:
sequence
name
startDate
releaseDate
:param key: the project key or id
:param start: the page offset, if not specified then defaul... | atlassian/jira.py | def get_project_versions_paginated(self, key, start=None, limit=None, order_by=None, expand=None):
"""
Returns all versions for the specified project. Results are paginated.
Results can be ordered by the following fields:
sequence
name
startDate
re... | def get_project_versions_paginated(self, key, start=None, limit=None, order_by=None, expand=None):
"""
Returns all versions for the specified project. Results are paginated.
Results can be ordered by the following fields:
sequence
name
startDate
re... | [
"Returns",
"all",
"versions",
"for",
"the",
"specified",
"project",
".",
"Results",
"are",
"paginated",
".",
"Results",
"can",
"be",
"ordered",
"by",
"the",
"following",
"fields",
":",
"sequence",
"name",
"startDate",
"releaseDate",
":",
"param",
"key",
":",
... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L211-L235 | [
"def",
"get_project_versions_paginated",
"(",
"self",
",",
"key",
",",
"start",
"=",
"None",
",",
"limit",
"=",
"None",
",",
"order_by",
"=",
"None",
",",
"expand",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"start",
"is",
"not",
"None",
"... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.get_project_actors_for_role_project | Returns the details for a given project role in a project.
:param project_key:
:param role_id:
:return: | atlassian/jira.py | def get_project_actors_for_role_project(self, project_key, role_id):
"""
Returns the details for a given project role in a project.
:param project_key:
:param role_id:
:return:
"""
url = 'rest/api/2/project/{projectIdOrKey}/role/{id}'.format(projectIdOrKey=project... | def get_project_actors_for_role_project(self, project_key, role_id):
"""
Returns the details for a given project role in a project.
:param project_key:
:param role_id:
:return:
"""
url = 'rest/api/2/project/{projectIdOrKey}/role/{id}'.format(projectIdOrKey=project... | [
"Returns",
"the",
"details",
"for",
"a",
"given",
"project",
"role",
"in",
"a",
"project",
".",
":",
"param",
"project_key",
":",
":",
"param",
"role_id",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L245-L254 | [
"def",
"get_project_actors_for_role_project",
"(",
"self",
",",
"project_key",
",",
"role_id",
")",
":",
"url",
"=",
"'rest/api/2/project/{projectIdOrKey}/role/{id}'",
".",
"format",
"(",
"projectIdOrKey",
"=",
"project_key",
",",
"id",
"=",
"role_id",
")",
"return",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.delete_project_actors | Deletes actors (users or groups) from a project role.
Delete a user from the role: /rest/api/2/project/{projectIdOrKey}/role/{roleId}?user={username}
Delete a group from the role: /rest/api/2/project/{projectIdOrKey}/role/{roleId}?group={groupname}
:param project_key:
:param role_id:
... | atlassian/jira.py | def delete_project_actors(self, project_key, role_id, actor, actor_type=None):
"""
Deletes actors (users or groups) from a project role.
Delete a user from the role: /rest/api/2/project/{projectIdOrKey}/role/{roleId}?user={username}
Delete a group from the role: /rest/api/2/project/{proj... | def delete_project_actors(self, project_key, role_id, actor, actor_type=None):
"""
Deletes actors (users or groups) from a project role.
Delete a user from the role: /rest/api/2/project/{projectIdOrKey}/role/{roleId}?user={username}
Delete a group from the role: /rest/api/2/project/{proj... | [
"Deletes",
"actors",
"(",
"users",
"or",
"groups",
")",
"from",
"a",
"project",
"role",
".",
"Delete",
"a",
"user",
"from",
"the",
"role",
":",
"/",
"rest",
"/",
"api",
"/",
"2",
"/",
"project",
"/",
"{",
"projectIdOrKey",
"}",
"/",
"role",
"/",
"{... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L256-L272 | [
"def",
"delete_project_actors",
"(",
"self",
",",
"project_key",
",",
"role_id",
",",
"actor",
",",
"actor_type",
"=",
"None",
")",
":",
"url",
"=",
"'rest/api/2/project/{projectIdOrKey}/role/{roleId}'",
".",
"format",
"(",
"projectIdOrKey",
"=",
"project_key",
",",... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.update_project | Updates a project.
Update project: /rest/api/2/project/{projectIdOrKey}
:param project_key: project key of project that needs to be updated
:param data: dictionary containing the data to be updated
:param expand: the parameters to expand | atlassian/jira.py | def update_project(self, project_key, data, expand=None):
"""
Updates a project.
Update project: /rest/api/2/project/{projectIdOrKey}
:param project_key: project key of project that needs to be updated
:param data: dictionary containing the data to be updated
:param expa... | def update_project(self, project_key, data, expand=None):
"""
Updates a project.
Update project: /rest/api/2/project/{projectIdOrKey}
:param project_key: project key of project that needs to be updated
:param data: dictionary containing the data to be updated
:param expa... | [
"Updates",
"a",
"project",
".",
"Update",
"project",
":",
"/",
"rest",
"/",
"api",
"/",
"2",
"/",
"project",
"/",
"{",
"projectIdOrKey",
"}"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L293-L306 | [
"def",
"update_project",
"(",
"self",
",",
"project_key",
",",
"data",
",",
"expand",
"=",
"None",
")",
":",
"if",
"expand",
":",
"url",
"=",
"'/rest/api/2/project/{projectIdOrKey}?expand={expand}'",
".",
"format",
"(",
"projectIdOrKey",
"=",
"project_key",
",",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.get_custom_fields | Get custom fields. Evaluated on 7.12
:param search: str
:param start: long Default: 1
:param limit: int Default: 50
:return: | atlassian/jira.py | def get_custom_fields(self, search=None, start=1, limit=50):
"""
Get custom fields. Evaluated on 7.12
:param search: str
:param start: long Default: 1
:param limit: int Default: 50
:return:
"""
url = 'rest/api/2/customFields'
params = {}
if... | def get_custom_fields(self, search=None, start=1, limit=50):
"""
Get custom fields. Evaluated on 7.12
:param search: str
:param start: long Default: 1
:param limit: int Default: 50
:return:
"""
url = 'rest/api/2/customFields'
params = {}
if... | [
"Get",
"custom",
"fields",
".",
"Evaluated",
"on",
"7",
".",
"12",
":",
"param",
"search",
":",
"str",
":",
"param",
"start",
":",
"long",
"Default",
":",
"1",
":",
"param",
"limit",
":",
"int",
"Default",
":",
"50",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L343-L359 | [
"def",
"get_custom_fields",
"(",
"self",
",",
"search",
"=",
"None",
",",
"start",
"=",
"1",
",",
"limit",
"=",
"50",
")",
":",
"url",
"=",
"'rest/api/2/customFields'",
"params",
"=",
"{",
"}",
"if",
"search",
":",
"params",
"[",
"'search'",
"]",
"=",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.get_issue_labels | Get issue labels.
:param issue_key:
:return: | atlassian/jira.py | def get_issue_labels(self, issue_key):
"""
Get issue labels.
:param issue_key:
:return:
"""
url = 'rest/api/2/issue/{issue_key}?fields=labels'.format(issue_key=issue_key)
return (self.get(url) or {}).get('fields').get('labels') | def get_issue_labels(self, issue_key):
"""
Get issue labels.
:param issue_key:
:return:
"""
url = 'rest/api/2/issue/{issue_key}?fields=labels'.format(issue_key=issue_key)
return (self.get(url) or {}).get('fields').get('labels') | [
"Get",
"issue",
"labels",
".",
":",
"param",
"issue_key",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L361-L368 | [
"def",
"get_issue_labels",
"(",
"self",
",",
"issue_key",
")",
":",
"url",
"=",
"'rest/api/2/issue/{issue_key}?fields=labels'",
".",
"format",
"(",
"issue_key",
"=",
"issue_key",
")",
"return",
"(",
"self",
".",
"get",
"(",
"url",
")",
"or",
"{",
"}",
")",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.get_all_assignable_users_for_project | Provide assignable users for project
:param project_key:
:param start: OPTIONAL: The start point of the collection to return. Default: 0.
:param limit: OPTIONAL: The limit of the number of users to return, this may be restricted by
fixed system limits. Default by built-in method:... | atlassian/jira.py | def get_all_assignable_users_for_project(self, project_key, start=0, limit=50):
"""
Provide assignable users for project
:param project_key:
:param start: OPTIONAL: The start point of the collection to return. Default: 0.
:param limit: OPTIONAL: The limit of the number of users t... | def get_all_assignable_users_for_project(self, project_key, start=0, limit=50):
"""
Provide assignable users for project
:param project_key:
:param start: OPTIONAL: The start point of the collection to return. Default: 0.
:param limit: OPTIONAL: The limit of the number of users t... | [
"Provide",
"assignable",
"users",
"for",
"project",
":",
"param",
"project_key",
":",
":",
"param",
"start",
":",
"OPTIONAL",
":",
"The",
"start",
"point",
"of",
"the",
"collection",
"to",
"return",
".",
"Default",
":",
"0",
".",
":",
"param",
"limit",
"... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L412-L425 | [
"def",
"get_all_assignable_users_for_project",
"(",
"self",
",",
"project_key",
",",
"start",
"=",
"0",
",",
"limit",
"=",
"50",
")",
":",
"url",
"=",
"'rest/api/2/user/assignable/search?project={project_key}&startAt={start}&maxResults={limit}'",
".",
"format",
"(",
"proj... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.get_groups | REST endpoint for searching groups in a group picker
Returns groups with substrings matching a given query. This is mainly for use with the group picker,
so the returned groups contain html to be used as picker suggestions. The groups are also wrapped
in a single response object that also contai... | atlassian/jira.py | def get_groups(self, query=None, exclude=None, limit=20):
"""
REST endpoint for searching groups in a group picker
Returns groups with substrings matching a given query. This is mainly for use with the group picker,
so the returned groups contain html to be used as picker suggestions. Th... | def get_groups(self, query=None, exclude=None, limit=20):
"""
REST endpoint for searching groups in a group picker
Returns groups with substrings matching a given query. This is mainly for use with the group picker,
so the returned groups contain html to be used as picker suggestions. Th... | [
"REST",
"endpoint",
"for",
"searching",
"groups",
"in",
"a",
"group",
"picker",
"Returns",
"groups",
"with",
"substrings",
"matching",
"a",
"given",
"query",
".",
"This",
"is",
"mainly",
"for",
"use",
"with",
"the",
"group",
"picker",
"so",
"the",
"returned"... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L427-L451 | [
"def",
"get_groups",
"(",
"self",
",",
"query",
"=",
"None",
",",
"exclude",
"=",
"None",
",",
"limit",
"=",
"20",
")",
":",
"url",
"=",
"'rest/api/2/groups/picker'",
"params",
"=",
"{",
"}",
"if",
"query",
":",
"params",
"[",
"'query'",
"]",
"=",
"q... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.create_group | Create a group by given group parameter
:param name: str
:return: New group params | atlassian/jira.py | def create_group(self, name):
"""
Create a group by given group parameter
:param name: str
:return: New group params
"""
url = 'rest/api/2/group'
data = {'name': name}
return self.post(url, data=data) | def create_group(self, name):
"""
Create a group by given group parameter
:param name: str
:return: New group params
"""
url = 'rest/api/2/group'
data = {'name': name}
return self.post(url, data=data) | [
"Create",
"a",
"group",
"by",
"given",
"group",
"parameter"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L453-L463 | [
"def",
"create_group",
"(",
"self",
",",
"name",
")",
":",
"url",
"=",
"'rest/api/2/group'",
"data",
"=",
"{",
"'name'",
":",
"name",
"}",
"return",
"self",
".",
"post",
"(",
"url",
",",
"data",
"=",
"data",
")"
] | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.remove_group | Delete a group by given group parameter
If you delete a group and content is restricted to that group, the content will be hidden from all users
To prevent this, use this parameter to specify a different group to transfer the restrictions
(comments and worklogs only) to
:param name: str... | atlassian/jira.py | def remove_group(self, name, swap_group=None):
"""
Delete a group by given group parameter
If you delete a group and content is restricted to that group, the content will be hidden from all users
To prevent this, use this parameter to specify a different group to transfer the restriction... | def remove_group(self, name, swap_group=None):
"""
Delete a group by given group parameter
If you delete a group and content is restricted to that group, the content will be hidden from all users
To prevent this, use this parameter to specify a different group to transfer the restriction... | [
"Delete",
"a",
"group",
"by",
"given",
"group",
"parameter",
"If",
"you",
"delete",
"a",
"group",
"and",
"content",
"is",
"restricted",
"to",
"that",
"group",
"the",
"content",
"will",
"be",
"hidden",
"from",
"all",
"users",
"To",
"prevent",
"this",
"use",... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L465-L483 | [
"def",
"remove_group",
"(",
"self",
",",
"name",
",",
"swap_group",
"=",
"None",
")",
":",
"log",
".",
"warning",
"(",
"'Removing group...'",
")",
"url",
"=",
"'rest/api/2/group'",
"if",
"swap_group",
"is",
"not",
"None",
":",
"params",
"=",
"{",
"'groupna... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Jira.get_all_users_from_group | Just wrapping method user group members
:param group:
:param include_inactive_users:
:param start: OPTIONAL: The start point of the collection to return. Default: 0.
:param limit: OPTIONAL: The limit of the number of users to return, this may be restricted by
fixed system... | atlassian/jira.py | def get_all_users_from_group(self, group, include_inactive_users=False, start=0, limit=50):
"""
Just wrapping method user group members
:param group:
:param include_inactive_users:
:param start: OPTIONAL: The start point of the collection to return. Default: 0.
:param lim... | def get_all_users_from_group(self, group, include_inactive_users=False, start=0, limit=50):
"""
Just wrapping method user group members
:param group:
:param include_inactive_users:
:param start: OPTIONAL: The start point of the collection to return. Default: 0.
:param lim... | [
"Just",
"wrapping",
"method",
"user",
"group",
"members",
":",
"param",
"group",
":",
":",
"param",
"include_inactive_users",
":",
":",
"param",
"start",
":",
"OPTIONAL",
":",
"The",
"start",
"point",
"of",
"the",
"collection",
"to",
"return",
".",
"Default"... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/jira.py#L485-L502 | [
"def",
"get_all_users_from_group",
"(",
"self",
",",
"group",
",",
"include_inactive_users",
"=",
"False",
",",
"start",
"=",
"0",
",",
"limit",
"=",
"50",
")",
":",
"url",
"=",
"'rest/api/2/group/member'",
"params",
"=",
"{",
"}",
"if",
"group",
":",
"par... | 540d269905c3e7547b666fe30c647b2d512cf358 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.