_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 75 19.8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q29000 | Bivariate.fit | train | def fit(self, X):
"""Fit a model to the data updating the parameters.
Args:
X: `np.ndarray` of shape (,2).
Return:
None
"""
U, V = self.split_matrix(X)
self.tau = stats.kendalltau(U, V)[0]
self.theta = self.compute_theta()
self.ch... | python | {
"resource": ""
} |
q29001 | Bivariate.from_dict | train | def from_dict(cls, copula_dict):
"""Create a new instance from the given parameters.
Args:
copula_dict: `dict` with the parameters to replicate the copula.
Like the output of `Bivariate.to_dict`
Returns:
Bivariate: Instance of the copula defined on the param... | python | {
"resource": ""
} |
q29002 | Bivariate.check_theta | train | def check_theta(self):
"""Validate the computed theta against the copula specification.
This method is used to assert the computed theta is in the valid range for the copula."""
lower, upper = self.theta_interval
if (not lower <= self.theta <= upper) or (self.theta in self.invalid_theta... | python | {
"resource": ""
} |
q29003 | Bivariate.compute_empirical | train | def compute_empirical(cls, X):
"""Compute empirical distribution."""
z_left = []
z_right = []
L = []
R = []
U, V = cls.split_matrix(X)
N = len(U)
base = np.linspace(EPSILON, 1.0 - EPSILON, COMPUTE_EMPIRICAL_STEPS)
# See https://github.com/DAI-Lab/... | python | {
"resource": ""
} |
q29004 | Bivariate.select_copula | train | def select_copula(cls, X):
"""Select best copula function based on likelihood.
Args:
X: 2-dimensional `np.ndarray`
Returns:
tuple: `tuple(CopulaType, float)` best fit and model param.
"""
frank = Bivariate(CopulaTypes.FRANK)
frank.fit(X)
... | python | {
"resource": ""
} |
q29005 | import_object | train | def import_object(object_name):
"""Import an object from its Fully Qualified Name."""
package, name = object_name.rsplit('.', 1)
return getattr(importlib.import_module(package), name) | python | {
"resource": ""
} |
q29006 | get_qualified_name | train | def get_qualified_name(_object):
"""Return the Fully Qualified Name from an instance or class."""
module = _object.__module__
if hasattr(_object, '__name__'):
_class = _object.__name__
else:
_class = _object.__class__.__name__
return module + '.' + _class | python | {
"resource": ""
} |
q29007 | vectorize | train | def vectorize(function):
"""Allow a method that only accepts scalars to accept vectors too.
This decorator has two different behaviors depending on the dimensionality of the
array passed as an argument:
**1-d array**
It will work under the assumption that the `function` argument is a callable
... | python | {
"resource": ""
} |
q29008 | scalarize | train | def scalarize(function):
"""Allow methods that only accepts 1-d vectors to work with scalars.
Args:
function(callable): Function that accepts and returns vectors.
Returns:
callable: Decorated function that accepts and returns scalars.
"""
def decorated(self, X, *args, **kwargs):
... | python | {
"resource": ""
} |
q29009 | check_valid_values | train | def check_valid_values(function):
"""Raises an exception if the given values are not supported.
Args:
function(callable): Method whose unique argument is a numpy.array-like object.
Returns:
callable: Decorated function
Raises:
ValueError: If there are missing or invalid values... | python | {
"resource": ""
} |
q29010 | missing_method_scipy_wrapper | train | def missing_method_scipy_wrapper(function):
"""Raises a detailed exception when a method is not available."""
def decorated(self, *args, **kwargs):
message = (
'Your tried to access `{method_name}` from {class_name}, but its not available.\n '
'There can be multiple factors causi... | python | {
"resource": ""
} |
q29011 | Frank._g | train | def _g(self, z):
"""Helper function to solve Frank copula.
This functions encapsulates :math:`g_z = e^{-\\theta z} - 1` used on Frank copulas.
Argument:
z: np.ndarray
Returns:
np.ndarray
"""
return np.exp(np.multiply(-self.theta, z)) - 1 | python | {
"resource": ""
} |
q29012 | Frank._frank_help | train | def _frank_help(alpha, tau):
"""Compute first order debye function to estimate theta."""
def debye(t):
return t / (np.exp(t) - 1)
debye_value = integrate.quad(debye, EPSILON, alpha)[0] / alpha
return 4 * (debye_value - 1) / alpha + 1 - tau | python | {
"resource": ""
} |
q29013 | Univariate.to_dict | train | def to_dict(self):
"""Returns parameters to replicate the distribution."""
result = {
'type': get_qualified_name(self),
'fitted': self.fitted,
'constant_value': self.constant_value
}
if not self.fitted:
return result
result.update... | python | {
"resource": ""
} |
q29014 | Univariate._constant_cumulative_distribution | train | def _constant_cumulative_distribution(self, X):
"""Cumulative distribution for the degenerate case of constant distribution.
Note that the output of this method will be an array whose unique values are 0 and 1.
More information can be found here: https://en.wikipedia.org/wiki/Degenerate_distrib... | python | {
"resource": ""
} |
q29015 | Univariate._constant_probability_density | train | def _constant_probability_density(self, X):
"""Probability density for the degenerate case of constant distribution.
Note that the output of this method will be an array whose unique values are 0 and 1.
More information can be found here: https://en.wikipedia.org/wiki/Degenerate_distribution
... | python | {
"resource": ""
} |
q29016 | Univariate._replace_constant_methods | train | def _replace_constant_methods(self):
"""Replaces conventional distribution methods by its constant counterparts."""
self.cumulative_distribution = self._constant_cumulative_distribution
self.percent_point = self._constant_percent_point
self.probability_density = self._constant_probabilit... | python | {
"resource": ""
} |
q29017 | ScipyWrapper.fit | train | def fit(self, X, *args, **kwargs):
"""Fit scipy model to an array of values.
Args:
X(`np.ndarray` or `pd.DataFrame`): Datapoints to be estimated from. Must be 1-d
Returns:
None
"""
self.constant_value = self._get_constant_value(X)
if self.cons... | python | {
"resource": ""
} |
q29018 | main | train | def main(data, utype, ctype):
"""Create a Vine from the data, utype and ctype"""
copula = CopulaModel(data, utype, ctype)
print(copula.sampling(1, plot=True))
print(copula.model.vine_model[-1].tree_data) | python | {
"resource": ""
} |
q29019 | Clayton.compute_theta | train | def compute_theta(self):
"""Compute theta parameter using Kendall's tau.
On Clayton copula this is :math:`τ = θ/(θ + 2) \\implies θ = 2τ/(1-τ)` with
:math:`θ ∈ (0, ∞)`.
On the corner case of :math:`τ = 1`, a big enough number is returned instead of infinity.
"""
if self... | python | {
"resource": ""
} |
q29020 | VineCopula.fit | train | def fit(self, X, truncated=3):
"""Fit a vine model to the data.
Args:
X(numpy.ndarray): data to be fitted.
truncated(int): max level to build the vine.
"""
self.n_sample, self.n_var = X.shape
self.columns = X.columns
self.tau_mat = X.corr(method='... | python | {
"resource": ""
} |
q29021 | VineCopula.train_vine | train | def train_vine(self, tree_type):
"""Train vine."""
LOGGER.debug('start building tree : 0')
tree_1 = Tree(tree_type)
tree_1.fit(0, self.n_var, self.tau_mat, self.u_matrix)
self.trees.append(tree_1)
LOGGER.debug('finish building tree : 0')
for k in range(1, min(sel... | python | {
"resource": ""
} |
q29022 | VineCopula.get_likelihood | train | def get_likelihood(self, uni_matrix):
"""Compute likelihood of the vine."""
num_tree = len(self.trees)
values = np.empty([1, num_tree])
for i in range(num_tree):
value, new_uni_matrix = self.trees[i].get_likelihood(uni_matrix)
uni_matrix = new_uni_matrix
... | python | {
"resource": ""
} |
q29023 | VineCopula._sample_row | train | def _sample_row(self):
"""Generate a single sampled row from vine model.
Returns:
numpy.ndarray
"""
unis = np.random.uniform(0, 1, self.n_var)
# randomly select a node to start with
first_ind = np.random.randint(0, self.n_var)
adj = self.trees[0].get_... | python | {
"resource": ""
} |
q29024 | VineCopula.sample | train | def sample(self, num_rows):
"""Sample new rows.
Args:
num_rows(int): Number of rows to sample
Returns:
pandas.DataFrame
"""
sampled_values = []
for i in range(num_rows):
sampled_values.append(self._sample_row())
return pd.Da... | python | {
"resource": ""
} |
q29025 | Tree.fit | train | def fit(self, index, n_nodes, tau_matrix, previous_tree, edges=None):
"""Fits tree object.
Args:
:param index: index of the tree
:param n_nodes: number of nodes in the tree
:tau_matrix: kendall's tau matrix of the data
:previous_tree: tree object of previ... | python | {
"resource": ""
} |
q29026 | Tree._check_contraint | train | def _check_contraint(self, edge1, edge2):
"""Check if two edges satisfy vine constraint.
Args:
:param edge1: edge object representing edge1
:param edge2: edge object representing edge2
:type edge1: Edge object
:type edge2: Edge object
Returns:
... | python | {
"resource": ""
} |
q29027 | Tree._get_constraints | train | def _get_constraints(self):
"""Get neighboring edges for each edge in the edges."""
num_edges = len(self.edges)
for k in range(num_edges):
for i in range(num_edges):
# add to constraints if i shared an edge with k
if k != i and self.edges[k].is_adjacen... | python | {
"resource": ""
} |
q29028 | Tree._sort_tau_by_y | train | def _sort_tau_by_y(self, y):
"""Sort tau matrix by dependece with variable y.
Args:
:param y: index of variable of intrest
:type y: int
"""
# first column is the variable of interest
tau_y = self.tau_matrix[:, y]
tau_y[y] = np.NaN
temp = ... | python | {
"resource": ""
} |
q29029 | Tree.get_tau_matrix | train | def get_tau_matrix(self):
"""Get tau matrix for adjacent pairs.
Returns:
:param tau: tau matrix for the current tree
:type tau: np.ndarray
"""
num_edges = len(self.edges)
tau = np.empty([num_edges, num_edges])
for i in range(num_edges):
... | python | {
"resource": ""
} |
q29030 | Tree.get_adjacent_matrix | train | def get_adjacent_matrix(self):
"""Get adjacency matrix.
Returns:
:param adj: adjacency matrix
:type adj: np.ndarray
"""
edges = self.edges
num_edges = len(edges) + 1
adj = np.zeros([num_edges, num_edges])
for k in range(num_edges - 1):
... | python | {
"resource": ""
} |
q29031 | Tree.prepare_next_tree | train | def prepare_next_tree(self):
"""Prepare conditional U matrix for next tree."""
for edge in self.edges:
copula_theta = edge.theta
if self.level == 1:
left_u = self.u_matrix[:, edge.L]
right_u = self.u_matrix[:, edge.R]
else:
... | python | {
"resource": ""
} |
q29032 | Tree.get_likelihood | train | def get_likelihood(self, uni_matrix):
"""Compute likelihood of the tree given an U matrix.
Args:
uni_matrix(numpy.array): univariate matrix to evaluate likelihood on.
Returns:
tuple[float, numpy.array]:
likelihood of the current tree, next level conditio... | python | {
"resource": ""
} |
q29033 | Tree.from_dict | train | def from_dict(cls, tree_dict, previous=None):
"""Create a new instance from a dictionary."""
instance = cls(tree_dict['tree_type'])
fitted = tree_dict['fitted']
instance.fitted = fitted
if fitted:
instance.level = tree_dict['level']
instance.n_nodes = tre... | python | {
"resource": ""
} |
q29034 | CenterTree._build_first_tree | train | def _build_first_tree(self):
"""Build first level tree."""
tau_sorted = self._sort_tau_by_y(0)
for itr in range(self.n_nodes - 1):
ind = int(tau_sorted[itr, 0])
name, theta = Bivariate.select_copula(self.u_matrix[:, (0, ind)])
new_edge = Edge(itr, 0, ind, nam... | python | {
"resource": ""
} |
q29035 | CenterTree._build_kth_tree | train | def _build_kth_tree(self):
"""Build k-th level tree."""
anchor = self.get_anchor()
aux_sorted = self._sort_tau_by_y(anchor)
edges = self.previous_tree.edges
for itr in range(self.n_nodes - 1):
right = int(aux_sorted[itr, 0])
left_parent, right_parent = Ed... | python | {
"resource": ""
} |
q29036 | CenterTree.get_anchor | train | def get_anchor(self):
"""Find anchor variable with highest sum of dependence with the rest."""
temp = np.empty([self.n_nodes, 2])
temp[:, 0] = np.arange(self.n_nodes, dtype=int)
temp[:, 1] = np.sum(abs(self.tau_matrix), 1)
anchor = int(temp[0, 0])
return anchor | python | {
"resource": ""
} |
q29037 | RegularTree._build_first_tree | train | def _build_first_tree(self):
"""Build the first tree with n-1 variable."""
# Prim's algorithm
neg_tau = -1.0 * abs(self.tau_matrix)
X = {0}
while len(X) != self.n_nodes:
adj_set = set()
for x in X:
for k in range(self.n_nodes):
... | python | {
"resource": ""
} |
q29038 | RegularTree._build_kth_tree | train | def _build_kth_tree(self):
"""Build tree for level k."""
neg_tau = -1.0 * abs(self.tau_matrix)
edges = self.previous_tree.edges
visited = set([0])
unvisited = set(range(self.n_nodes))
while len(visited) != self.n_nodes:
adj_set = set()
for x in vi... | python | {
"resource": ""
} |
q29039 | Edge._identify_eds_ing | train | def _identify_eds_ing(first, second):
"""Find nodes connecting adjacent edges.
Args:
first(Edge): Edge object representing the first edge.
second(Edge): Edge object representing the second edge.
Returns:
tuple[int, int, set[int]]: The first two values repres... | python | {
"resource": ""
} |
q29040 | Edge.is_adjacent | train | def is_adjacent(self, another_edge):
"""Check if two edges are adjacent.
Args:
:param another_edge: edge object of another edge
:type another_edge: edge object
This function will return true if the two edges are adjacent.
"""
return (
self.L ... | python | {
"resource": ""
} |
q29041 | Edge.sort_edge | train | def sort_edge(edges):
"""Sort iterable of edges first by left node indices then right.
Args:
edges(list[Edge]): List of edges to be sorted.
Returns:
list[Edge]: Sorted list by left and right node indices.
"""
return sorted(edges, key=lambda x: (x.L, x.R)... | python | {
"resource": ""
} |
q29042 | Edge.get_conditional_uni | train | def get_conditional_uni(cls, left_parent, right_parent):
"""Identify pair univariate value from parents.
Args:
left_parent(Edge): left parent
right_parent(Edge): right parent
Returns:
tuple[np.ndarray, np.ndarray]: left and right parents univariate.
... | python | {
"resource": ""
} |
q29043 | Edge.get_child_edge | train | def get_child_edge(cls, index, left_parent, right_parent):
"""Construct a child edge from two parent edges."""
[ed1, ed2, depend_set] = cls._identify_eds_ing(left_parent, right_parent)
left_u, right_u = cls.get_conditional_uni(left_parent, right_parent)
X = np.array([[x, y] for x, y in z... | python | {
"resource": ""
} |
q29044 | Edge.get_likelihood | train | def get_likelihood(self, uni_matrix):
"""Compute likelihood given a U matrix.
Args:
uni_matrix(numpy.array): Matrix to compute the likelihood.
Return:
tuple(np.ndarray, np.ndarray, np.array): likelihood and conditional values.
"""
if self.parents is None... | python | {
"resource": ""
} |
q29045 | KDEUnivariate.fit | train | def fit(self, X):
"""Fit Kernel density estimation to an list of values.
Args:
X: 1-d `np.ndarray` or `pd.Series` or `list` datapoints to be estimated from.
This function will fit a gaussian_kde model to a list of datapoints
and store it as a class attribute.
"""
... | python | {
"resource": ""
} |
q29046 | KDEUnivariate.probability_density | train | def probability_density(self, X):
"""Evaluate the estimated pdf on a point.
Args:
X: `float` a datapoint.
:type X: float
Returns:
pdf: int or float with the value of estimated pdf
"""
self.check_fit()
if type(X) not in (int, float):
... | python | {
"resource": ""
} |
q29047 | GaussianKDE._brentq_cdf | train | def _brentq_cdf(self, value):
"""Helper function to compute percent_point.
As scipy.stats.gaussian_kde doesn't provide this functionality out of the box we need
to make a numerical approach:
- First we scalarize and bound cumulative_distribution.
- Then we define a function `f(... | python | {
"resource": ""
} |
q29048 | mp1.check_power_raw | train | def check_power_raw(self):
"""Returns the power state of the smart power strip in raw format."""
packet = bytearray(16)
packet[0x00] = 0x0a
packet[0x02] = 0xa5
packet[0x03] = 0xa5
packet[0x04] = 0x5a
packet[0x05] = 0x5a
packet[0x06] = 0xae
packet[0x07] = 0xc0
packet[0x08] = 0x01
... | python | {
"resource": ""
} |
q29049 | mp1.check_power | train | def check_power(self):
"""Returns the power state of the smart power strip."""
state = self.check_power_raw()
data = {}
data['s1'] = bool(state & 0x01)
data['s2'] = bool(state & 0x02)
data['s3'] = bool(state & 0x04)
data['s4'] = bool(state & 0x08)
return data | python | {
"resource": ""
} |
q29050 | sp2.set_power | train | def set_power(self, state):
"""Sets the power state of the smart plug."""
packet = bytearray(16)
packet[0] = 2
if self.check_nightlight():
packet[4] = 3 if state else 2
else:
packet[4] = 1 if state else 0
self.send_packet(0x6a, packet) | python | {
"resource": ""
} |
q29051 | sp2.set_nightlight | train | def set_nightlight(self, state):
"""Sets the night light state of the smart plug"""
packet = bytearray(16)
packet[0] = 2
if self.check_power():
packet[4] = 3 if state else 1
else:
packet[4] = 2 if state else 0
self.send_packet(0x6a, packet) | python | {
"resource": ""
} |
q29052 | sp2.check_power | train | def check_power(self):
"""Returns the power state of the smart plug."""
packet = bytearray(16)
packet[0] = 1
response = self.send_packet(0x6a, packet)
err = response[0x22] | (response[0x23] << 8)
if err == 0:
payload = self.decrypt(bytes(response[0x38:]))
if type(payload[0x4]) == int... | python | {
"resource": ""
} |
q29053 | ChallengeList.create | train | def create(self, expiration_date=values.unset, details=values.unset,
hidden_details=values.unset):
"""
Create a new ChallengeInstance
:param datetime expiration_date: The future date in which this Challenge will expire
:param unicode details: Public details provided to co... | python | {
"resource": ""
} |
q29054 | ChallengeList.get | train | def get(self, sid):
"""
Constructs a ChallengeContext
:param sid: A string that uniquely identifies this Challenge, or `latest`.
:returns: twilio.rest.authy.v1.service.entity.factor.challenge.ChallengeContext
:rtype: twilio.rest.authy.v1.service.entity.factor.challenge.Challeng... | python | {
"resource": ""
} |
q29055 | ChallengePage.get_instance | train | def get_instance(self, payload):
"""
Build an instance of ChallengeInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.authy.v1.service.entity.factor.challenge.ChallengeInstance
:rtype: twilio.rest.authy.v1.service.entity.factor.challenge.Challenge... | python | {
"resource": ""
} |
q29056 | ChallengeContext.fetch | train | def fetch(self):
"""
Fetch a ChallengeInstance
:returns: Fetched ChallengeInstance
:rtype: twilio.rest.authy.v1.service.entity.factor.challenge.ChallengeInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
... | python | {
"resource": ""
} |
q29057 | TaskChannelList.create | train | def create(self, friendly_name, unique_name):
"""
Create a new TaskChannelInstance
:param unicode friendly_name: String representing user-friendly name for the TaskChannel
:param unicode unique_name: String representing unique name for the TaskChannel
:returns: Newly created Ta... | python | {
"resource": ""
} |
q29058 | TaskChannelList.get | train | def get(self, sid):
"""
Constructs a TaskChannelContext
:param sid: The sid
:returns: twilio.rest.taskrouter.v1.workspace.task_channel.TaskChannelContext
:rtype: twilio.rest.taskrouter.v1.workspace.task_channel.TaskChannelContext
"""
return TaskChannelContext(se... | python | {
"resource": ""
} |
q29059 | TaskChannelPage.get_instance | train | def get_instance(self, payload):
"""
Build an instance of TaskChannelInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.taskrouter.v1.workspace.task_channel.TaskChannelInstance
:rtype: twilio.rest.taskrouter.v1.workspace.task_channel.TaskChannelIn... | python | {
"resource": ""
} |
q29060 | VariableList.create | train | def create(self, key, value):
"""
Create a new VariableInstance
:param unicode key: The key
:param unicode value: The value
:returns: Newly created VariableInstance
:rtype: twilio.rest.serverless.v1.service.environment.variable.VariableInstance
"""
data ... | python | {
"resource": ""
} |
q29061 | VariableList.get | train | def get(self, sid):
"""
Constructs a VariableContext
:param sid: The sid
:returns: twilio.rest.serverless.v1.service.environment.variable.VariableContext
:rtype: twilio.rest.serverless.v1.service.environment.variable.VariableContext
"""
return VariableContext(
... | python | {
"resource": ""
} |
q29062 | VariablePage.get_instance | train | def get_instance(self, payload):
"""
Build an instance of VariableInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.serverless.v1.service.environment.variable.VariableInstance
:rtype: twilio.rest.serverless.v1.service.environment.variable.Variabl... | python | {
"resource": ""
} |
q29063 | VariableContext.fetch | train | def fetch(self):
"""
Fetch a VariableInstance
:returns: Fetched VariableInstance
:rtype: twilio.rest.serverless.v1.service.environment.variable.VariableInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
... | python | {
"resource": ""
} |
q29064 | RecordList.all_time | train | def all_time(self):
"""
Access the all_time
:returns: twilio.rest.api.v2010.account.usage.record.all_time.AllTimeList
:rtype: twilio.rest.api.v2010.account.usage.record.all_time.AllTimeList
"""
if self._all_time is None:
self._all_time = AllTimeList(self._ver... | python | {
"resource": ""
} |
q29065 | RecordList.daily | train | def daily(self):
"""
Access the daily
:returns: twilio.rest.api.v2010.account.usage.record.daily.DailyList
:rtype: twilio.rest.api.v2010.account.usage.record.daily.DailyList
"""
if self._daily is None:
self._daily = DailyList(self._version, account_sid=self._... | python | {
"resource": ""
} |
q29066 | RecordList.last_month | train | def last_month(self):
"""
Access the last_month
:returns: twilio.rest.api.v2010.account.usage.record.last_month.LastMonthList
:rtype: twilio.rest.api.v2010.account.usage.record.last_month.LastMonthList
"""
if self._last_month is None:
self._last_month = LastM... | python | {
"resource": ""
} |
q29067 | RecordList.monthly | train | def monthly(self):
"""
Access the monthly
:returns: twilio.rest.api.v2010.account.usage.record.monthly.MonthlyList
:rtype: twilio.rest.api.v2010.account.usage.record.monthly.MonthlyList
"""
if self._monthly is None:
self._monthly = MonthlyList(self._version, ... | python | {
"resource": ""
} |
q29068 | RecordList.this_month | train | def this_month(self):
"""
Access the this_month
:returns: twilio.rest.api.v2010.account.usage.record.this_month.ThisMonthList
:rtype: twilio.rest.api.v2010.account.usage.record.this_month.ThisMonthList
"""
if self._this_month is None:
self._this_month = ThisM... | python | {
"resource": ""
} |
q29069 | RecordList.today | train | def today(self):
"""
Access the today
:returns: twilio.rest.api.v2010.account.usage.record.today.TodayList
:rtype: twilio.rest.api.v2010.account.usage.record.today.TodayList
"""
if self._today is None:
self._today = TodayList(self._version, account_sid=self._... | python | {
"resource": ""
} |
q29070 | RecordList.yearly | train | def yearly(self):
"""
Access the yearly
:returns: twilio.rest.api.v2010.account.usage.record.yearly.YearlyList
:rtype: twilio.rest.api.v2010.account.usage.record.yearly.YearlyList
"""
if self._yearly is None:
self._yearly = YearlyList(self._version, account_s... | python | {
"resource": ""
} |
q29071 | RecordList.yesterday | train | def yesterday(self):
"""
Access the yesterday
:returns: twilio.rest.api.v2010.account.usage.record.yesterday.YesterdayList
:rtype: twilio.rest.api.v2010.account.usage.record.yesterday.YesterdayList
"""
if self._yesterday is None:
self._yesterday = YesterdayLi... | python | {
"resource": ""
} |
q29072 | RecordPage.get_instance | train | def get_instance(self, payload):
"""
Build an instance of RecordInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.usage.record.RecordInstance
:rtype: twilio.rest.api.v2010.account.usage.record.RecordInstance
"""
... | python | {
"resource": ""
} |
q29073 | BulkCountryUpdateList.create | train | def create(self, update_request):
"""
Create a new BulkCountryUpdateInstance
:param unicode update_request: URL encoded JSON array of update objects
:returns: Newly created BulkCountryUpdateInstance
:rtype: twilio.rest.voice.v1.dialing_permissions.bulk_country_update.BulkCountr... | python | {
"resource": ""
} |
q29074 | WorkersCumulativeStatisticsPage.get_instance | train | def get_instance(self, payload):
"""
Build an instance of WorkersCumulativeStatisticsInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.taskrouter.v1.workspace.worker.workers_cumulative_statistics.WorkersCumulativeStatisticsInstance
:rtype: twilio... | python | {
"resource": ""
} |
q29075 | WorkersCumulativeStatisticsContext.fetch | train | def fetch(self, end_date=values.unset, minutes=values.unset,
start_date=values.unset, task_channel=values.unset):
"""
Fetch a WorkersCumulativeStatisticsInstance
:param datetime end_date: Filter cumulative statistics by a end date.
:param unicode minutes: Filter cumulative... | python | {
"resource": ""
} |
q29076 | WorkspaceRealTimeStatisticsPage.get_instance | train | def get_instance(self, payload):
"""
Build an instance of WorkspaceRealTimeStatisticsInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.taskrouter.v1.workspace.workspace_real_time_statistics.WorkspaceRealTimeStatisticsInstance
:rtype: twilio.rest.... | python | {
"resource": ""
} |
q29077 | WorkspaceRealTimeStatisticsInstance.fetch | train | def fetch(self, task_channel=values.unset):
"""
Fetch a WorkspaceRealTimeStatisticsInstance
:param unicode task_channel: Filter real-time and cumulative statistics by TaskChannel.
:returns: Fetched WorkspaceRealTimeStatisticsInstance
:rtype: twilio.rest.taskrouter.v1.workspace.... | python | {
"resource": ""
} |
q29078 | UsageRecordPage.get_instance | train | def get_instance(self, payload):
"""
Build an instance of UsageRecordInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.wireless.v1.sim.usage_record.UsageRecordInstance
:rtype: twilio.rest.wireless.v1.sim.usage_record.UsageRecordInstance
"... | python | {
"resource": ""
} |
q29079 | CompositionHookList.page | train | def page(self, enabled=values.unset, date_created_after=values.unset,
date_created_before=values.unset, friendly_name=values.unset,
page_token=values.unset, page_number=values.unset,
page_size=values.unset):
"""
Retrieve a single page of CompositionHookInstance rec... | python | {
"resource": ""
} |
q29080 | TokenList.create | train | def create(self, ttl=values.unset):
"""
Create a new TokenInstance
:param unicode ttl: The duration in seconds the credentials are valid
:returns: Newly created TokenInstance
:rtype: twilio.rest.api.v2010.account.token.TokenInstance
"""
data = values.of({'Ttl': ... | python | {
"resource": ""
} |
q29081 | TokenPage.get_instance | train | def get_instance(self, payload):
"""
Build an instance of TokenInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.token.TokenInstance
:rtype: twilio.rest.api.v2010.account.token.TokenInstance
"""
return TokenInsta... | python | {
"resource": ""
} |
q29082 | VerificationCheckPage.get_instance | train | def get_instance(self, payload):
"""
Build an instance of VerificationCheckInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.preview.acc_security.service.verification_check.VerificationCheckInstance
:rtype: twilio.rest.preview.acc_security.servic... | python | {
"resource": ""
} |
q29083 | EngagementList.get | train | def get(self, sid):
"""
Constructs a EngagementContext
:param sid: Engagement Sid.
:returns: twilio.rest.studio.v1.flow.engagement.EngagementContext
:rtype: twilio.rest.studio.v1.flow.engagement.EngagementContext
"""
return EngagementContext(self._version, flow_... | python | {
"resource": ""
} |
q29084 | EngagementPage.get_instance | train | def get_instance(self, payload):
"""
Build an instance of EngagementInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.studio.v1.flow.engagement.EngagementInstance
:rtype: twilio.rest.studio.v1.flow.engagement.EngagementInstance
"""
... | python | {
"resource": ""
} |
q29085 | EngagementContext.engagement_context | train | def engagement_context(self):
"""
Access the engagement_context
:returns: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextList
:rtype: twilio.rest.studio.v1.flow.engagement.engagement_context.EngagementContextList
"""
if self._engagement_context... | python | {
"resource": ""
} |
q29086 | DialogueList.get | train | def get(self, sid):
"""
Constructs a DialogueContext
:param sid: The unique string that identifies the resource
:returns: twilio.rest.autopilot.v1.assistant.dialogue.DialogueContext
:rtype: twilio.rest.autopilot.v1.assistant.dialogue.DialogueContext
"""
return D... | python | {
"resource": ""
} |
q29087 | DialoguePage.get_instance | train | def get_instance(self, payload):
"""
Build an instance of DialogueInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.autopilot.v1.assistant.dialogue.DialogueInstance
:rtype: twilio.rest.autopilot.v1.assistant.dialogue.DialogueInstance
"""
... | python | {
"resource": ""
} |
q29088 | WorkspaceList.create | train | def create(self, friendly_name, event_callback_url=values.unset,
events_filter=values.unset, multi_task_enabled=values.unset,
template=values.unset, prioritize_queue_order=values.unset):
"""
Create a new WorkspaceInstance
:param unicode friendly_name: Human readabl... | python | {
"resource": ""
} |
q29089 | WorkspaceContext.activities | train | def activities(self):
"""
Access the activities
:returns: twilio.rest.taskrouter.v1.workspace.activity.ActivityList
:rtype: twilio.rest.taskrouter.v1.workspace.activity.ActivityList
"""
if self._activities is None:
self._activities = ActivityList(self._versio... | python | {
"resource": ""
} |
q29090 | WorkspaceContext.events | train | def events(self):
"""
Access the events
:returns: twilio.rest.taskrouter.v1.workspace.event.EventList
:rtype: twilio.rest.taskrouter.v1.workspace.event.EventList
"""
if self._events is None:
self._events = EventList(self._version, workspace_sid=self._solution... | python | {
"resource": ""
} |
q29091 | WorkspaceContext.task_queues | train | def task_queues(self):
"""
Access the task_queues
:returns: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueList
:rtype: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueList
"""
if self._task_queues is None:
self._task_queues = TaskQueueList(s... | python | {
"resource": ""
} |
q29092 | WorkspaceContext.workers | train | def workers(self):
"""
Access the workers
:returns: twilio.rest.taskrouter.v1.workspace.worker.WorkerList
:rtype: twilio.rest.taskrouter.v1.workspace.worker.WorkerList
"""
if self._workers is None:
self._workers = WorkerList(self._version, workspace_sid=self.... | python | {
"resource": ""
} |
q29093 | WorkspaceContext.workflows | train | def workflows(self):
"""
Access the workflows
:returns: twilio.rest.taskrouter.v1.workspace.workflow.WorkflowList
:rtype: twilio.rest.taskrouter.v1.workspace.workflow.WorkflowList
"""
if self._workflows is None:
self._workflows = WorkflowList(self._version, w... | python | {
"resource": ""
} |
q29094 | WorkspaceContext.task_channels | train | def task_channels(self):
"""
Access the task_channels
:returns: twilio.rest.taskrouter.v1.workspace.task_channel.TaskChannelList
:rtype: twilio.rest.taskrouter.v1.workspace.task_channel.TaskChannelList
"""
if self._task_channels is None:
self._task_channels =... | python | {
"resource": ""
} |
q29095 | SigningKeyList.get | train | def get(self, sid):
"""
Constructs a SigningKeyContext
:param sid: The sid
:returns: twilio.rest.api.v2010.account.signing_key.SigningKeyContext
:rtype: twilio.rest.api.v2010.account.signing_key.SigningKeyContext
"""
return SigningKeyContext(self._version, accou... | python | {
"resource": ""
} |
q29096 | SigningKeyPage.get_instance | train | def get_instance(self, payload):
"""
Build an instance of SigningKeyInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.signing_key.SigningKeyInstance
:rtype: twilio.rest.api.v2010.account.signing_key.SigningKeyInstance
""... | python | {
"resource": ""
} |
q29097 | SigningKeyContext.update | train | def update(self, friendly_name=values.unset):
"""
Update the SigningKeyInstance
:param unicode friendly_name: The friendly_name
:returns: Updated SigningKeyInstance
:rtype: twilio.rest.api.v2010.account.signing_key.SigningKeyInstance
"""
data = values.of({'Frien... | python | {
"resource": ""
} |
q29098 | DayPage.get_instance | train | def get_instance(self, payload):
"""
Build an instance of DayInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.preview.bulk_exports.export.day.DayInstance
:rtype: twilio.rest.preview.bulk_exports.export.day.DayInstance
"""
return ... | python | {
"resource": ""
} |
q29099 | ThisMonthPage.get_instance | train | def get_instance(self, payload):
"""
Build an instance of ThisMonthInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.usage.record.this_month.ThisMonthInstance
:rtype: twilio.rest.api.v2010.account.usage.record.this_month.ThisMon... | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.