repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
driftx/Telephus
telephus/protocol.py
ManagedCassandraClientFactory.login
def login(self, credentials): """ authenticate all connections """ dfrds = [] for p in self._protos: dfrds.append(p.submitRequest(ManagedThriftRequest('login', ttypes.AuthenticationRequest(credentials=credentials)))) return defer.gatherResults(dfrds)
python
def login(self, credentials): """ authenticate all connections """ dfrds = [] for p in self._protos: dfrds.append(p.submitRequest(ManagedThriftRequest('login', ttypes.AuthenticationRequest(credentials=credentials)))) return defer.gatherResults(dfrds)
[ "def", "login", "(", "self", ",", "credentials", ")", ":", "dfrds", "=", "[", "]", "for", "p", "in", "self", ".", "_protos", ":", "dfrds", ".", "append", "(", "p", ".", "submitRequest", "(", "ManagedThriftRequest", "(", "'login'", ",", "ttypes", ".", ...
authenticate all connections
[ "authenticate", "all", "connections" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/protocol.py#L204-L210
ttinoco/OPTALG
optalg/opt_solver/iqp.py
OptSolverIQP.solve
def solve(self,problem): """ Solves optimization problem. Parameters ---------- problem : Object """ # Local vars norm2 = self.norm2 norminf = self.norminf parameters = self.parameters # Parameters tol = param...
python
def solve(self,problem): """ Solves optimization problem. Parameters ---------- problem : Object """ # Local vars norm2 = self.norm2 norminf = self.norminf parameters = self.parameters # Parameters tol = param...
[ "def", "solve", "(", "self", ",", "problem", ")", ":", "# Local vars", "norm2", "=", "self", ".", "norm2", "norminf", "=", "self", ".", "norminf", "parameters", "=", "self", ".", "parameters", "# Parameters", "tol", "=", "parameters", "[", "'tol'", "]", ...
Solves optimization problem. Parameters ---------- problem : Object
[ "Solves", "optimization", "problem", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/opt_solver/iqp.py#L42-L263
ttinoco/OPTALG
optalg/lin_solver/umfpack.py
LinSolverUMFPACK.factorize
def factorize(self, A): """ Factorizes A. Parameters ---------- A : matrix For symmetric systems, should contain only lower diagonal part. """ A = csc_matrix(A) if self.prop == self.SYMMETRIC: A = (A + A.T) - triu(A) ...
python
def factorize(self, A): """ Factorizes A. Parameters ---------- A : matrix For symmetric systems, should contain only lower diagonal part. """ A = csc_matrix(A) if self.prop == self.SYMMETRIC: A = (A + A.T) - triu(A) ...
[ "def", "factorize", "(", "self", ",", "A", ")", ":", "A", "=", "csc_matrix", "(", "A", ")", "if", "self", ".", "prop", "==", "self", ".", "SYMMETRIC", ":", "A", "=", "(", "A", "+", "A", ".", "T", ")", "-", "triu", "(", "A", ")", "self", "."...
Factorizes A. Parameters ---------- A : matrix For symmetric systems, should contain only lower diagonal part.
[ "Factorizes", "A", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/umfpack.py#L35-L49
driftx/Telephus
telephus/pool.py
CassandraPoolReconnectorFactory.retry
def retry(self): """ Retry this factory's connection. It is assumed that a previous connection was attempted and failed- either before or after a successful connection. """ if self.connector is None: raise ValueError("No connector to retry") if self.s...
python
def retry(self): """ Retry this factory's connection. It is assumed that a previous connection was attempted and failed- either before or after a successful connection. """ if self.connector is None: raise ValueError("No connector to retry") if self.s...
[ "def", "retry", "(", "self", ")", ":", "if", "self", ".", "connector", "is", "None", ":", "raise", "ValueError", "(", "\"No connector to retry\"", ")", "if", "self", ".", "service", "is", "None", ":", "return", "self", ".", "connector", ".", "connect", "...
Retry this factory's connection. It is assumed that a previous connection was attempted and failed- either before or after a successful connection.
[ "Retry", "this", "factory", "s", "connection", ".", "It", "is", "assumed", "that", "a", "previous", "connection", "was", "attempted", "and", "failed", "-", "either", "before", "or", "after", "a", "successful", "connection", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/pool.py#L244-L255
driftx/Telephus
telephus/pool.py
CassandraPoolReconnectorFactory.prep_connection
def prep_connection(self, creds=None, keyspace=None, node_auto_discovery=True): """ Do login and set_keyspace tasks as necessary, and also check this node's idea of the Cassandra ring. Expects that our connection is alive. Return a Deferred that will fire with the ring informati...
python
def prep_connection(self, creds=None, keyspace=None, node_auto_discovery=True): """ Do login and set_keyspace tasks as necessary, and also check this node's idea of the Cassandra ring. Expects that our connection is alive. Return a Deferred that will fire with the ring informati...
[ "def", "prep_connection", "(", "self", ",", "creds", "=", "None", ",", "keyspace", "=", "None", ",", "node_auto_discovery", "=", "True", ")", ":", "d", "=", "defer", ".", "succeed", "(", "None", ")", "if", "creds", "is", "not", "None", ":", "d", ".",...
Do login and set_keyspace tasks as necessary, and also check this node's idea of the Cassandra ring. Expects that our connection is alive. Return a Deferred that will fire with the ring information, or be errbacked if something goes wrong.
[ "Do", "login", "and", "set_keyspace", "tasks", "as", "necessary", "and", "also", "check", "this", "node", "s", "idea", "of", "the", "Cassandra", "ring", ".", "Expects", "that", "our", "connection", "is", "alive", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/pool.py#L257-L276
driftx/Telephus
telephus/pool.py
CassandraPoolReconnectorFactory.my_pick_non_system_keyspace
def my_pick_non_system_keyspace(self): """ Find a keyspace in the cluster which is not 'system', for the purpose of getting a valid ring view. Can't use 'system' or null. """ d = self.my_describe_keyspaces() def pick_non_system(klist): for k in klist: ...
python
def my_pick_non_system_keyspace(self): """ Find a keyspace in the cluster which is not 'system', for the purpose of getting a valid ring view. Can't use 'system' or null. """ d = self.my_describe_keyspaces() def pick_non_system(klist): for k in klist: ...
[ "def", "my_pick_non_system_keyspace", "(", "self", ")", ":", "d", "=", "self", ".", "my_describe_keyspaces", "(", ")", "def", "pick_non_system", "(", "klist", ")", ":", "for", "k", "in", "klist", ":", "if", "k", ".", "name", "not", "in", "SYSTEM_KEYSPACES"...
Find a keyspace in the cluster which is not 'system', for the purpose of getting a valid ring view. Can't use 'system' or null.
[ "Find", "a", "keyspace", "in", "the", "cluster", "which", "is", "not", "system", "for", "the", "purpose", "of", "getting", "a", "valid", "ring", "view", ".", "Can", "t", "use", "system", "or", "null", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/pool.py#L326-L343
driftx/Telephus
telephus/pool.py
CassandraPoolReconnectorFactory.finish_and_die
def finish_and_die(self): """ If there is a request pending, let it finish and be handled, then disconnect and die. If not, cancel any pending queue requests and just die. """ self.logstate('finish_and_die') self.stop_working_on_queue() if self.jobphase !=...
python
def finish_and_die(self): """ If there is a request pending, let it finish and be handled, then disconnect and die. If not, cancel any pending queue requests and just die. """ self.logstate('finish_and_die') self.stop_working_on_queue() if self.jobphase !=...
[ "def", "finish_and_die", "(", "self", ")", ":", "self", ".", "logstate", "(", "'finish_and_die'", ")", "self", ".", "stop_working_on_queue", "(", ")", "if", "self", ".", "jobphase", "!=", "'pending_request'", ":", "self", ".", "stopFactory", "(", ")" ]
If there is a request pending, let it finish and be handled, then disconnect and die. If not, cancel any pending queue requests and just die.
[ "If", "there", "is", "a", "request", "pending", "let", "it", "finish", "and", "be", "handled", "then", "disconnect", "and", "die", ".", "If", "not", "cancel", "any", "pending", "queue", "requests", "and", "just", "die", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/pool.py#L449-L458
driftx/Telephus
telephus/pool.py
CassandraClusterPool.add_connection_score
def add_connection_score(self, node): """ Return a numeric value that determines this node's score for adding a new connection. A negative value indicates that no connections should be made to this node for at least that number of seconds. A value of -inf indicates no connections...
python
def add_connection_score(self, node): """ Return a numeric value that determines this node's score for adding a new connection. A negative value indicates that no connections should be made to this node for at least that number of seconds. A value of -inf indicates no connections...
[ "def", "add_connection_score", "(", "self", ",", "node", ")", ":", "# TODO: this should ideally take node history into account", "conntime", "=", "node", ".", "seconds_until_connect_ok", "(", ")", "if", "conntime", ">", "0", ":", "self", ".", "log", "(", "\"not cons...
Return a numeric value that determines this node's score for adding a new connection. A negative value indicates that no connections should be made to this node for at least that number of seconds. A value of -inf indicates no connections should be made to this node for the foreseeable f...
[ "Return", "a", "numeric", "value", "that", "determines", "this", "node", "s", "score", "for", "adding", "a", "new", "connection", ".", "A", "negative", "value", "indicates", "that", "no", "connections", "should", "be", "made", "to", "this", "node", "for", ...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/pool.py#L893-L916
driftx/Telephus
telephus/pool.py
CassandraClusterPool.adjustPoolSize
def adjustPoolSize(self, newsize): """ Change the target pool size. If we have too many connections already, ask some to finish what they're doing and die (preferring to kill connections to the node that already has the most connections). If we have too few, create more. ...
python
def adjustPoolSize(self, newsize): """ Change the target pool size. If we have too many connections already, ask some to finish what they're doing and die (preferring to kill connections to the node that already has the most connections). If we have too few, create more. ...
[ "def", "adjustPoolSize", "(", "self", ",", "newsize", ")", ":", "if", "newsize", "<", "0", ":", "raise", "ValueError", "(", "\"pool size must be nonnegative\"", ")", "self", ".", "log", "(", "\"Adjust pool size from %d to %d.\"", "%", "(", "self", ".", "target_p...
Change the target pool size. If we have too many connections already, ask some to finish what they're doing and die (preferring to kill connections to the node that already has the most connections). If we have too few, create more.
[ "Change", "the", "target", "pool", "size", ".", "If", "we", "have", "too", "many", "connections", "already", "ask", "some", "to", "finish", "what", "they", "re", "doing", "and", "die", "(", "preferring", "to", "kill", "connections", "to", "the", "node", ...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/pool.py#L918-L932
driftx/Telephus
telephus/pool.py
CassandraClusterPool.fill_pool
def fill_pool(self): """ Add connections as necessary to meet the target pool size. If there are no nodes to connect to (because we maxed out connections-per-node on all active connections and any unconnected nodes have pending reconnect timers), call the on_insufficient_nodes ca...
python
def fill_pool(self): """ Add connections as necessary to meet the target pool size. If there are no nodes to connect to (because we maxed out connections-per-node on all active connections and any unconnected nodes have pending reconnect timers), call the on_insufficient_nodes ca...
[ "def", "fill_pool", "(", "self", ")", ":", "time_since_last_called", "=", "self", ".", "fill_pool_throttle", "if", "self", ".", "fill_pool_last_called", "is", "not", "None", ":", "time_since_last_called", "=", "time", "(", ")", "-", "self", ".", "fill_pool_last_...
Add connections as necessary to meet the target pool size. If there are no nodes to connect to (because we maxed out connections-per-node on all active connections and any unconnected nodes have pending reconnect timers), call the on_insufficient_nodes callback.
[ "Add", "connections", "as", "necessary", "to", "meet", "the", "target", "pool", "size", ".", "If", "there", "are", "no", "nodes", "to", "connect", "to", "(", "because", "we", "maxed", "out", "connections", "-", "per", "-", "node", "on", "all", "active", ...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/pool.py#L1002-L1038
driftx/Telephus
telephus/pool.py
CassandraClusterPool.resubmit
def resubmit(self, req, keyspace, req_d, retries): """ Push this request to the front of the line, just to be a jerk. """ self.log('resubmitting %s request' % (req.method,)) self.pushRequest_really(req, keyspace, req_d, retries) try: self.request_queue.pending...
python
def resubmit(self, req, keyspace, req_d, retries): """ Push this request to the front of the line, just to be a jerk. """ self.log('resubmitting %s request' % (req.method,)) self.pushRequest_really(req, keyspace, req_d, retries) try: self.request_queue.pending...
[ "def", "resubmit", "(", "self", ",", "req", ",", "keyspace", ",", "req_d", ",", "retries", ")", ":", "self", ".", "log", "(", "'resubmitting %s request'", "%", "(", "req", ".", "method", ",", ")", ")", "self", ".", "pushRequest_really", "(", "req", ","...
Push this request to the front of the line, just to be a jerk.
[ "Push", "this", "request", "to", "the", "front", "of", "the", "line", "just", "to", "be", "a", "jerk", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/pool.py#L1154-L1166
driftx/Telephus
telephus/pool.py
CassandraClusterPool.set_keyspace
def set_keyspace(self, keyspace): """ Change the keyspace which will be used for subsequent requests to this CassandraClusterPool, and return a Deferred that will fire once it can be verified that connections can successfully use that keyspace. If something goes wrong trying to ...
python
def set_keyspace(self, keyspace): """ Change the keyspace which will be used for subsequent requests to this CassandraClusterPool, and return a Deferred that will fire once it can be verified that connections can successfully use that keyspace. If something goes wrong trying to ...
[ "def", "set_keyspace", "(", "self", ",", "keyspace", ")", ":", "# push a real set_keyspace on some (any) connection; the idea is that", "# if it succeeds there, it is likely to succeed everywhere, and vice", "# versa. don't bother waiting for all connections to change- some of", "# them may b...
Change the keyspace which will be used for subsequent requests to this CassandraClusterPool, and return a Deferred that will fire once it can be verified that connections can successfully use that keyspace. If something goes wrong trying to change a connection to that keyspace, the Defe...
[ "Change", "the", "keyspace", "which", "will", "be", "used", "for", "subsequent", "requests", "to", "this", "CassandraClusterPool", "and", "return", "a", "Deferred", "that", "will", "fire", "once", "it", "can", "be", "verified", "that", "connections", "can", "s...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/pool.py#L1168-L1196
driftx/Telephus
telephus/pool.py
CassandraClusterPool.keyspaceConnection
def keyspaceConnection(self, keyspace, consistency=ConsistencyLevel.ONE): """ Return a CassandraClient instance which uses this CassandraClusterPool by way of a CassandraKeyspaceConnection, so that all requests made through it are guaranteed to go to the given keyspace, no matter what ...
python
def keyspaceConnection(self, keyspace, consistency=ConsistencyLevel.ONE): """ Return a CassandraClient instance which uses this CassandraClusterPool by way of a CassandraKeyspaceConnection, so that all requests made through it are guaranteed to go to the given keyspace, no matter what ...
[ "def", "keyspaceConnection", "(", "self", ",", "keyspace", ",", "consistency", "=", "ConsistencyLevel", ".", "ONE", ")", ":", "conn", "=", "CassandraKeyspaceConnection", "(", "self", ",", "keyspace", ")", "return", "CassandraClient", "(", "conn", ",", "consisten...
Return a CassandraClient instance which uses this CassandraClusterPool by way of a CassandraKeyspaceConnection, so that all requests made through it are guaranteed to go to the given keyspace, no matter what other consumers of this pool may do.
[ "Return", "a", "CassandraClient", "instance", "which", "uses", "this", "CassandraClusterPool", "by", "way", "of", "a", "CassandraKeyspaceConnection", "so", "that", "all", "requests", "made", "through", "it", "are", "guaranteed", "to", "go", "to", "the", "given", ...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/pool.py#L1213-L1221
pre-commit/pre-commit-mirror-maker
pre_commit_mirror_maker/main.py
split_by_commas
def split_by_commas(maybe_s: str) -> Tuple[str, ...]: """Split a string by commas, but allow escaped commas. - If maybe_s is falsey, returns an empty tuple - Ignore backslashed commas """ if not maybe_s: return () parts: List[str] = [] split_by_backslash = maybe_s.split(r'\,') fo...
python
def split_by_commas(maybe_s: str) -> Tuple[str, ...]: """Split a string by commas, but allow escaped commas. - If maybe_s is falsey, returns an empty tuple - Ignore backslashed commas """ if not maybe_s: return () parts: List[str] = [] split_by_backslash = maybe_s.split(r'\,') fo...
[ "def", "split_by_commas", "(", "maybe_s", ":", "str", ")", "->", "Tuple", "[", "str", ",", "...", "]", ":", "if", "not", "maybe_s", ":", "return", "(", ")", "parts", ":", "List", "[", "str", "]", "=", "[", "]", "split_by_backslash", "=", "maybe_s", ...
Split a string by commas, but allow escaped commas. - If maybe_s is falsey, returns an empty tuple - Ignore backslashed commas
[ "Split", "a", "string", "by", "commas", "but", "allow", "escaped", "commas", ".", "-", "If", "maybe_s", "is", "falsey", "returns", "an", "empty", "tuple", "-", "Ignore", "backslashed", "commas" ]
train
https://github.com/pre-commit/pre-commit-mirror-maker/blob/8bafa3b87e67d291d5a747f0137b921a170a1723/pre_commit_mirror_maker/main.py#L12-L28
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.login
def login(self, auth_request): """ Parameters: - auth_request """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_login(auth_request) return d
python
def login(self, auth_request): """ Parameters: - auth_request """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_login(auth_request) return d
[ "def", "login", "(", "self", ",", "auth_request", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_login", "(", "auth_request", ...
Parameters: - auth_request
[ "Parameters", ":", "-", "auth_request" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L464-L472
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.set_keyspace
def set_keyspace(self, keyspace): """ Parameters: - keyspace """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_set_keyspace(keyspace) return d
python
def set_keyspace(self, keyspace): """ Parameters: - keyspace """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_set_keyspace(keyspace) return d
[ "def", "set_keyspace", "(", "self", ",", "keyspace", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_set_keyspace", "(", "keyspac...
Parameters: - keyspace
[ "Parameters", ":", "-", "keyspace" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L499-L507
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.get
def get(self, key, column_path, consistency_level): """ Get the Column or SuperColumn at the given column_path. If no value is present, NotFoundException is thrown. (This is the only method that can throw an exception under non-failure conditions.) Parameters: - key - column_path - consi...
python
def get(self, key, column_path, consistency_level): """ Get the Column or SuperColumn at the given column_path. If no value is present, NotFoundException is thrown. (This is the only method that can throw an exception under non-failure conditions.) Parameters: - key - column_path - consi...
[ "def", "get", "(", "self", ",", "key", ",", "column_path", ",", "consistency_level", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", ...
Get the Column or SuperColumn at the given column_path. If no value is present, NotFoundException is thrown. (This is the only method that can throw an exception under non-failure conditions.) Parameters: - key - column_path - consistency_level
[ "Get", "the", "Column", "or", "SuperColumn", "at", "the", "given", "column_path", ".", "If", "no", "value", "is", "present", "NotFoundException", "is", "thrown", ".", "(", "This", "is", "the", "only", "method", "that", "can", "throw", "an", "exception", "u...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L532-L545
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.get_slice
def get_slice(self, key, column_parent, predicate, consistency_level): """ Get the group of columns contained by column_parent (either a ColumnFamily name or a ColumnFamily/SuperColumn name pair) specified by the given SlicePredicate. If no matching values are found, an empty list is returned. Paramete...
python
def get_slice(self, key, column_parent, predicate, consistency_level): """ Get the group of columns contained by column_parent (either a ColumnFamily name or a ColumnFamily/SuperColumn name pair) specified by the given SlicePredicate. If no matching values are found, an empty list is returned. Paramete...
[ "def", "get_slice", "(", "self", ",", "key", ",", "column_parent", ",", "predicate", ",", "consistency_level", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", ...
Get the group of columns contained by column_parent (either a ColumnFamily name or a ColumnFamily/SuperColumn name pair) specified by the given SlicePredicate. If no matching values are found, an empty list is returned. Parameters: - key - column_parent - predicate - consistency_level
[ "Get", "the", "group", "of", "columns", "contained", "by", "column_parent", "(", "either", "a", "ColumnFamily", "name", "or", "a", "ColumnFamily", "/", "SuperColumn", "name", "pair", ")", "specified", "by", "the", "given", "SlicePredicate", ".", "If", "no", ...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L580-L594
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.get_count
def get_count(self, key, column_parent, predicate, consistency_level): """ returns the number of columns matching <code>predicate</code> for a particular <code>key</code>, <code>ColumnFamily</code> and optionally <code>SuperColumn</code>. Parameters: - key - column_parent - predicate ...
python
def get_count(self, key, column_parent, predicate, consistency_level): """ returns the number of columns matching <code>predicate</code> for a particular <code>key</code>, <code>ColumnFamily</code> and optionally <code>SuperColumn</code>. Parameters: - key - column_parent - predicate ...
[ "def", "get_count", "(", "self", ",", "key", ",", "column_parent", ",", "predicate", ",", "consistency_level", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", ...
returns the number of columns matching <code>predicate</code> for a particular <code>key</code>, <code>ColumnFamily</code> and optionally <code>SuperColumn</code>. Parameters: - key - column_parent - predicate - consistency_level
[ "returns", "the", "number", "of", "columns", "matching", "<code", ">", "predicate<", "/", "code", ">", "for", "a", "particular", "<code", ">", "key<", "/", "code", ">", "<code", ">", "ColumnFamily<", "/", "code", ">", "and", "optionally", "<code", ">", "...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L628-L642
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.multiget_slice
def multiget_slice(self, keys, column_parent, predicate, consistency_level): """ Performs a get_slice for column_parent and predicate for the given keys in parallel. Parameters: - keys - column_parent - predicate - consistency_level """ self._seqid += 1 d = self._reqs[self._...
python
def multiget_slice(self, keys, column_parent, predicate, consistency_level): """ Performs a get_slice for column_parent and predicate for the given keys in parallel. Parameters: - keys - column_parent - predicate - consistency_level """ self._seqid += 1 d = self._reqs[self._...
[ "def", "multiget_slice", "(", "self", ",", "keys", ",", "column_parent", ",", "predicate", ",", "consistency_level", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferr...
Performs a get_slice for column_parent and predicate for the given keys in parallel. Parameters: - keys - column_parent - predicate - consistency_level
[ "Performs", "a", "get_slice", "for", "column_parent", "and", "predicate", "for", "the", "given", "keys", "in", "parallel", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L676-L689
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.multiget_count
def multiget_count(self, keys, column_parent, predicate, consistency_level): """ Perform a get_count in parallel on the given list<binary> keys. The return value maps keys to the count found. Parameters: - keys - column_parent - predicate - consistency_level """ self._seqid += 1...
python
def multiget_count(self, keys, column_parent, predicate, consistency_level): """ Perform a get_count in parallel on the given list<binary> keys. The return value maps keys to the count found. Parameters: - keys - column_parent - predicate - consistency_level """ self._seqid += 1...
[ "def", "multiget_count", "(", "self", ",", "keys", ",", "column_parent", ",", "predicate", ",", "consistency_level", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferr...
Perform a get_count in parallel on the given list<binary> keys. The return value maps keys to the count found. Parameters: - keys - column_parent - predicate - consistency_level
[ "Perform", "a", "get_count", "in", "parallel", "on", "the", "given", "list<binary", ">", "keys", ".", "The", "return", "value", "maps", "keys", "to", "the", "count", "found", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L723-L736
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.get_range_slices
def get_range_slices(self, column_parent, predicate, range, consistency_level): """ returns a subset of columns for a contiguous range of keys. Parameters: - column_parent - predicate - range - consistency_level """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferr...
python
def get_range_slices(self, column_parent, predicate, range, consistency_level): """ returns a subset of columns for a contiguous range of keys. Parameters: - column_parent - predicate - range - consistency_level """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferr...
[ "def", "get_range_slices", "(", "self", ",", "column_parent", ",", "predicate", ",", "range", ",", "consistency_level", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Def...
returns a subset of columns for a contiguous range of keys. Parameters: - column_parent - predicate - range - consistency_level
[ "returns", "a", "subset", "of", "columns", "for", "a", "contiguous", "range", "of", "keys", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L770-L783
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.get_paged_slice
def get_paged_slice(self, column_family, range, start_column, consistency_level): """ returns a range of columns, wrapping to the next rows if necessary to collect max_results. Parameters: - column_family - range - start_column - consistency_level """ self._seqid += 1 d = se...
python
def get_paged_slice(self, column_family, range, start_column, consistency_level): """ returns a range of columns, wrapping to the next rows if necessary to collect max_results. Parameters: - column_family - range - start_column - consistency_level """ self._seqid += 1 d = se...
[ "def", "get_paged_slice", "(", "self", ",", "column_family", ",", "range", ",", "start_column", ",", "consistency_level", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "D...
returns a range of columns, wrapping to the next rows if necessary to collect max_results. Parameters: - column_family - range - start_column - consistency_level
[ "returns", "a", "range", "of", "columns", "wrapping", "to", "the", "next", "rows", "if", "necessary", "to", "collect", "max_results", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L817-L830
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.get_indexed_slices
def get_indexed_slices(self, column_parent, index_clause, column_predicate, consistency_level): """ Returns the subset of columns specified in SlicePredicate for the rows matching the IndexClause @deprecated use get_range_slices instead with range.row_filter specified Parameters: - column_parent ...
python
def get_indexed_slices(self, column_parent, index_clause, column_predicate, consistency_level): """ Returns the subset of columns specified in SlicePredicate for the rows matching the IndexClause @deprecated use get_range_slices instead with range.row_filter specified Parameters: - column_parent ...
[ "def", "get_indexed_slices", "(", "self", ",", "column_parent", ",", "index_clause", ",", "column_predicate", ",", "consistency_level", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer...
Returns the subset of columns specified in SlicePredicate for the rows matching the IndexClause @deprecated use get_range_slices instead with range.row_filter specified Parameters: - column_parent - index_clause - column_predicate - consistency_level
[ "Returns", "the", "subset", "of", "columns", "specified", "in", "SlicePredicate", "for", "the", "rows", "matching", "the", "IndexClause", "@deprecated", "use", "get_range_slices", "instead", "with", "range", ".", "row_filter", "specified" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L864-L878
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.insert
def insert(self, key, column_parent, column, consistency_level): """ Insert a Column at the given column_parent.column_family and optional column_parent.super_column. Parameters: - key - column_parent - column - consistency_level """ self._seqid += 1 d = self._reqs[self._seq...
python
def insert(self, key, column_parent, column, consistency_level): """ Insert a Column at the given column_parent.column_family and optional column_parent.super_column. Parameters: - key - column_parent - column - consistency_level """ self._seqid += 1 d = self._reqs[self._seq...
[ "def", "insert", "(", "self", ",", "key", ",", "column_parent", ",", "column", ",", "consistency_level", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ...
Insert a Column at the given column_parent.column_family and optional column_parent.super_column. Parameters: - key - column_parent - column - consistency_level
[ "Insert", "a", "Column", "at", "the", "given", "column_parent", ".", "column_family", "and", "optional", "column_parent", ".", "super_column", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L912-L925
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.add
def add(self, key, column_parent, column, consistency_level): """ Increment or decrement a counter. Parameters: - key - column_parent - column - consistency_level """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_add(key, column_parent, column...
python
def add(self, key, column_parent, column, consistency_level): """ Increment or decrement a counter. Parameters: - key - column_parent - column - consistency_level """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_add(key, column_parent, column...
[ "def", "add", "(", "self", ",", "key", ",", "column_parent", ",", "column", ",", "consistency_level", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", "...
Increment or decrement a counter. Parameters: - key - column_parent - column - consistency_level
[ "Increment", "or", "decrement", "a", "counter", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L957-L970
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.remove
def remove(self, key, column_path, timestamp, consistency_level): """ Remove data from the row specified by key at the granularity specified by column_path, and the given timestamp. Note that all the values in column_path besides column_path.column_family are truly optional: you can remove the entire ro...
python
def remove(self, key, column_path, timestamp, consistency_level): """ Remove data from the row specified by key at the granularity specified by column_path, and the given timestamp. Note that all the values in column_path besides column_path.column_family are truly optional: you can remove the entire ro...
[ "def", "remove", "(", "self", ",", "key", ",", "column_path", ",", "timestamp", ",", "consistency_level", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(",...
Remove data from the row specified by key at the granularity specified by column_path, and the given timestamp. Note that all the values in column_path besides column_path.column_family are truly optional: you can remove the entire row by just specifying the ColumnFamily, or you can remove a SuperColumn or a si...
[ "Remove", "data", "from", "the", "row", "specified", "by", "key", "at", "the", "granularity", "specified", "by", "column_path", "and", "the", "given", "timestamp", ".", "Note", "that", "all", "the", "values", "in", "column_path", "besides", "column_path", ".",...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1002-L1017
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.remove_counter
def remove_counter(self, key, path, consistency_level): """ Remove a counter at the specified location. Note that counters have limited support for deletes: if you remove a counter, you must wait to issue any following update until the delete has reached all the nodes and all of them have been fully com...
python
def remove_counter(self, key, path, consistency_level): """ Remove a counter at the specified location. Note that counters have limited support for deletes: if you remove a counter, you must wait to issue any following update until the delete has reached all the nodes and all of them have been fully com...
[ "def", "remove_counter", "(", "self", ",", "key", ",", "path", ",", "consistency_level", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", "...
Remove a counter at the specified location. Note that counters have limited support for deletes: if you remove a counter, you must wait to issue any following update until the delete has reached all the nodes and all of them have been fully compacted. Parameters: - key - path - consistency_l...
[ "Remove", "a", "counter", "at", "the", "specified", "location", ".", "Note", "that", "counters", "have", "limited", "support", "for", "deletes", ":", "if", "you", "remove", "a", "counter", "you", "must", "wait", "to", "issue", "any", "following", "update", ...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1049-L1063
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.batch_mutate
def batch_mutate(self, mutation_map, consistency_level): """ Mutate many columns or super columns for many row keys. See also: Mutation. mutation_map maps key to column family to a list of Mutation objects to take place at that scope. * Parameters: - mutation_map - consistency_level ...
python
def batch_mutate(self, mutation_map, consistency_level): """ Mutate many columns or super columns for many row keys. See also: Mutation. mutation_map maps key to column family to a list of Mutation objects to take place at that scope. * Parameters: - mutation_map - consistency_level ...
[ "def", "batch_mutate", "(", "self", ",", "mutation_map", ",", "consistency_level", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "sen...
Mutate many columns or super columns for many row keys. See also: Mutation. mutation_map maps key to column family to a list of Mutation objects to take place at that scope. * Parameters: - mutation_map - consistency_level
[ "Mutate", "many", "columns", "or", "super", "columns", "for", "many", "row", "keys", ".", "See", "also", ":", "Mutation", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1094-L1108
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.atomic_batch_mutate
def atomic_batch_mutate(self, mutation_map, consistency_level): """ Atomically mutate many columns or super columns for many row keys. See also: Mutation. mutation_map maps key to column family to a list of Mutation objects to take place at that scope. * Parameters: - mutation_map - ...
python
def atomic_batch_mutate(self, mutation_map, consistency_level): """ Atomically mutate many columns or super columns for many row keys. See also: Mutation. mutation_map maps key to column family to a list of Mutation objects to take place at that scope. * Parameters: - mutation_map - ...
[ "def", "atomic_batch_mutate", "(", "self", ",", "mutation_map", ",", "consistency_level", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".",...
Atomically mutate many columns or super columns for many row keys. See also: Mutation. mutation_map maps key to column family to a list of Mutation objects to take place at that scope. * Parameters: - mutation_map - consistency_level
[ "Atomically", "mutate", "many", "columns", "or", "super", "columns", "for", "many", "row", "keys", ".", "See", "also", ":", "Mutation", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1138-L1152
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.truncate
def truncate(self, cfname): """ Truncate will mark and entire column family as deleted. From the user's perspective a successful call to truncate will result complete data deletion from cfname. Internally, however, disk space will not be immediatily released, as with all deletes in cassandra, this one ...
python
def truncate(self, cfname): """ Truncate will mark and entire column family as deleted. From the user's perspective a successful call to truncate will result complete data deletion from cfname. Internally, however, disk space will not be immediatily released, as with all deletes in cassandra, this one ...
[ "def", "truncate", "(", "self", ",", "cfname", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_truncate", "(", "cfname", ")", ...
Truncate will mark and entire column family as deleted. From the user's perspective a successful call to truncate will result complete data deletion from cfname. Internally, however, disk space will not be immediatily released, as with all deletes in cassandra, this one only marks the data as deleted. T...
[ "Truncate", "will", "mark", "and", "entire", "column", "family", "as", "deleted", ".", "From", "the", "user", "s", "perspective", "a", "successful", "call", "to", "truncate", "will", "result", "complete", "data", "deletion", "from", "cfname", ".", "Internally"...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1182-L1197
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.describe_schema_versions
def describe_schema_versions(self, ): """ for each schema version present in the cluster, returns a list of nodes at that version. hosts that do not respond will be under the key DatabaseDescriptor.INITIAL_VERSION. the cluster is all on the same version if the size of the map is 1. """ self._seq...
python
def describe_schema_versions(self, ): """ for each schema version present in the cluster, returns a list of nodes at that version. hosts that do not respond will be under the key DatabaseDescriptor.INITIAL_VERSION. the cluster is all on the same version if the size of the map is 1. """ self._seq...
[ "def", "describe_schema_versions", "(", "self", ",", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_describe_schema_versions", "(", ...
for each schema version present in the cluster, returns a list of nodes at that version. hosts that do not respond will be under the key DatabaseDescriptor.INITIAL_VERSION. the cluster is all on the same version if the size of the map is 1.
[ "for", "each", "schema", "version", "present", "in", "the", "cluster", "returns", "a", "list", "of", "nodes", "at", "that", "version", ".", "hosts", "that", "do", "not", "respond", "will", "be", "under", "the", "key", "DatabaseDescriptor", ".", "INITIAL_VERS...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1226-L1235
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.describe_keyspaces
def describe_keyspaces(self, ): """ list the defined keyspaces in this cluster """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_keyspaces() return d
python
def describe_keyspaces(self, ): """ list the defined keyspaces in this cluster """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_keyspaces() return d
[ "def", "describe_keyspaces", "(", "self", ",", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_describe_keyspaces", "(", ")", "re...
list the defined keyspaces in this cluster
[ "list", "the", "defined", "keyspaces", "in", "this", "cluster" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1261-L1268
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.describe_cluster_name
def describe_cluster_name(self, ): """ get the cluster name """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_cluster_name() return d
python
def describe_cluster_name(self, ): """ get the cluster name """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_cluster_name() return d
[ "def", "describe_cluster_name", "(", "self", ",", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_describe_cluster_name", "(", ")",...
get the cluster name
[ "get", "the", "cluster", "name" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1294-L1301
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.describe_version
def describe_version(self, ): """ get the thrift api version """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_version() return d
python
def describe_version(self, ): """ get the thrift api version """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_version() return d
[ "def", "describe_version", "(", "self", ",", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_describe_version", "(", ")", "return...
get the thrift api version
[ "get", "the", "thrift", "api", "version" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1325-L1332
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.describe_ring
def describe_ring(self, keyspace): """ get the token ring: a map of ranges to host addresses, represented as a set of TokenRange instead of a map from range to list of endpoints, because you can't use Thrift structs as map keys: https://issues.apache.org/jira/browse/THRIFT-162 for the same ...
python
def describe_ring(self, keyspace): """ get the token ring: a map of ranges to host addresses, represented as a set of TokenRange instead of a map from range to list of endpoints, because you can't use Thrift structs as map keys: https://issues.apache.org/jira/browse/THRIFT-162 for the same ...
[ "def", "describe_ring", "(", "self", ",", "keyspace", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_describe_ring", "(", "keysp...
get the token ring: a map of ranges to host addresses, represented as a set of TokenRange instead of a map from range to list of endpoints, because you can't use Thrift structs as map keys: https://issues.apache.org/jira/browse/THRIFT-162 for the same reason, we can't return a set here, even though...
[ "get", "the", "token", "ring", ":", "a", "map", "of", "ranges", "to", "host", "addresses", "represented", "as", "a", "set", "of", "TokenRange", "instead", "of", "a", "map", "from", "range", "to", "list", "of", "endpoints", "because", "you", "can", "t", ...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1356-L1373
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.describe_token_map
def describe_token_map(self, ): """ get the mapping between token->node ip without taking replication into consideration https://issues.apache.org/jira/browse/CASSANDRA-4092 """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_token_map() return d
python
def describe_token_map(self, ): """ get the mapping between token->node ip without taking replication into consideration https://issues.apache.org/jira/browse/CASSANDRA-4092 """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_token_map() return d
[ "def", "describe_token_map", "(", "self", ",", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_describe_token_map", "(", ")", "re...
get the mapping between token->node ip without taking replication into consideration https://issues.apache.org/jira/browse/CASSANDRA-4092
[ "get", "the", "mapping", "between", "token", "-", ">", "node", "ip", "without", "taking", "replication", "into", "consideration", "https", ":", "//", "issues", ".", "apache", ".", "org", "/", "jira", "/", "browse", "/", "CASSANDRA", "-", "4092" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1400-L1409
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.describe_partitioner
def describe_partitioner(self, ): """ returns the partitioner used by this cluster """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_partitioner() return d
python
def describe_partitioner(self, ): """ returns the partitioner used by this cluster """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_partitioner() return d
[ "def", "describe_partitioner", "(", "self", ",", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_describe_partitioner", "(", ")", ...
returns the partitioner used by this cluster
[ "returns", "the", "partitioner", "used", "by", "this", "cluster" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1435-L1442
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.describe_snitch
def describe_snitch(self, ): """ returns the snitch used by this cluster """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_snitch() return d
python
def describe_snitch(self, ): """ returns the snitch used by this cluster """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_snitch() return d
[ "def", "describe_snitch", "(", "self", ",", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_describe_snitch", "(", ")", "return",...
returns the snitch used by this cluster
[ "returns", "the", "snitch", "used", "by", "this", "cluster" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1466-L1473
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.describe_keyspace
def describe_keyspace(self, keyspace): """ describe specified keyspace Parameters: - keyspace """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_keyspace(keyspace) return d
python
def describe_keyspace(self, keyspace): """ describe specified keyspace Parameters: - keyspace """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_keyspace(keyspace) return d
[ "def", "describe_keyspace", "(", "self", ",", "keyspace", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_describe_keyspace", "(", ...
describe specified keyspace Parameters: - keyspace
[ "describe", "specified", "keyspace" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1497-L1507
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.describe_splits
def describe_splits(self, cfName, start_token, end_token, keys_per_split): """ experimental API for hadoop/parallel query support. may change violently and without warning. returns list of token strings such that first subrange is (list[0], list[1]], next is (list[1], list[2]], etc. Parameters...
python
def describe_splits(self, cfName, start_token, end_token, keys_per_split): """ experimental API for hadoop/parallel query support. may change violently and without warning. returns list of token strings such that first subrange is (list[0], list[1]], next is (list[1], list[2]], etc. Parameters...
[ "def", "describe_splits", "(", "self", ",", "cfName", ",", "start_token", ",", "end_token", ",", "keys_per_split", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred...
experimental API for hadoop/parallel query support. may change violently and without warning. returns list of token strings such that first subrange is (list[0], list[1]], next is (list[1], list[2]], etc. Parameters: - cfName - start_token - end_token - keys_per_split
[ "experimental", "API", "for", "hadoop", "/", "parallel", "query", "support", ".", "may", "change", "violently", "and", "without", "warning", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1536-L1553
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.trace_next_query
def trace_next_query(self, ): """ Enables tracing for the next query in this connection and returns the UUID for that trace session The next query will be traced idependently of trace probability and the returned UUID can be used to query the trace keyspace """ self._seqid += 1 d = self._reqs[se...
python
def trace_next_query(self, ): """ Enables tracing for the next query in this connection and returns the UUID for that trace session The next query will be traced idependently of trace probability and the returned UUID can be used to query the trace keyspace """ self._seqid += 1 d = self._reqs[se...
[ "def", "trace_next_query", "(", "self", ",", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_trace_next_query", "(", ")", "return...
Enables tracing for the next query in this connection and returns the UUID for that trace session The next query will be traced idependently of trace probability and the returned UUID can be used to query the trace keyspace
[ "Enables", "tracing", "for", "the", "next", "query", "in", "this", "connection", "and", "returns", "the", "UUID", "for", "that", "trace", "session", "The", "next", "query", "will", "be", "traced", "idependently", "of", "trace", "probability", "and", "the", "...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1583-L1591
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.describe_splits_ex
def describe_splits_ex(self, cfName, start_token, end_token, keys_per_split): """ Parameters: - cfName - start_token - end_token - keys_per_split """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_splits_ex(cfName, start_token, end_token, k...
python
def describe_splits_ex(self, cfName, start_token, end_token, keys_per_split): """ Parameters: - cfName - start_token - end_token - keys_per_split """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_describe_splits_ex(cfName, start_token, end_token, k...
[ "def", "describe_splits_ex", "(", "self", ",", "cfName", ",", "start_token", ",", "end_token", ",", "keys_per_split", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Defer...
Parameters: - cfName - start_token - end_token - keys_per_split
[ "Parameters", ":", "-", "cfName", "-", "start_token", "-", "end_token", "-", "keys_per_split" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1615-L1626
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.system_add_column_family
def system_add_column_family(self, cf_def): """ adds a column family. returns the new schema id. Parameters: - cf_def """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_system_add_column_family(cf_def) return d
python
def system_add_column_family(self, cf_def): """ adds a column family. returns the new schema id. Parameters: - cf_def """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_system_add_column_family(cf_def) return d
[ "def", "system_add_column_family", "(", "self", ",", "cf_def", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_system_add_column_fami...
adds a column family. returns the new schema id. Parameters: - cf_def
[ "adds", "a", "column", "family", ".", "returns", "the", "new", "schema", "id", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1656-L1666
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.system_drop_column_family
def system_drop_column_family(self, column_family): """ drops a column family. returns the new schema id. Parameters: - column_family """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_system_drop_column_family(column_family) return d
python
def system_drop_column_family(self, column_family): """ drops a column family. returns the new schema id. Parameters: - column_family """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_system_drop_column_family(column_family) return d
[ "def", "system_drop_column_family", "(", "self", ",", "column_family", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_system_drop_co...
drops a column family. returns the new schema id. Parameters: - column_family
[ "drops", "a", "column", "family", ".", "returns", "the", "new", "schema", "id", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1695-L1705
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.system_add_keyspace
def system_add_keyspace(self, ks_def): """ adds a keyspace and any column families that are part of it. returns the new schema id. Parameters: - ks_def """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_system_add_keyspace(ks_def) return d
python
def system_add_keyspace(self, ks_def): """ adds a keyspace and any column families that are part of it. returns the new schema id. Parameters: - ks_def """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_system_add_keyspace(ks_def) return d
[ "def", "system_add_keyspace", "(", "self", ",", "ks_def", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_system_add_keyspace", "("...
adds a keyspace and any column families that are part of it. returns the new schema id. Parameters: - ks_def
[ "adds", "a", "keyspace", "and", "any", "column", "families", "that", "are", "part", "of", "it", ".", "returns", "the", "new", "schema", "id", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1734-L1744
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.system_drop_keyspace
def system_drop_keyspace(self, keyspace): """ drops a keyspace and any column families that are part of it. returns the new schema id. Parameters: - keyspace """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_system_drop_keyspace(keyspace) return d
python
def system_drop_keyspace(self, keyspace): """ drops a keyspace and any column families that are part of it. returns the new schema id. Parameters: - keyspace """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_system_drop_keyspace(keyspace) return d
[ "def", "system_drop_keyspace", "(", "self", ",", "keyspace", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_system_drop_keyspace", ...
drops a keyspace and any column families that are part of it. returns the new schema id. Parameters: - keyspace
[ "drops", "a", "keyspace", "and", "any", "column", "families", "that", "are", "part", "of", "it", ".", "returns", "the", "new", "schema", "id", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1773-L1783
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.system_update_keyspace
def system_update_keyspace(self, ks_def): """ updates properties of a keyspace. returns the new schema id. Parameters: - ks_def """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_system_update_keyspace(ks_def) return d
python
def system_update_keyspace(self, ks_def): """ updates properties of a keyspace. returns the new schema id. Parameters: - ks_def """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_system_update_keyspace(ks_def) return d
[ "def", "system_update_keyspace", "(", "self", ",", "ks_def", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_system_update_keyspace",...
updates properties of a keyspace. returns the new schema id. Parameters: - ks_def
[ "updates", "properties", "of", "a", "keyspace", ".", "returns", "the", "new", "schema", "id", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1812-L1822
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.system_update_column_family
def system_update_column_family(self, cf_def): """ updates properties of a column family. returns the new schema id. Parameters: - cf_def """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_system_update_column_family(cf_def) return d
python
def system_update_column_family(self, cf_def): """ updates properties of a column family. returns the new schema id. Parameters: - cf_def """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_system_update_column_family(cf_def) return d
[ "def", "system_update_column_family", "(", "self", ",", "cf_def", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_system_update_colum...
updates properties of a column family. returns the new schema id. Parameters: - cf_def
[ "updates", "properties", "of", "a", "column", "family", ".", "returns", "the", "new", "schema", "id", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1851-L1861
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.execute_cql_query
def execute_cql_query(self, query, compression): """ Executes a CQL (Cassandra Query Language) statement and returns a CqlResult containing the results. Parameters: - query - compression """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_execute_cql_...
python
def execute_cql_query(self, query, compression): """ Executes a CQL (Cassandra Query Language) statement and returns a CqlResult containing the results. Parameters: - query - compression """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_execute_cql_...
[ "def", "execute_cql_query", "(", "self", ",", "query", ",", "compression", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_execut...
Executes a CQL (Cassandra Query Language) statement and returns a CqlResult containing the results. Parameters: - query - compression
[ "Executes", "a", "CQL", "(", "Cassandra", "Query", "Language", ")", "statement", "and", "returns", "a", "CqlResult", "containing", "the", "results", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1890-L1902
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.execute_cql3_query
def execute_cql3_query(self, query, compression, consistency): """ Parameters: - query - compression - consistency """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_execute_cql3_query(query, compression, consistency) return d
python
def execute_cql3_query(self, query, compression, consistency): """ Parameters: - query - compression - consistency """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_execute_cql3_query(query, compression, consistency) return d
[ "def", "execute_cql3_query", "(", "self", ",", "query", ",", "compression", ",", "consistency", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "sel...
Parameters: - query - compression - consistency
[ "Parameters", ":", "-", "query", "-", "compression", "-", "consistency" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1936-L1946
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.prepare_cql_query
def prepare_cql_query(self, query, compression): """ Prepare a CQL (Cassandra Query Language) statement by compiling and returning - the type of CQL statement - an id token of the compiled CQL stored on the server side. - a count of the discovered bound markers in the statement Parameters: ...
python
def prepare_cql_query(self, query, compression): """ Prepare a CQL (Cassandra Query Language) statement by compiling and returning - the type of CQL statement - an id token of the compiled CQL stored on the server side. - a count of the discovered bound markers in the statement Parameters: ...
[ "def", "prepare_cql_query", "(", "self", ",", "query", ",", "compression", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_prepar...
Prepare a CQL (Cassandra Query Language) statement by compiling and returning - the type of CQL statement - an id token of the compiled CQL stored on the server side. - a count of the discovered bound markers in the statement Parameters: - query - compression
[ "Prepare", "a", "CQL", "(", "Cassandra", "Query", "Language", ")", "statement", "by", "compiling", "and", "returning", "-", "the", "type", "of", "CQL", "statement", "-", "an", "id", "token", "of", "the", "compiled", "CQL", "stored", "on", "the", "server", ...
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L1981-L1995
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.prepare_cql3_query
def prepare_cql3_query(self, query, compression): """ Parameters: - query - compression """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_prepare_cql3_query(query, compression) return d
python
def prepare_cql3_query(self, query, compression): """ Parameters: - query - compression """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_prepare_cql3_query(query, compression) return d
[ "def", "prepare_cql3_query", "(", "self", ",", "query", ",", "compression", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_prepa...
Parameters: - query - compression
[ "Parameters", ":", "-", "query", "-", "compression" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L2023-L2032
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.execute_prepared_cql_query
def execute_prepared_cql_query(self, itemId, values): """ Executes a prepared CQL (Cassandra Query Language) statement by passing an id token and a list of variables to bind and returns a CqlResult containing the results. Parameters: - itemId - values """ self._seqid += 1 d = sel...
python
def execute_prepared_cql_query(self, itemId, values): """ Executes a prepared CQL (Cassandra Query Language) statement by passing an id token and a list of variables to bind and returns a CqlResult containing the results. Parameters: - itemId - values """ self._seqid += 1 d = sel...
[ "def", "execute_prepared_cql_query", "(", "self", ",", "itemId", ",", "values", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_e...
Executes a prepared CQL (Cassandra Query Language) statement by passing an id token and a list of variables to bind and returns a CqlResult containing the results. Parameters: - itemId - values
[ "Executes", "a", "prepared", "CQL", "(", "Cassandra", "Query", "Language", ")", "statement", "by", "passing", "an", "id", "token", "and", "a", "list", "of", "variables", "to", "bind", "and", "returns", "a", "CqlResult", "containing", "the", "results", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L2060-L2072
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.execute_prepared_cql3_query
def execute_prepared_cql3_query(self, itemId, values, consistency): """ Parameters: - itemId - values - consistency """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_execute_prepared_cql3_query(itemId, values, consistency) return d
python
def execute_prepared_cql3_query(self, itemId, values, consistency): """ Parameters: - itemId - values - consistency """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_execute_prepared_cql3_query(itemId, values, consistency) return d
[ "def", "execute_prepared_cql3_query", "(", "self", ",", "itemId", ",", "values", ",", "consistency", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", ...
Parameters: - itemId - values - consistency
[ "Parameters", ":", "-", "itemId", "-", "values", "-", "consistency" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L2106-L2116
driftx/Telephus
telephus/cassandra/Cassandra.py
Client.set_cql_version
def set_cql_version(self, version): """ @deprecated This is now a no-op. Please use the CQL3 specific methods instead. Parameters: - version """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_set_cql_version(version) return d
python
def set_cql_version(self, version): """ @deprecated This is now a no-op. Please use the CQL3 specific methods instead. Parameters: - version """ self._seqid += 1 d = self._reqs[self._seqid] = defer.Deferred() self.send_set_cql_version(version) return d
[ "def", "set_cql_version", "(", "self", ",", "version", ")", ":", "self", ".", "_seqid", "+=", "1", "d", "=", "self", ".", "_reqs", "[", "self", ".", "_seqid", "]", "=", "defer", ".", "Deferred", "(", ")", "self", ".", "send_set_cql_version", "(", "ve...
@deprecated This is now a no-op. Please use the CQL3 specific methods instead. Parameters: - version
[ "@deprecated", "This", "is", "now", "a", "no", "-", "op", ".", "Please", "use", "the", "CQL3", "specific", "methods", "instead", "." ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/cassandra/Cassandra.py#L2151-L2161
ttinoco/OPTALG
optalg/lin_solver/__init__.py
new_linsolver
def new_linsolver(name,prop): """ Creates a linear solver. Parameters ---------- name : string prop : string Returns ------- solver : :class:`LinSolver <optalg.lin_solver.LinSolver>` """ if name == 'mumps': return LinSolverMUMPS(prop) elif name == 'supe...
python
def new_linsolver(name,prop): """ Creates a linear solver. Parameters ---------- name : string prop : string Returns ------- solver : :class:`LinSolver <optalg.lin_solver.LinSolver>` """ if name == 'mumps': return LinSolverMUMPS(prop) elif name == 'supe...
[ "def", "new_linsolver", "(", "name", ",", "prop", ")", ":", "if", "name", "==", "'mumps'", ":", "return", "LinSolverMUMPS", "(", "prop", ")", "elif", "name", "==", "'superlu'", ":", "return", "LinSolverSUPERLU", "(", "prop", ")", "elif", "name", "==", "'...
Creates a linear solver. Parameters ---------- name : string prop : string Returns ------- solver : :class:`LinSolver <optalg.lin_solver.LinSolver>`
[ "Creates", "a", "linear", "solver", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/__init__.py#L14-L40
ttinoco/OPTALG
optalg/opt_solver/problem.py
cast_problem
def cast_problem(problem): """ Casts problem object with known interface as OptProblem. Parameters ---------- problem : Object """ # Optproblem if isinstance(problem,OptProblem): return problem # Other else: # Type Base if (not hasattr(...
python
def cast_problem(problem): """ Casts problem object with known interface as OptProblem. Parameters ---------- problem : Object """ # Optproblem if isinstance(problem,OptProblem): return problem # Other else: # Type Base if (not hasattr(...
[ "def", "cast_problem", "(", "problem", ")", ":", "# Optproblem", "if", "isinstance", "(", "problem", ",", "OptProblem", ")", ":", "return", "problem", "# Other", "else", ":", "# Type Base", "if", "(", "not", "hasattr", "(", "problem", ",", "'G'", ")", "or"...
Casts problem object with known interface as OptProblem. Parameters ---------- problem : Object
[ "Casts", "problem", "object", "with", "known", "interface", "as", "OptProblem", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/opt_solver/problem.py#L185-L211
ttinoco/OPTALG
optalg/opt_solver/problem.py
create_problem_from_type_base
def create_problem_from_type_base(problem): """ Creates OptProblem from type-base problem. Parameters ---------- problem : Object """ p = OptProblem() # Init attributes p.phi = problem.phi p.gphi = problem.gphi p.Hphi = problem.Hphi p.A = problem.A p.b = problem....
python
def create_problem_from_type_base(problem): """ Creates OptProblem from type-base problem. Parameters ---------- problem : Object """ p = OptProblem() # Init attributes p.phi = problem.phi p.gphi = problem.gphi p.Hphi = problem.Hphi p.A = problem.A p.b = problem....
[ "def", "create_problem_from_type_base", "(", "problem", ")", ":", "p", "=", "OptProblem", "(", ")", "# Init attributes", "p", ".", "phi", "=", "problem", ".", "phi", "p", ".", "gphi", "=", "problem", ".", "gphi", "p", ".", "Hphi", "=", "problem", ".", ...
Creates OptProblem from type-base problem. Parameters ---------- problem : Object
[ "Creates", "OptProblem", "from", "type", "-", "base", "problem", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/opt_solver/problem.py#L213-L262
ttinoco/OPTALG
optalg/opt_solver/problem.py
create_problem_from_type_A
def create_problem_from_type_A(problem): """ Creates OptProblem from type-A problem. Parameters ---------- problem : Object """ p = OptProblem() nx = problem.get_num_primal_variables() nz = problem.G.shape[0] p.phi = problem.phi p.gphi = np.hstack((problem.gphi,np...
python
def create_problem_from_type_A(problem): """ Creates OptProblem from type-A problem. Parameters ---------- problem : Object """ p = OptProblem() nx = problem.get_num_primal_variables() nz = problem.G.shape[0] p.phi = problem.phi p.gphi = np.hstack((problem.gphi,np...
[ "def", "create_problem_from_type_A", "(", "problem", ")", ":", "p", "=", "OptProblem", "(", ")", "nx", "=", "problem", ".", "get_num_primal_variables", "(", ")", "nz", "=", "problem", ".", "G", ".", "shape", "[", "0", "]", "p", ".", "phi", "=", "proble...
Creates OptProblem from type-A problem. Parameters ---------- problem : Object
[ "Creates", "OptProblem", "from", "type", "-", "A", "problem", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/opt_solver/problem.py#L264-L327
ttinoco/OPTALG
optalg/opt_solver/problem.py
OptProblem.recover_dual_variables
def recover_dual_variables(self,lam,nu,mu,pi): """ Recovers dual variables for original problem. Parameters ---------- lam : ndarray nu : ndarray mu : ndarray pi : ndarray """ return lam,nu,mu,pi
python
def recover_dual_variables(self,lam,nu,mu,pi): """ Recovers dual variables for original problem. Parameters ---------- lam : ndarray nu : ndarray mu : ndarray pi : ndarray """ return lam,nu,mu,pi
[ "def", "recover_dual_variables", "(", "self", ",", "lam", ",", "nu", ",", "mu", ",", "pi", ")", ":", "return", "lam", ",", "nu", ",", "mu", ",", "pi" ]
Recovers dual variables for original problem. Parameters ---------- lam : ndarray nu : ndarray mu : ndarray pi : ndarray
[ "Recovers", "dual", "variables", "for", "original", "problem", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/opt_solver/problem.py#L89-L101
ttinoco/OPTALG
optalg/opt_solver/problem.py
OptProblem.get_num_primal_variables
def get_num_primal_variables(self): """ Gets number of primal variables. Returns ------- num : int """ if self.x is not None: return self.x.size if self.gphi is not None: return self.gphi.size if self.Hphi is not None: ...
python
def get_num_primal_variables(self): """ Gets number of primal variables. Returns ------- num : int """ if self.x is not None: return self.x.size if self.gphi is not None: return self.gphi.size if self.Hphi is not None: ...
[ "def", "get_num_primal_variables", "(", "self", ")", ":", "if", "self", ".", "x", "is", "not", "None", ":", "return", "self", ".", "x", ".", "size", "if", "self", ".", "gphi", "is", "not", "None", ":", "return", "self", ".", "gphi", ".", "size", "i...
Gets number of primal variables. Returns ------- num : int
[ "Gets", "number", "of", "primal", "variables", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/opt_solver/problem.py#L103-L126
ttinoco/OPTALG
optalg/opt_solver/opt_solver.py
OptSolver.get_dual_variables
def get_dual_variables(self): """ Gets dual variables. Returns ------- lam : vector nu : vector mu : vector pi : vector """ if self.problem: return self.problem.recover_dual_variables(self.lam*self.obj_sca, ...
python
def get_dual_variables(self): """ Gets dual variables. Returns ------- lam : vector nu : vector mu : vector pi : vector """ if self.problem: return self.problem.recover_dual_variables(self.lam*self.obj_sca, ...
[ "def", "get_dual_variables", "(", "self", ")", ":", "if", "self", ".", "problem", ":", "return", "self", ".", "problem", ".", "recover_dual_variables", "(", "self", ".", "lam", "*", "self", ".", "obj_sca", ",", "self", ".", "nu", "*", "self", ".", "obj...
Gets dual variables. Returns ------- lam : vector nu : vector mu : vector pi : vector
[ "Gets", "dual", "variables", ".", "Returns", "-------", "lam", ":", "vector", "nu", ":", "vector", "mu", ":", "vector", "pi", ":", "vector" ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/opt_solver/opt_solver.py#L124-L142
ttinoco/OPTALG
optalg/opt_solver/opt_solver.py
OptSolver.get_results
def get_results(self): """ Gets results. Returns ------- results : dictionary """ return {'status': self.status, 'error_msg': self.error_msg, 'k': self.k, 'x': self.x, 'lam': self.lam*self.obj_sca, ...
python
def get_results(self): """ Gets results. Returns ------- results : dictionary """ return {'status': self.status, 'error_msg': self.error_msg, 'k': self.k, 'x': self.x, 'lam': self.lam*self.obj_sca, ...
[ "def", "get_results", "(", "self", ")", ":", "return", "{", "'status'", ":", "self", ".", "status", ",", "'error_msg'", ":", "self", ".", "error_msg", ",", "'k'", ":", "self", ".", "k", ",", "'x'", ":", "self", ".", "x", ",", "'lam'", ":", "self", ...
Gets results. Returns ------- results : dictionary
[ "Gets", "results", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/opt_solver/opt_solver.py#L144-L160
ttinoco/OPTALG
optalg/opt_solver/opt_solver.py
OptSolver.line_search
def line_search(self,x,p,F,GradF,func,smax=np.inf,maxiter=40): """ Finds steplength along search direction p that satisfies the strong Wolfe conditions. Parameters ---------- x : current point (ndarray) p : search direction (ndarray) F : function...
python
def line_search(self,x,p,F,GradF,func,smax=np.inf,maxiter=40): """ Finds steplength along search direction p that satisfies the strong Wolfe conditions. Parameters ---------- x : current point (ndarray) p : search direction (ndarray) F : function...
[ "def", "line_search", "(", "self", ",", "x", ",", "p", ",", "F", ",", "GradF", ",", "func", ",", "smax", "=", "np", ".", "inf", ",", "maxiter", "=", "40", ")", ":", "# Parameters of line search", "c1", "=", "1e-4", "c2", "=", "5e-1", "# Initialize lo...
Finds steplength along search direction p that satisfies the strong Wolfe conditions. Parameters ---------- x : current point (ndarray) p : search direction (ndarray) F : function value at `x` (float) GradF : gradient of function at `x` (ndarray) ...
[ "Finds", "steplength", "along", "search", "direction", "p", "that", "satisfies", "the", "strong", "Wolfe", "conditions", ".", "Parameters", "----------", "x", ":", "current", "point", "(", "ndarray", ")", "p", ":", "search", "direction", "(", "ndarray", ")", ...
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/opt_solver/opt_solver.py#L173-L236
ttinoco/OPTALG
optalg/opt_solver/opt_solver.py
OptSolver.reset
def reset(self): """ Resets solver data. """ self.k = 0. self.x = np.zeros(0) self.lam = np.zeros(0) self.nu = np.zeros(0) self.mu = np.zeros(0) self.pi = np.zeros(0) self.status = self.STATUS_UNKNOWN self.error_msg = '' ...
python
def reset(self): """ Resets solver data. """ self.k = 0. self.x = np.zeros(0) self.lam = np.zeros(0) self.nu = np.zeros(0) self.mu = np.zeros(0) self.pi = np.zeros(0) self.status = self.STATUS_UNKNOWN self.error_msg = '' ...
[ "def", "reset", "(", "self", ")", ":", "self", ".", "k", "=", "0.", "self", ".", "x", "=", "np", ".", "zeros", "(", "0", ")", "self", ".", "lam", "=", "np", ".", "zeros", "(", "0", ")", "self", ".", "nu", "=", "np", ".", "zeros", "(", "0"...
Resets solver data.
[ "Resets", "solver", "data", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/opt_solver/opt_solver.py#L238-L251
ttinoco/OPTALG
optalg/opt_solver/opt_solver.py
OptSolver.set_parameters
def set_parameters(self,parameters): """ Sets solver parameters. Parameters ---------- parameters : dict """ for key,value in list(parameters.items()): if key in self.parameters: self.parameters[key] = value
python
def set_parameters(self,parameters): """ Sets solver parameters. Parameters ---------- parameters : dict """ for key,value in list(parameters.items()): if key in self.parameters: self.parameters[key] = value
[ "def", "set_parameters", "(", "self", ",", "parameters", ")", ":", "for", "key", ",", "value", "in", "list", "(", "parameters", ".", "items", "(", ")", ")", ":", "if", "key", "in", "self", ".", "parameters", ":", "self", ".", "parameters", "[", "key"...
Sets solver parameters. Parameters ---------- parameters : dict
[ "Sets", "solver", "parameters", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/opt_solver/opt_solver.py#L275-L286
ttinoco/OPTALG
optalg/lin_solver/lin_solver.py
LinSolver.factorize_and_solve
def factorize_and_solve(self, A, b): """ Factorizes A and solves Ax=b. Returns ------- x : vector """ self.factorize(A) return self.solve(b)
python
def factorize_and_solve(self, A, b): """ Factorizes A and solves Ax=b. Returns ------- x : vector """ self.factorize(A) return self.solve(b)
[ "def", "factorize_and_solve", "(", "self", ",", "A", ",", "b", ")", ":", "self", ".", "factorize", "(", "A", ")", "return", "self", ".", "solve", "(", "b", ")" ]
Factorizes A and solves Ax=b. Returns ------- x : vector
[ "Factorizes", "A", "and", "solves", "Ax", "=", "b", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/lin_solver.py#L85-L96
ttinoco/OPTALG
optalg/opt_solver/inlp.py
OptSolverINLP.solve
def solve(self,problem): """ Solves optimization problem. Parameters ---------- problem : Object """ # Local vars norm2 = self.norm2 norminf = self.norminf parameters = self.parameters # Parameters fea...
python
def solve(self,problem): """ Solves optimization problem. Parameters ---------- problem : Object """ # Local vars norm2 = self.norm2 norminf = self.norminf parameters = self.parameters # Parameters fea...
[ "def", "solve", "(", "self", ",", "problem", ")", ":", "# Local vars", "norm2", "=", "self", ".", "norm2", "norminf", "=", "self", ".", "norminf", "parameters", "=", "self", ".", "parameters", "# Parameters", "feastol", "=", "parameters", "[", "'feastol'", ...
Solves optimization problem. Parameters ---------- problem : Object
[ "Solves", "optimization", "problem", ".", "Parameters", "----------", "problem", ":", "Object" ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/opt_solver/inlp.py#L42-L277
pre-commit/pre-commit-mirror-maker
pre_commit_mirror_maker/make_repo.py
format_files
def format_files(src: str, dest: str, **fmt_vars: str) -> None: """Copies all files inside src into dest while formatting the contents of the files into the output. For example, a file with the following contents: {foo} bar {baz} and the vars {'foo': 'herp', 'baz': 'derp'} will end up in the...
python
def format_files(src: str, dest: str, **fmt_vars: str) -> None: """Copies all files inside src into dest while formatting the contents of the files into the output. For example, a file with the following contents: {foo} bar {baz} and the vars {'foo': 'herp', 'baz': 'derp'} will end up in the...
[ "def", "format_files", "(", "src", ":", "str", ",", "dest", ":", "str", ",", "*", "*", "fmt_vars", ":", "str", ")", "->", "None", ":", "assert", "os", ".", "path", ".", "exists", "(", "src", ")", "assert", "os", ".", "path", ".", "exists", "(", ...
Copies all files inside src into dest while formatting the contents of the files into the output. For example, a file with the following contents: {foo} bar {baz} and the vars {'foo': 'herp', 'baz': 'derp'} will end up in the output as herp bar derp :param text src: Source directory. ...
[ "Copies", "all", "files", "inside", "src", "into", "dest", "while", "formatting", "the", "contents", "of", "the", "files", "into", "the", "output", "." ]
train
https://github.com/pre-commit/pre-commit-mirror-maker/blob/8bafa3b87e67d291d5a747f0137b921a170a1723/pre_commit_mirror_maker/make_repo.py#L14-L43
ttinoco/OPTALG
optalg/lin_solver/mumps.py
LinSolverMUMPS.analyze
def analyze(self,A): """ Analyzes structure of A. Parameters ---------- A : matrix For symmetric systems, should contain only lower diagonal part. """ A = coo_matrix(A) self.mumps.set_shape(A.shape[0]) self.mumps.set...
python
def analyze(self,A): """ Analyzes structure of A. Parameters ---------- A : matrix For symmetric systems, should contain only lower diagonal part. """ A = coo_matrix(A) self.mumps.set_shape(A.shape[0]) self.mumps.set...
[ "def", "analyze", "(", "self", ",", "A", ")", ":", "A", "=", "coo_matrix", "(", "A", ")", "self", ".", "mumps", ".", "set_shape", "(", "A", ".", "shape", "[", "0", "]", ")", "self", ".", "mumps", ".", "set_centralized_assembled_rows_cols", "(", "A", ...
Analyzes structure of A. Parameters ---------- A : matrix For symmetric systems, should contain only lower diagonal part.
[ "Analyzes", "structure", "of", "A", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/mumps.py#L43-L60
ttinoco/OPTALG
optalg/lin_solver/mumps.py
LinSolverMUMPS.factorize
def factorize(self,A): """ Factorizes A. Parameters ---------- A : matrix For symmetric systems, should contain only lower diagonal part. """ A = coo_matrix(A) self.mumps.set_centralized_assembled_values(A.data) self.mumps.run(job=2)
python
def factorize(self,A): """ Factorizes A. Parameters ---------- A : matrix For symmetric systems, should contain only lower diagonal part. """ A = coo_matrix(A) self.mumps.set_centralized_assembled_values(A.data) self.mumps.run(job=2)
[ "def", "factorize", "(", "self", ",", "A", ")", ":", "A", "=", "coo_matrix", "(", "A", ")", "self", ".", "mumps", ".", "set_centralized_assembled_values", "(", "A", ".", "data", ")", "self", ".", "mumps", ".", "run", "(", "job", "=", "2", ")" ]
Factorizes A. Parameters ---------- A : matrix For symmetric systems, should contain only lower diagonal part.
[ "Factorizes", "A", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/mumps.py#L62-L75
ttinoco/OPTALG
optalg/lin_solver/mumps.py
LinSolverMUMPS.solve
def solve(self,b): """ Solves system Ax=b. Parameters ---------- b : ndarray Returns ------- x : ndarray """ x = b.copy() self.mumps.set_rhs(x) self.mumps.run(job=3) return x
python
def solve(self,b): """ Solves system Ax=b. Parameters ---------- b : ndarray Returns ------- x : ndarray """ x = b.copy() self.mumps.set_rhs(x) self.mumps.run(job=3) return x
[ "def", "solve", "(", "self", ",", "b", ")", ":", "x", "=", "b", ".", "copy", "(", ")", "self", ".", "mumps", ".", "set_rhs", "(", "x", ")", "self", ".", "mumps", ".", "run", "(", "job", "=", "3", ")", "return", "x" ]
Solves system Ax=b. Parameters ---------- b : ndarray Returns ------- x : ndarray
[ "Solves", "system", "Ax", "=", "b", ".", "Parameters", "----------", "b", ":", "ndarray", "Returns", "-------", "x", ":", "ndarray" ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/mumps.py#L77-L94
ttinoco/OPTALG
optalg/lin_solver/mumps.py
LinSolverMUMPS.factorize_and_solve
def factorize_and_solve(self,A,b): """ Factorizes A and sovles Ax=b. Parameters ---------- A : matrix b : ndarray Returns ------- x : ndarray """ A = coo_matrix(A) x = b.copy() self.mumps.set_centralized_assemble...
python
def factorize_and_solve(self,A,b): """ Factorizes A and sovles Ax=b. Parameters ---------- A : matrix b : ndarray Returns ------- x : ndarray """ A = coo_matrix(A) x = b.copy() self.mumps.set_centralized_assemble...
[ "def", "factorize_and_solve", "(", "self", ",", "A", ",", "b", ")", ":", "A", "=", "coo_matrix", "(", "A", ")", "x", "=", "b", ".", "copy", "(", ")", "self", ".", "mumps", ".", "set_centralized_assembled_values", "(", "A", ".", "data", ")", "self", ...
Factorizes A and sovles Ax=b. Parameters ---------- A : matrix b : ndarray Returns ------- x : ndarray
[ "Factorizes", "A", "and", "sovles", "Ax", "=", "b", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/mumps.py#L96-L117
ttinoco/OPTALG
optalg/lin_solver/_mumps/__init__.py
spsolve
def spsolve(A, b, comm=None): """Sparse solve A\b.""" assert A.dtype == 'd' and b.dtype == 'd', "Only double precision supported." with DMumpsContext(par=1, sym=0, comm=comm) as ctx: if ctx.myid == 0: # Set the sparse matrix -- only necessary on ctx.set_centralized_sparse(A....
python
def spsolve(A, b, comm=None): """Sparse solve A\b.""" assert A.dtype == 'd' and b.dtype == 'd', "Only double precision supported." with DMumpsContext(par=1, sym=0, comm=comm) as ctx: if ctx.myid == 0: # Set the sparse matrix -- only necessary on ctx.set_centralized_sparse(A....
[ "def", "spsolve", "(", "A", ",", "b", ",", "comm", "=", "None", ")", ":", "assert", "A", ".", "dtype", "==", "'d'", "and", "b", ".", "dtype", "==", "'d'", ",", "\"Only double precision supported.\"", "with", "DMumpsContext", "(", "par", "=", "1", ",", ...
Sparse solve A\b.
[ "Sparse", "solve", "A", "\\", "b", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/_mumps/__init__.py#L250-L268
ttinoco/OPTALG
optalg/lin_solver/_mumps/__init__.py
_MumpsBaseContext.set_centralized_sparse
def set_centralized_sparse(self, A): """Set assembled matrix on processor 0. Parameters ---------- A : `scipy.sparse.coo_matrix` Sparse matrices of other formats will be converted to COOrdinate form. """ if self.myid != 0: return ...
python
def set_centralized_sparse(self, A): """Set assembled matrix on processor 0. Parameters ---------- A : `scipy.sparse.coo_matrix` Sparse matrices of other formats will be converted to COOrdinate form. """ if self.myid != 0: return ...
[ "def", "set_centralized_sparse", "(", "self", ",", "A", ")", ":", "if", "self", ".", "myid", "!=", "0", ":", "return", "A", "=", "A", ".", "tocoo", "(", ")", "n", "=", "A", ".", "shape", "[", "0", "]", "assert", "A", ".", "shape", "==", "(", ...
Set assembled matrix on processor 0. Parameters ---------- A : `scipy.sparse.coo_matrix` Sparse matrices of other formats will be converted to COOrdinate form.
[ "Set", "assembled", "matrix", "on", "processor", "0", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/_mumps/__init__.py#L79-L95
ttinoco/OPTALG
optalg/lin_solver/_mumps/__init__.py
_MumpsBaseContext.set_centralized_assembled
def set_centralized_assembled(self, irn, jcn, a): """Set assembled matrix on processor 0. The row and column indices (irn & jcn) should be one based. """ self.set_centralized_assembled_rows_cols(irn, jcn) self.set_centralized_assembled_values(a)
python
def set_centralized_assembled(self, irn, jcn, a): """Set assembled matrix on processor 0. The row and column indices (irn & jcn) should be one based. """ self.set_centralized_assembled_rows_cols(irn, jcn) self.set_centralized_assembled_values(a)
[ "def", "set_centralized_assembled", "(", "self", ",", "irn", ",", "jcn", ",", "a", ")", ":", "self", ".", "set_centralized_assembled_rows_cols", "(", "irn", ",", "jcn", ")", "self", ".", "set_centralized_assembled_values", "(", "a", ")" ]
Set assembled matrix on processor 0. The row and column indices (irn & jcn) should be one based.
[ "Set", "assembled", "matrix", "on", "processor", "0", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/_mumps/__init__.py#L102-L108
ttinoco/OPTALG
optalg/lin_solver/_mumps/__init__.py
_MumpsBaseContext.set_centralized_assembled_rows_cols
def set_centralized_assembled_rows_cols(self, irn, jcn): """Set assembled matrix indices on processor 0. The row and column indices (irn & jcn) should be one based. """ if self.myid != 0: return assert irn.size == jcn.size self._refs.update(irn=irn, jcn=jcn) ...
python
def set_centralized_assembled_rows_cols(self, irn, jcn): """Set assembled matrix indices on processor 0. The row and column indices (irn & jcn) should be one based. """ if self.myid != 0: return assert irn.size == jcn.size self._refs.update(irn=irn, jcn=jcn) ...
[ "def", "set_centralized_assembled_rows_cols", "(", "self", ",", "irn", ",", "jcn", ")", ":", "if", "self", ".", "myid", "!=", "0", ":", "return", "assert", "irn", ".", "size", "==", "jcn", ".", "size", "self", ".", "_refs", ".", "update", "(", "irn", ...
Set assembled matrix indices on processor 0. The row and column indices (irn & jcn) should be one based.
[ "Set", "assembled", "matrix", "indices", "on", "processor", "0", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/_mumps/__init__.py#L110-L121
ttinoco/OPTALG
optalg/lin_solver/_mumps/__init__.py
_MumpsBaseContext.set_centralized_assembled_values
def set_centralized_assembled_values(self, a): """Set assembled matrix values on processor 0.""" if self.myid != 0: return assert a.size == self.id.nz self._refs.update(a=a) self.id.a = self.cast_array(a)
python
def set_centralized_assembled_values(self, a): """Set assembled matrix values on processor 0.""" if self.myid != 0: return assert a.size == self.id.nz self._refs.update(a=a) self.id.a = self.cast_array(a)
[ "def", "set_centralized_assembled_values", "(", "self", ",", "a", ")", ":", "if", "self", ".", "myid", "!=", "0", ":", "return", "assert", "a", ".", "size", "==", "self", ".", "id", ".", "nz", "self", ".", "_refs", ".", "update", "(", "a", "=", "a"...
Set assembled matrix values on processor 0.
[ "Set", "assembled", "matrix", "values", "on", "processor", "0", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/_mumps/__init__.py#L123-L129
ttinoco/OPTALG
optalg/lin_solver/_mumps/__init__.py
_MumpsBaseContext.set_distributed_assembled
def set_distributed_assembled(self, irn_loc, jcn_loc, a_loc): """Set the distributed assembled matrix. Distributed assembled matrices require setting icntl(18) != 0. """ self.set_distributed_assembled_rows_cols(irn_loc, jcn_loc) self.set_distributed_assembled_values(a_loc)
python
def set_distributed_assembled(self, irn_loc, jcn_loc, a_loc): """Set the distributed assembled matrix. Distributed assembled matrices require setting icntl(18) != 0. """ self.set_distributed_assembled_rows_cols(irn_loc, jcn_loc) self.set_distributed_assembled_values(a_loc)
[ "def", "set_distributed_assembled", "(", "self", ",", "irn_loc", ",", "jcn_loc", ",", "a_loc", ")", ":", "self", ".", "set_distributed_assembled_rows_cols", "(", "irn_loc", ",", "jcn_loc", ")", "self", ".", "set_distributed_assembled_values", "(", "a_loc", ")" ]
Set the distributed assembled matrix. Distributed assembled matrices require setting icntl(18) != 0.
[ "Set", "the", "distributed", "assembled", "matrix", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/_mumps/__init__.py#L136-L142
ttinoco/OPTALG
optalg/lin_solver/_mumps/__init__.py
_MumpsBaseContext.set_distributed_assembled_rows_cols
def set_distributed_assembled_rows_cols(self, irn_loc, jcn_loc): """Set the distributed assembled matrix row & column numbers. Distributed assembled matrices require setting icntl(18) != 0. """ assert irn_loc.size == jcn_loc.size self._refs.update(irn_loc=irn_loc, jcn_loc=jcn_l...
python
def set_distributed_assembled_rows_cols(self, irn_loc, jcn_loc): """Set the distributed assembled matrix row & column numbers. Distributed assembled matrices require setting icntl(18) != 0. """ assert irn_loc.size == jcn_loc.size self._refs.update(irn_loc=irn_loc, jcn_loc=jcn_l...
[ "def", "set_distributed_assembled_rows_cols", "(", "self", ",", "irn_loc", ",", "jcn_loc", ")", ":", "assert", "irn_loc", ".", "size", "==", "jcn_loc", ".", "size", "self", ".", "_refs", ".", "update", "(", "irn_loc", "=", "irn_loc", ",", "jcn_loc", "=", "...
Set the distributed assembled matrix row & column numbers. Distributed assembled matrices require setting icntl(18) != 0.
[ "Set", "the", "distributed", "assembled", "matrix", "row", "&", "column", "numbers", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/_mumps/__init__.py#L144-L154
ttinoco/OPTALG
optalg/lin_solver/_mumps/__init__.py
_MumpsBaseContext.set_distributed_assembled_values
def set_distributed_assembled_values(self, a_loc): """Set the distributed assembled matrix values. Distributed assembled matrices require setting icntl(18) != 0. """ assert a_loc.size == self._refs['irn_loc'].size self._refs.update(a_loc=a_loc) self.id.a_loc = self.cast_...
python
def set_distributed_assembled_values(self, a_loc): """Set the distributed assembled matrix values. Distributed assembled matrices require setting icntl(18) != 0. """ assert a_loc.size == self._refs['irn_loc'].size self._refs.update(a_loc=a_loc) self.id.a_loc = self.cast_...
[ "def", "set_distributed_assembled_values", "(", "self", ",", "a_loc", ")", ":", "assert", "a_loc", ".", "size", "==", "self", ".", "_refs", "[", "'irn_loc'", "]", ".", "size", "self", ".", "_refs", ".", "update", "(", "a_loc", "=", "a_loc", ")", "self", ...
Set the distributed assembled matrix values. Distributed assembled matrices require setting icntl(18) != 0.
[ "Set", "the", "distributed", "assembled", "matrix", "values", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/_mumps/__init__.py#L156-L163
ttinoco/OPTALG
optalg/lin_solver/_mumps/__init__.py
_MumpsBaseContext.set_rhs
def set_rhs(self, rhs): """Set the right hand side. This matrix will be modified in place.""" assert rhs.size == self.id.n self._refs.update(rhs=rhs) self.id.rhs = self.cast_array(rhs)
python
def set_rhs(self, rhs): """Set the right hand side. This matrix will be modified in place.""" assert rhs.size == self.id.n self._refs.update(rhs=rhs) self.id.rhs = self.cast_array(rhs)
[ "def", "set_rhs", "(", "self", ",", "rhs", ")", ":", "assert", "rhs", ".", "size", "==", "self", ".", "id", ".", "n", "self", ".", "_refs", ".", "update", "(", "rhs", "=", "rhs", ")", "self", ".", "id", ".", "rhs", "=", "self", ".", "cast_array...
Set the right hand side. This matrix will be modified in place.
[ "Set", "the", "right", "hand", "side", ".", "This", "matrix", "will", "be", "modified", "in", "place", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/_mumps/__init__.py#L170-L174
ttinoco/OPTALG
optalg/lin_solver/_mumps/__init__.py
_MumpsBaseContext.set_silent
def set_silent(self): """Silence most messages.""" self.set_icntl(1, -1) # output stream for error msgs self.set_icntl(2, -1) # otuput stream for diagnostic msgs self.set_icntl(3, -1) # output stream for global info self.set_icntl(4, 0)
python
def set_silent(self): """Silence most messages.""" self.set_icntl(1, -1) # output stream for error msgs self.set_icntl(2, -1) # otuput stream for diagnostic msgs self.set_icntl(3, -1) # output stream for global info self.set_icntl(4, 0)
[ "def", "set_silent", "(", "self", ")", ":", "self", ".", "set_icntl", "(", "1", ",", "-", "1", ")", "# output stream for error msgs", "self", ".", "set_icntl", "(", "2", ",", "-", "1", ")", "# otuput stream for diagnostic msgs", "self", ".", "set_icntl", "("...
Silence most messages.
[ "Silence", "most", "messages", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/_mumps/__init__.py#L187-L192
ttinoco/OPTALG
optalg/lin_solver/_mumps/__init__.py
_MumpsBaseContext.destroy
def destroy(self): """Delete the MUMPS context and release all array references.""" if self.id is not None and self._mumps_c is not None: self.id.job = -2 # JOB_END self._mumps_c(self.id) self.id = None self._refs = None
python
def destroy(self): """Delete the MUMPS context and release all array references.""" if self.id is not None and self._mumps_c is not None: self.id.job = -2 # JOB_END self._mumps_c(self.id) self.id = None self._refs = None
[ "def", "destroy", "(", "self", ")", ":", "if", "self", ".", "id", "is", "not", "None", "and", "self", ".", "_mumps_c", "is", "not", "None", ":", "self", ".", "id", ".", "job", "=", "-", "2", "# JOB_END", "self", ".", "_mumps_c", "(", "self", ".",...
Delete the MUMPS context and release all array references.
[ "Delete", "the", "MUMPS", "context", "and", "release", "all", "array", "references", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/_mumps/__init__.py#L198-L204
ttinoco/OPTALG
optalg/lin_solver/_mumps/__init__.py
_MumpsBaseContext.mumps
def mumps(self): """Call MUMPS, checking for errors in the return code. The desired job should have already been set using `ctx.set_job(...)`. As a convenience, you may wish to call `ctx.run(job=...)` which sets the job and calls MUMPS. """ self._mumps_c(self.id) ...
python
def mumps(self): """Call MUMPS, checking for errors in the return code. The desired job should have already been set using `ctx.set_job(...)`. As a convenience, you may wish to call `ctx.run(job=...)` which sets the job and calls MUMPS. """ self._mumps_c(self.id) ...
[ "def", "mumps", "(", "self", ")", ":", "self", ".", "_mumps_c", "(", "self", ".", "id", ")", "if", "self", ".", "id", ".", "infog", "[", "0", "]", "<", "0", ":", "raise", "RuntimeError", "(", "\"MUMPS error: %d\"", "%", "self", ".", "id", ".", "i...
Call MUMPS, checking for errors in the return code. The desired job should have already been set using `ctx.set_job(...)`. As a convenience, you may wish to call `ctx.run(job=...)` which sets the job and calls MUMPS.
[ "Call", "MUMPS", "checking", "for", "errors", "in", "the", "return", "code", "." ]
train
https://github.com/ttinoco/OPTALG/blob/d4f141292f281eea4faa71473258139e7f433001/optalg/lin_solver/_mumps/__init__.py#L213-L222
DLR-RM/RAFCON
source/rafcon/core/state_elements/data_flow.py
DataFlow.modify_origin
def modify_origin(self, from_state, from_key): """Set both from_state and from_key at the same time to modify data flow origin :param str from_state: State id of the origin state :param int from_key: Data port id of the origin port :raises exceptions.ValueError: If parameters have wrong...
python
def modify_origin(self, from_state, from_key): """Set both from_state and from_key at the same time to modify data flow origin :param str from_state: State id of the origin state :param int from_key: Data port id of the origin port :raises exceptions.ValueError: If parameters have wrong...
[ "def", "modify_origin", "(", "self", ",", "from_state", ",", "from_key", ")", ":", "if", "not", "isinstance", "(", "from_state", ",", "string_types", ")", ":", "raise", "ValueError", "(", "\"Invalid data flow origin port: from_state must be a string\"", ")", "if", "...
Set both from_state and from_key at the same time to modify data flow origin :param str from_state: State id of the origin state :param int from_key: Data port id of the origin port :raises exceptions.ValueError: If parameters have wrong types or the new data flow is not valid
[ "Set", "both", "from_state", "and", "from_key", "at", "the", "same", "time", "to", "modify", "data", "flow", "origin" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_elements/data_flow.py#L128-L149
DLR-RM/RAFCON
source/rafcon/core/state_elements/data_flow.py
DataFlow.modify_target
def modify_target(self, to_state, to_key): """Set both to_state and to_key at the same time to modify data flow target :param str to_state: State id of the target state :param int to_key: Data port id of the target port :raises exceptions.ValueError: If parameters have wrong types or th...
python
def modify_target(self, to_state, to_key): """Set both to_state and to_key at the same time to modify data flow target :param str to_state: State id of the target state :param int to_key: Data port id of the target port :raises exceptions.ValueError: If parameters have wrong types or th...
[ "def", "modify_target", "(", "self", ",", "to_state", ",", "to_key", ")", ":", "if", "not", "isinstance", "(", "to_state", ",", "string_types", ")", ":", "raise", "ValueError", "(", "\"Invalid data flow target port: from_state must be a string\"", ")", "if", "not", ...
Set both to_state and to_key at the same time to modify data flow target :param str to_state: State id of the target state :param int to_key: Data port id of the target port :raises exceptions.ValueError: If parameters have wrong types or the new data flow is not valid
[ "Set", "both", "to_state", "and", "to_key", "at", "the", "same", "time", "to", "modify", "data", "flow", "target" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/state_elements/data_flow.py#L183-L204
DLR-RM/RAFCON
source/rafcon/gui/controllers/utils/editor.py
EditorController.register_actions
def register_actions(self, shortcut_manager): """Register callback methods for triggered actions :param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager: Shortcut Manager Object holding mappings between shortcuts and actions. """ shortcut_manager.add_callback_for...
python
def register_actions(self, shortcut_manager): """Register callback methods for triggered actions :param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager: Shortcut Manager Object holding mappings between shortcuts and actions. """ shortcut_manager.add_callback_for...
[ "def", "register_actions", "(", "self", ",", "shortcut_manager", ")", ":", "shortcut_manager", ".", "add_callback_for_action", "(", "\"copy\"", ",", "self", ".", "_copy", ")", "shortcut_manager", ".", "add_callback_for_action", "(", "\"paste\"", ",", "self", ".", ...
Register callback methods for triggered actions :param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager: Shortcut Manager Object holding mappings between shortcuts and actions.
[ "Register", "callback", "methods", "for", "triggered", "actions" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/utils/editor.py#L52-L64
DLR-RM/RAFCON
source/rafcon/gui/controllers/utils/editor.py
EditorController.code_changed
def code_changed(self, source): """ Apply checks and adjustments of the TextBuffer and TextView after every change in buffer. The method re-apply the tag (style) for the buffer. It avoids changes while editable-property set to False which are caused by a bug in the GtkSourceView2. GtkSourceVi...
python
def code_changed(self, source): """ Apply checks and adjustments of the TextBuffer and TextView after every change in buffer. The method re-apply the tag (style) for the buffer. It avoids changes while editable-property set to False which are caused by a bug in the GtkSourceView2. GtkSourceVi...
[ "def", "code_changed", "(", "self", ",", "source", ")", ":", "# work around to avoid changes at all (e.g. by enter-key) if text view property editable is False", "# TODO if SourceView3 is used in future check if this can be skipped", "if", "not", "self", ".", "view", ".", "textview",...
Apply checks and adjustments of the TextBuffer and TextView after every change in buffer. The method re-apply the tag (style) for the buffer. It avoids changes while editable-property set to False which are caused by a bug in the GtkSourceView2. GtkSourceView2 is the default used TextView widget here...
[ "Apply", "checks", "and", "adjustments", "of", "the", "TextBuffer", "and", "TextView", "after", "every", "change", "in", "buffer", "." ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/utils/editor.py#L119-L142
DLR-RM/RAFCON
source/rafcon/gui/controllers/utils/editor.py
EditorController.apply_clicked
def apply_clicked(self, button): """Triggered when the Apply-Shortcut in the editor is triggered. """ if isinstance(self.model.state, LibraryState): return self.set_script_text(self.view.get_text())
python
def apply_clicked(self, button): """Triggered when the Apply-Shortcut in the editor is triggered. """ if isinstance(self.model.state, LibraryState): return self.set_script_text(self.view.get_text())
[ "def", "apply_clicked", "(", "self", ",", "button", ")", ":", "if", "isinstance", "(", "self", ".", "model", ".", "state", ",", "LibraryState", ")", ":", "return", "self", ".", "set_script_text", "(", "self", ".", "view", ".", "get_text", "(", ")", ")"...
Triggered when the Apply-Shortcut in the editor is triggered.
[ "Triggered", "when", "the", "Apply", "-", "Shortcut", "in", "the", "editor", "is", "triggered", "." ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/utils/editor.py#L144-L151
DLR-RM/RAFCON
source/rafcon/gui/views/utils/editor.py
EditorView.set_text
def set_text(self, text): """ The method insert text into the text buffer of the text view and preserves the cursor location. :param str text: which is insert into the text buffer. :return: """ line_number, line_offset = self.get_cursor_position() self.get_buffer().set_t...
python
def set_text(self, text): """ The method insert text into the text buffer of the text view and preserves the cursor location. :param str text: which is insert into the text buffer. :return: """ line_number, line_offset = self.get_cursor_position() self.get_buffer().set_t...
[ "def", "set_text", "(", "self", ",", "text", ")", ":", "line_number", ",", "line_offset", "=", "self", ".", "get_cursor_position", "(", ")", "self", ".", "get_buffer", "(", ")", ".", "set_text", "(", "text", ")", "self", ".", "set_cursor_position", "(", ...
The method insert text into the text buffer of the text view and preserves the cursor location. :param str text: which is insert into the text buffer. :return:
[ "The", "method", "insert", "text", "into", "the", "text", "buffer", "of", "the", "text", "view", "and", "preserves", "the", "cursor", "location", "." ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/utils/editor.py#L144-L152
DLR-RM/RAFCON
source/rafcon/gui/views/utils/editor.py
EditorView.set_enabled
def set_enabled(self, on, text=None): """ Set the default input or deactivated (disabled) style scheme The method triggers the signal 'changed' by using set_text. Therefore, the method use the while_in_set_enabled flag to make activities of the method observable. If a method trigger this method...
python
def set_enabled(self, on, text=None): """ Set the default input or deactivated (disabled) style scheme The method triggers the signal 'changed' by using set_text. Therefore, the method use the while_in_set_enabled flag to make activities of the method observable. If a method trigger this method...
[ "def", "set_enabled", "(", "self", ",", "on", ",", "text", "=", "None", ")", ":", "self", ".", "while_in_set_enabled", "=", "True", "# Apply color scheme by set text 'workaround' (with current buffer source)", "self", ".", "set_text", "(", "self", ".", "get_text", "...
Set the default input or deactivated (disabled) style scheme The method triggers the signal 'changed' by using set_text. Therefore, the method use the while_in_set_enabled flag to make activities of the method observable. If a method trigger this method and was triggered by a changed-signal thi...
[ "Set", "the", "default", "input", "or", "deactivated", "(", "disabled", ")", "style", "scheme" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/utils/editor.py#L154-L176
DLR-RM/RAFCON
share/examples/plugins/templates/hooks.py
pre_init
def pre_init(): """ The pre_init function of the plugin. Here rafcon-classes can be extended/monkey-patched or completely substituted. A example is given with the rafcon_execution_hooks_plugin. :return: """ logger.info("Run pre-initiation hook of {} plugin.".format(__file__.split(os.path.sep)[-...
python
def pre_init(): """ The pre_init function of the plugin. Here rafcon-classes can be extended/monkey-patched or completely substituted. A example is given with the rafcon_execution_hooks_plugin. :return: """ logger.info("Run pre-initiation hook of {} plugin.".format(__file__.split(os.path.sep)[-...
[ "def", "pre_init", "(", ")", ":", "logger", ".", "info", "(", "\"Run pre-initiation hook of {} plugin.\"", ".", "format", "(", "__file__", ".", "split", "(", "os", ".", "path", ".", "sep", ")", "[", "-", "2", "]", ")", ")", "# Example: Monkey-Path rafcon.cor...
The pre_init function of the plugin. Here rafcon-classes can be extended/monkey-patched or completely substituted. A example is given with the rafcon_execution_hooks_plugin. :return:
[ "The", "pre_init", "function", "of", "the", "plugin", ".", "Here", "rafcon", "-", "classes", "can", "be", "extended", "/", "monkey", "-", "patched", "or", "completely", "substituted", ".", "A", "example", "is", "given", "with", "the", "rafcon_execution_hooks_p...
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/share/examples/plugins/templates/hooks.py#L8-L27
DLR-RM/RAFCON
share/examples/plugins/templates/hooks.py
post_init
def post_init(setup_config): """ The post_init function of the plugin. Here observer can be registered to the observables and other pre-init functionality of the plugin should be triggered. A simple example is given with the rafcon_execution_hooks_plugin. A complex example is given with the rafcon_monit...
python
def post_init(setup_config): """ The post_init function of the plugin. Here observer can be registered to the observables and other pre-init functionality of the plugin should be triggered. A simple example is given with the rafcon_execution_hooks_plugin. A complex example is given with the rafcon_monit...
[ "def", "post_init", "(", "setup_config", ")", ":", "logger", ".", "info", "(", "\"Run post-initiation hook of {} plugin.\"", ".", "format", "(", "__file__", ".", "split", "(", "os", ".", "path", ".", "sep", ")", "[", "-", "2", "]", ")", ")", "from", ".",...
The post_init function of the plugin. Here observer can be registered to the observables and other pre-init functionality of the plugin should be triggered. A simple example is given with the rafcon_execution_hooks_plugin. A complex example is given with the rafcon_monitoring_plugin. :param setup_config: ...
[ "The", "post_init", "function", "of", "the", "plugin", ".", "Here", "observer", "can", "be", "registered", "to", "the", "observables", "and", "other", "pre", "-", "init", "functionality", "of", "the", "plugin", "should", "be", "triggered", ".", "A", "simple"...
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/share/examples/plugins/templates/hooks.py#L30-L53
DLR-RM/RAFCON
source/rafcon/gui/models/selection.py
reduce_to_parent_states
def reduce_to_parent_states(models): """Remove all models of states that have a state model with parent relation in the list The function filters the list of models, so that for no model in the list, one of it (grand-)parents is also in the list. E.g. if the input models consists of a hierarchy state with ...
python
def reduce_to_parent_states(models): """Remove all models of states that have a state model with parent relation in the list The function filters the list of models, so that for no model in the list, one of it (grand-)parents is also in the list. E.g. if the input models consists of a hierarchy state with ...
[ "def", "reduce_to_parent_states", "(", "models", ")", ":", "models", "=", "set", "(", "models", ")", "# Ensure that models is a set and that we do not operate on the parameter itself", "models_to_remove", "=", "set", "(", ")", "# check all models", "for", "model", "in", "...
Remove all models of states that have a state model with parent relation in the list The function filters the list of models, so that for no model in the list, one of it (grand-)parents is also in the list. E.g. if the input models consists of a hierarchy state with two of its child states, the resulting list ...
[ "Remove", "all", "models", "of", "states", "that", "have", "a", "state", "model", "with", "parent", "relation", "in", "the", "list" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/selection.py#L37-L63
DLR-RM/RAFCON
source/rafcon/gui/models/selection.py
updates_selection
def updates_selection(update_selection): """ Decorator indicating that the decorated method could change the selection""" def handle_update(selection, *args, **kwargs): """Check for changes in the selection If the selection is changed by the decorated method, the internal core element lists are...
python
def updates_selection(update_selection): """ Decorator indicating that the decorated method could change the selection""" def handle_update(selection, *args, **kwargs): """Check for changes in the selection If the selection is changed by the decorated method, the internal core element lists are...
[ "def", "updates_selection", "(", "update_selection", ")", ":", "def", "handle_update", "(", "selection", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "\"\"\"Check for changes in the selection\n\n If the selection is changed by the decorated method, the internal c...
Decorator indicating that the decorated method could change the selection
[ "Decorator", "indicating", "that", "the", "decorated", "method", "could", "change", "the", "selection" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/selection.py#L66-L99
DLR-RM/RAFCON
source/rafcon/gui/models/selection.py
extend_selection
def extend_selection(): """Checks is the selection is to be extended The selection is to be extended, if a special modifier key (typically <Ctrl>) is being pressed. :return: If to extend the selection :rtype: True """ from rafcon.gui.singleton import main_window_controller currently_presse...
python
def extend_selection(): """Checks is the selection is to be extended The selection is to be extended, if a special modifier key (typically <Ctrl>) is being pressed. :return: If to extend the selection :rtype: True """ from rafcon.gui.singleton import main_window_controller currently_presse...
[ "def", "extend_selection", "(", ")", ":", "from", "rafcon", ".", "gui", ".", "singleton", "import", "main_window_controller", "currently_pressed_keys", "=", "main_window_controller", ".", "currently_pressed_keys", "if", "main_window_controller", "else", "set", "(", ")",...
Checks is the selection is to be extended The selection is to be extended, if a special modifier key (typically <Ctrl>) is being pressed. :return: If to extend the selection :rtype: True
[ "Checks", "is", "the", "selection", "is", "to", "be", "extended" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/selection.py#L102-L115
DLR-RM/RAFCON
source/rafcon/gui/models/selection.py
Selection._check_model_types
def _check_model_types(self, models): """ Check types of passed models for correctness and in case raise exception :rtype: set :returns: set of models that are valid for the class""" if not hasattr(models, "__iter__"): models = {models} if not all([isinstance(model, ...
python
def _check_model_types(self, models): """ Check types of passed models for correctness and in case raise exception :rtype: set :returns: set of models that are valid for the class""" if not hasattr(models, "__iter__"): models = {models} if not all([isinstance(model, ...
[ "def", "_check_model_types", "(", "self", ",", "models", ")", ":", "if", "not", "hasattr", "(", "models", ",", "\"__iter__\"", ")", ":", "models", "=", "{", "models", "}", "if", "not", "all", "(", "[", "isinstance", "(", "model", ",", "(", "AbstractSta...
Check types of passed models for correctness and in case raise exception :rtype: set :returns: set of models that are valid for the class
[ "Check", "types", "of", "passed", "models", "for", "correctness", "and", "in", "case", "raise", "exception" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/selection.py#L157-L167
DLR-RM/RAFCON
source/rafcon/gui/models/selection.py
Selection.add
def add(self, models): """ Adds the passed model(s) to the selection""" if models is None: return models = self._check_model_types(models) self._selected.update(models) self._selected = reduce_to_parent_states(self._selected)
python
def add(self, models): """ Adds the passed model(s) to the selection""" if models is None: return models = self._check_model_types(models) self._selected.update(models) self._selected = reduce_to_parent_states(self._selected)
[ "def", "add", "(", "self", ",", "models", ")", ":", "if", "models", "is", "None", ":", "return", "models", "=", "self", ".", "_check_model_types", "(", "models", ")", "self", ".", "_selected", ".", "update", "(", "models", ")", "self", ".", "_selected"...
Adds the passed model(s) to the selection
[ "Adds", "the", "passed", "model", "(", "s", ")", "to", "the", "selection" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/selection.py#L170-L177