hexsha
stringlengths
40
40
repo
stringlengths
7
114
path
stringlengths
4
124
license
listlengths
1
9
language
stringclasses
1 value
identifier
stringlengths
1
71
return_type
stringlengths
1
749
original_string
stringlengths
76
22.7k
original_docstring
stringlengths
16
7.61k
docstring
stringlengths
16
2.47k
docstring_tokens
listlengths
6
477
code
stringlengths
14
10.2k
code_tokens
listlengths
6
996
short_docstring
stringlengths
2
644
short_docstring_tokens
listlengths
1
116
comment
listlengths
1
89
parameters
listlengths
0
64
docstring_params
dict
73f3fb0b3d4166912122c562f3a5e7eb25a10f93
lucfra/RFHO
rfho/examples/data_hypercleaner.py
[ "MIT" ]
Python
baseline
<not_specific>
def baseline(saver, model, y, data, T, lr, lmd=None, name='baseline'): # TODO other optimizers? """ BASELINE EXECUTION (valid also for oracle and final training, with optimized values of lambda) :param saver: `Saver` object (can be None) :param name: optional name for the saver :param data:...
BASELINE EXECUTION (valid also for oracle and final training, with optimized values of lambda) :param saver: `Saver` object (can be None) :param name: optional name for the saver :param data: `Datasets` object :param T: number of iterations :param lmd: weights for the examples, if None set...
BASELINE EXECUTION (valid also for oracle and final training, with optimized values of lambda)
[ "BASELINE", "EXECUTION", "(", "valid", "also", "for", "oracle", "and", "final", "training", "with", "optimized", "values", "of", "lambda", ")" ]
def baseline(saver, model, y, data, T, lr, lmd=None, name='baseline'): x = model.inp[0] train_and_valid = rf.datasets.Dataset.stack(data.train, data.validation) train_and_valid_s = train_and_valid.create_supplier(x, y) tst_s = data.test.create_supplier(x, y) if lmd is None: lmd = np.ones(train_and_v...
[ "def", "baseline", "(", "saver", ",", "model", ",", "y", ",", "data", ",", "T", ",", "lr", ",", "lmd", "=", "None", ",", "name", "=", "'baseline'", ")", ":", "x", "=", "model", ".", "inp", "[", "0", "]", "train_and_valid", "=", "rf", ".", "data...
BASELINE EXECUTION (valid also for oracle and final training, with optimized values of lambda)
[ "BASELINE", "EXECUTION", "(", "valid", "also", "for", "oracle", "and", "final", "training", "with", "optimized", "values", "of", "lambda", ")" ]
[ "# TODO other optimizers?", "\"\"\"\n BASELINE EXECUTION (valid also for oracle and final training,\n with optimized values of lambda)\n\n :param saver: `Saver` object (can be None)\n :param name: optional name for the saver\n :param data: `Datasets` object\n :param T: number of iterations\n ...
[ { "param": "saver", "type": null }, { "param": "model", "type": null }, { "param": "y", "type": null }, { "param": "data", "type": null }, { "param": "T", "type": null }, { "param": "lr", "type": null }, { "param": "lmd", "type": null ...
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "saver", "type": null, "docstring": "`Saver` object (can be None)", "docstring_tokens": [ "`", "Save...
73f3fb0b3d4166912122c562f3a5e7eb25a10f93
lucfra/RFHO
rfho/examples/data_hypercleaner.py
[ "MIT" ]
Python
main
null
def main(saver=None, run_baseline=True, run_oracle=True, run_optimization=True, T=2000, lr=.1, R_search_space=(1000, 1500, 2000, 2500)): # TODO ... """ This method should replicate ICML experiment.... :param R_search_space: :param saver: :param run_baseline: :param run_oracl...
This method should replicate ICML experiment.... :param R_search_space: :param saver: :param run_baseline: :param run_oracle: :param run_optimization: :param T: :param lr: :return:
This method should replicate ICML experiment
[ "This", "method", "should", "replicate", "ICML", "experiment" ]
def main(saver=None, run_baseline=True, run_oracle=True, run_optimization=True, T=2000, lr=.1, R_search_space=(1000, 1500, 2000, 2500)): data = load_std_data() x = tf.placeholder(tf.float32, name='x') y = tf.placeholder(tf.float32, name='y') model = rf.LinearModel(x, 28 * 28, 10) if run_bas...
[ "def", "main", "(", "saver", "=", "None", ",", "run_baseline", "=", "True", ",", "run_oracle", "=", "True", ",", "run_optimization", "=", "True", ",", "T", "=", "2000", ",", "lr", "=", ".1", ",", "R_search_space", "=", "(", "1000", ",", "1500", ",", ...
This method should replicate ICML experiment....
[ "This", "method", "should", "replicate", "ICML", "experiment", "...." ]
[ "# TODO ...", "\"\"\"\n This method should replicate ICML experiment....\n \n :param R_search_space: \n :param saver: \n :param run_baseline: \n :param run_oracle: \n :param run_optimization: \n :param T: \n :param lr: \n :return: \n \"\"\"", "# baseline_lrate = args.lr * args.p...
[ { "param": "saver", "type": null }, { "param": "run_baseline", "type": null }, { "param": "run_oracle", "type": null }, { "param": "run_optimization", "type": null }, { "param": "T", "type": null }, { "param": "lr", "type": null }, { "param...
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "saver", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, ...
73f3fb0b3d4166912122c562f3a5e7eb25a10f93
lucfra/RFHO
rfho/examples/data_hypercleaner.py
[ "MIT" ]
Python
quick_demo
null
def quick_demo(lmd=None): """ Just to show that it works... :return: """ saver = rf.Saver(['Data Hyper-cleaner', 'Quick Demo']) np.random.seed(0) data = load_std_data() x = tf.placeholder(tf.float32, name='x') y = tf.placeholder(tf.float32, name='y') model = rf.LinearModel...
Just to show that it works... :return:
Just to show that it works
[ "Just", "to", "show", "that", "it", "works" ]
def quick_demo(lmd=None): saver = rf.Saver(['Data Hyper-cleaner', 'Quick Demo']) np.random.seed(0) data = load_std_data() x = tf.placeholder(tf.float32, name='x') y = tf.placeholder(tf.float32, name='y') model = rf.LinearModel(x, 28 * 28, 10) if lmd is None: lmd = data_hyper_cleaner(...
[ "def", "quick_demo", "(", "lmd", "=", "None", ")", ":", "saver", "=", "rf", ".", "Saver", "(", "[", "'Data Hyper-cleaner'", ",", "'Quick Demo'", "]", ")", "np", ".", "random", ".", "seed", "(", "0", ")", "data", "=", "load_std_data", "(", ")", "x", ...
Just to show that it works...
[ "Just", "to", "show", "that", "it", "works", "..." ]
[ "\"\"\"\n Just to show that it works...\n \n :return: \n \"\"\"", "# the behaviour in this particular setting is quite stable, we can reduce the times by setting small R,", "# higher hyper-learning rates and a small number of training iterations (T) and hyper-iterations", "# there's no reason to o...
[ { "param": "lmd", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "lmd", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
call_method_optional_param
<not_specific>
def call_method_optional_param(method, optional_param): """ Convenience method for function that may or not have one parameter (like feed dictionary suppliers) :param method: :param optional_param: :return: the result of calling the method. """ return method(optional_param) if len(signature...
Convenience method for function that may or not have one parameter (like feed dictionary suppliers) :param method: :param optional_param: :return: the result of calling the method.
Convenience method for function that may or not have one parameter (like feed dictionary suppliers)
[ "Convenience", "method", "for", "function", "that", "may", "or", "not", "have", "one", "parameter", "(", "like", "feed", "dictionary", "suppliers", ")" ]
def call_method_optional_param(method, optional_param): return method(optional_param) if len(signature(method).parameters) > 0 else method()
[ "def", "call_method_optional_param", "(", "method", ",", "optional_param", ")", ":", "return", "method", "(", "optional_param", ")", "if", "len", "(", "signature", "(", "method", ")", ".", "parameters", ")", ">", "0", "else", "method", "(", ")" ]
Convenience method for function that may or not have one parameter (like feed dictionary suppliers)
[ "Convenience", "method", "for", "function", "that", "may", "or", "not", "have", "one", "parameter", "(", "like", "feed", "dictionary", "suppliers", ")" ]
[ "\"\"\"\n Convenience method for function that may or not have one parameter (like feed dictionary suppliers)\n\n :param method:\n :param optional_param:\n :return: the result of calling the method.\n \"\"\"" ]
[ { "param": "method", "type": null }, { "param": "optional_param", "type": null } ]
{ "returns": [ { "docstring": "the result of calling the method.", "docstring_tokens": [ "the", "result", "of", "calling", "the", "method", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "method...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
norm
<not_specific>
def norm(v, name='norm'): """ The the norm of a Tensor: if v is a vector then the norm is the Euclid's norm L2, otherwise it computes the Frobenius norm. :param name: (optional, default norm) name of the name_scope :param v: tf.Tensor or Variable :return: a tensor that computes the norm """...
The the norm of a Tensor: if v is a vector then the norm is the Euclid's norm L2, otherwise it computes the Frobenius norm. :param name: (optional, default norm) name of the name_scope :param v: tf.Tensor or Variable :return: a tensor that computes the norm
The the norm of a Tensor: if v is a vector then the norm is the Euclid's norm L2, otherwise it computes the Frobenius norm.
[ "The", "the", "norm", "of", "a", "Tensor", ":", "if", "v", "is", "a", "vector", "then", "the", "norm", "is", "the", "Euclid", "'", "s", "norm", "L2", "otherwise", "it", "computes", "the", "Frobenius", "norm", "." ]
def norm(v, name='norm'): with tf.name_scope(name): return wsr(tf.sqrt(tf.reduce_sum(tf.square(v))))
[ "def", "norm", "(", "v", ",", "name", "=", "'norm'", ")", ":", "with", "tf", ".", "name_scope", "(", "name", ")", ":", "return", "wsr", "(", "tf", ".", "sqrt", "(", "tf", ".", "reduce_sum", "(", "tf", ".", "square", "(", "v", ")", ")", ")", "...
The the norm of a Tensor: if v is a vector then the norm is the Euclid's norm L2, otherwise it computes the Frobenius norm.
[ "The", "the", "norm", "of", "a", "Tensor", ":", "if", "v", "is", "a", "vector", "then", "the", "norm", "is", "the", "Euclid", "'", "s", "norm", "L2", "otherwise", "it", "computes", "the", "Frobenius", "norm", "." ]
[ "\"\"\"\n The the norm of a Tensor: if v is a vector then the norm is the Euclid's norm L2, otherwise it computes the\n Frobenius norm.\n\n :param name: (optional, default norm) name of the name_scope\n :param v: tf.Tensor or Variable\n :return: a tensor that computes the norm\n \"\"\"" ]
[ { "param": "v", "type": null }, { "param": "name", "type": null } ]
{ "returns": [ { "docstring": "a tensor that computes the norm", "docstring_tokens": [ "a", "tensor", "that", "computes", "the", "norm" ], "type": null } ], "raises": [], "params": [ { "identifier": "v", "type": null...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
cross_entropy_loss
<not_specific>
def cross_entropy_loss(labels, logits, linear_input=True, eps=1.e-5, name='cross_entropy_loss'): """ Clipped standard-version cross entropy loss. Implemented because the standard function tf.nn.softmax_cross_entropy_with_logits has wrong (?) Hessian. Clipped because it easily brings to nan otherwise, e...
Clipped standard-version cross entropy loss. Implemented because the standard function tf.nn.softmax_cross_entropy_with_logits has wrong (?) Hessian. Clipped because it easily brings to nan otherwise, especially when calculating the Hessian. Maybe the code could be optimized since ln(softmax(z_j)) = ...
Clipped standard-version cross entropy loss. Implemented because the standard function tf.nn.softmax_cross_entropy_with_logits has wrong (?) Hessian. Clipped because it easily brings to nan otherwise, especially when calculating the Hessian. Maybe the code could be optimized since ln(softmax(z_j)) = z_j - prod z_i . ...
[ "Clipped", "standard", "-", "version", "cross", "entropy", "loss", ".", "Implemented", "because", "the", "standard", "function", "tf", ".", "nn", ".", "softmax_cross_entropy_with_logits", "has", "wrong", "(", "?", ")", "Hessian", ".", "Clipped", "because", "it",...
def cross_entropy_loss(labels, logits, linear_input=True, eps=1.e-5, name='cross_entropy_loss'): with tf.name_scope(name): softmax_out = tf.nn.softmax(logits) if linear_input else logits return -tf.reduce_sum( labels * tf.log(tf.clip_by_value(softmax_out, eps, 1. - eps)), reduction_indic...
[ "def", "cross_entropy_loss", "(", "labels", ",", "logits", ",", "linear_input", "=", "True", ",", "eps", "=", "1.e-5", ",", "name", "=", "'cross_entropy_loss'", ")", ":", "with", "tf", ".", "name_scope", "(", "name", ")", ":", "softmax_out", "=", "tf", "...
Clipped standard-version cross entropy loss.
[ "Clipped", "standard", "-", "version", "cross", "entropy", "loss", "." ]
[ "\"\"\"\n Clipped standard-version cross entropy loss. Implemented because the standard function\n tf.nn.softmax_cross_entropy_with_logits has wrong (?) Hessian.\n Clipped because it easily brings to nan otherwise, especially when calculating the Hessian.\n\n Maybe the code could be optimized since ln(...
[ { "param": "labels", "type": null }, { "param": "logits", "type": null }, { "param": "linear_input", "type": null }, { "param": "eps", "type": null }, { "param": "name", "type": null } ]
{ "returns": [ { "docstring": "tensor for the cross_entropy_loss (WITHOUT MEAN ON THE EXAMPLES)", "docstring_tokens": [ "tensor", "for", "the", "cross_entropy_loss", "(", "WITHOUT", "MEAN", "ON", "THE", "EXAMPLES", ...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
binary_cross_entropy
<not_specific>
def binary_cross_entropy(labels, logits, linear_input=True, eps=1.e-5, name='binary_cross_entropy_loss'): """ Same as cross_entropy_loss for the binary classification problem. the model should have a one dimensional output, the targets should be given in form of a matrix of dimensions batch_size x 1 with va...
Same as cross_entropy_loss for the binary classification problem. the model should have a one dimensional output, the targets should be given in form of a matrix of dimensions batch_size x 1 with values in [0,1]. :param labels: :param logits: sigmoid or linear output of the model :param linear_inp...
Same as cross_entropy_loss for the binary classification problem. the model should have a one dimensional output, the targets should be given in form of a matrix of dimensions batch_size x 1 with values in [0,1].
[ "Same", "as", "cross_entropy_loss", "for", "the", "binary", "classification", "problem", ".", "the", "model", "should", "have", "a", "one", "dimensional", "output", "the", "targets", "should", "be", "given", "in", "form", "of", "a", "matrix", "of", "dimensions...
def binary_cross_entropy(labels, logits, linear_input=True, eps=1.e-5, name='binary_cross_entropy_loss'): with tf.name_scope(name): sigmoid_out = tf.nn.sigmoid(logits)[:, 0] if linear_input else logits return - (labels * tf.log(tf.clip_by_value(sigmoid_out, eps, 1. - eps)) + (1. - ...
[ "def", "binary_cross_entropy", "(", "labels", ",", "logits", ",", "linear_input", "=", "True", ",", "eps", "=", "1.e-5", ",", "name", "=", "'binary_cross_entropy_loss'", ")", ":", "with", "tf", ".", "name_scope", "(", "name", ")", ":", "sigmoid_out", "=", ...
Same as cross_entropy_loss for the binary classification problem.
[ "Same", "as", "cross_entropy_loss", "for", "the", "binary", "classification", "problem", "." ]
[ "\"\"\"\n Same as cross_entropy_loss for the binary classification problem. the model should have a one dimensional output,\n the targets should be given in form of a matrix of dimensions batch_size x 1 with values in [0,1].\n\n :param labels:\n :param logits: sigmoid or linear output of the model\n ...
[ { "param": "labels", "type": null }, { "param": "logits", "type": null }, { "param": "linear_input", "type": null }, { "param": "eps", "type": null }, { "param": "name", "type": null } ]
{ "returns": [ { "docstring": "tensor for the cross_entropy_loss (WITHOUT MEAN ON THE EXAMPLES)", "docstring_tokens": [ "tensor", "for", "the", "cross_entropy_loss", "(", "WITHOUT", "MEAN", "ON", "THE", "EXAMPLES", ...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
matmul
<not_specific>
def matmul(a, b, benchmark=True, name='mul'): # TODO maybe put inside dot """ Interface function for matmul that works also with sparse tensors :param a: :param b: :param benchmark: :param name: :return: """ a_is_sparse = isinstance(a, tf.SparseTensor) with tf.name_scope(name):...
Interface function for matmul that works also with sparse tensors :param a: :param b: :param benchmark: :param name: :return:
Interface function for matmul that works also with sparse tensors
[ "Interface", "function", "for", "matmul", "that", "works", "also", "with", "sparse", "tensors" ]
def matmul(a, b, benchmark=True, name='mul'): a_is_sparse = isinstance(a, tf.SparseTensor) with tf.name_scope(name): if a_is_sparse: mul = wsr(tf.matmul(tf.sparse_tensor_to_dense(a, default_value=0.), b)) if benchmark: mul_ops = [wsr(tf.sparse_tensor_dense_matmu...
[ "def", "matmul", "(", "a", ",", "b", ",", "benchmark", "=", "True", ",", "name", "=", "'mul'", ")", ":", "a_is_sparse", "=", "isinstance", "(", "a", ",", "tf", ".", "SparseTensor", ")", "with", "tf", ".", "name_scope", "(", "name", ")", ":", "if", ...
Interface function for matmul that works also with sparse tensors
[ "Interface", "function", "for", "matmul", "that", "works", "also", "with", "sparse", "tensors" ]
[ "# TODO maybe put inside dot", "\"\"\"\n Interface function for matmul that works also with sparse tensors\n\n :param a:\n :param b:\n :param benchmark:\n :param name:\n :return:\n \"\"\"", "# others ?", "# wsr(tf.nn.embedding_lookup_sparse()) # I couldn't figure out how this works.........
[ { "param": "a", "type": null }, { "param": "b", "type": null }, { "param": "benchmark", "type": null }, { "param": "name", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "a", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, "is...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
dot
<not_specific>
def dot(v1, v2, name='dot'): """ Dot product (No idea why there isn't already in tensorflow...) and some partial extensions for matrix vector multiplication. Should ideally copy `np.dot` method. :param v1: first vector :param v2: second vector :return: """ v1_shape = v1.get_shape().ndim...
Dot product (No idea why there isn't already in tensorflow...) and some partial extensions for matrix vector multiplication. Should ideally copy `np.dot` method. :param v1: first vector :param v2: second vector :return:
Dot product (No idea why there isn't already in tensorflow...) and some partial extensions for matrix vector multiplication. Should ideally copy `np.dot` method.
[ "Dot", "product", "(", "No", "idea", "why", "there", "isn", "'", "t", "already", "in", "tensorflow", "...", ")", "and", "some", "partial", "extensions", "for", "matrix", "vector", "multiplication", ".", "Should", "ideally", "copy", "`", "np", ".", "dot", ...
def dot(v1, v2, name='dot'): v1_shape = v1.get_shape().ndims v2_shape = v2.get_shape().ndims if v1_shape > 1 and v2_shape > 1: return tf.matmul(v1, v2, name=name) elif v1_shape == 2 and v2_shape == 1: if v1.get_shape().as_list()[1] != 1: return tf.reduce_sum(v1 * v2, reduct...
[ "def", "dot", "(", "v1", ",", "v2", ",", "name", "=", "'dot'", ")", ":", "v1_shape", "=", "v1", ".", "get_shape", "(", ")", ".", "ndims", "v2_shape", "=", "v2", ".", "get_shape", "(", ")", ".", "ndims", "if", "v1_shape", ">", "1", "and", "v2_shap...
Dot product (No idea why there isn't already in tensorflow...) and some partial extensions for matrix vector multiplication.
[ "Dot", "product", "(", "No", "idea", "why", "there", "isn", "'", "t", "already", "in", "tensorflow", "...", ")", "and", "some", "partial", "extensions", "for", "matrix", "vector", "multiplication", "." ]
[ "\"\"\"\n Dot product (No idea why there isn't already in tensorflow...) and some partial extensions for matrix vector\n multiplication. Should ideally copy `np.dot` method.\n\n :param v1: first vector\n :param v2: second vector\n :return:\n \"\"\"", "# print(v1_shape, v2_shape)", "# it is a t...
[ { "param": "v1", "type": null }, { "param": "v2", "type": null }, { "param": "name", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "v1", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, "i...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
vectorize_all
<not_specific>
def vectorize_all(var_list): """Given a list of tensors returns their concatenated vectorization. Note that for matrices the vectorization is row-wise instead of column-wise as it should be in Magnus. Could it be a problem? :param var_list: **bold** :return: vectorization of `var_list`""" retu...
Given a list of tensors returns their concatenated vectorization. Note that for matrices the vectorization is row-wise instead of column-wise as it should be in Magnus. Could it be a problem? :param var_list: **bold** :return: vectorization of `var_list`
Given a list of tensors returns their concatenated vectorization. Note that for matrices the vectorization is row-wise instead of column-wise as it should be in Magnus.
[ "Given", "a", "list", "of", "tensors", "returns", "their", "concatenated", "vectorization", ".", "Note", "that", "for", "matrices", "the", "vectorization", "is", "row", "-", "wise", "instead", "of", "column", "-", "wise", "as", "it", "should", "be", "in", ...
def vectorize_all(var_list): return wsr(tf.concat([tf.reshape(_w, [-1]) for _w in var_list], 0))
[ "def", "vectorize_all", "(", "var_list", ")", ":", "return", "wsr", "(", "tf", ".", "concat", "(", "[", "tf", ".", "reshape", "(", "_w", ",", "[", "-", "1", "]", ")", "for", "_w", "in", "var_list", "]", ",", "0", ")", ")" ]
Given a list of tensors returns their concatenated vectorization.
[ "Given", "a", "list", "of", "tensors", "returns", "their", "concatenated", "vectorization", "." ]
[ "\"\"\"Given a list of tensors returns their concatenated vectorization.\n Note that for matrices the vectorization is row-wise instead of column-wise as\n it should be in Magnus. Could it be a problem?\n\n :param var_list: **bold**\n\n :return: vectorization of `var_list`\"\"\"" ]
[ { "param": "var_list", "type": null } ]
{ "returns": [ { "docstring": "vectorization of `var_list`", "docstring_tokens": [ "vectorization", "of", "`", "var_list", "`" ], "type": null } ], "raises": [], "params": [ { "identifier": "var_list", "type": null, "d...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
hv_1
<not_specific>
def hv_1(_dyn, _lv, _v): # NOTE this is not an efficient implementation """Computes hessian-vector product (without storing the Hessian) in a naive way. If _lv is a list of tensor, then vectorizes them with vectorize_all""" res = [] for i in range(_v.get_shape()[0].value): _hvi = tf.gradients(_...
Computes hessian-vector product (without storing the Hessian) in a naive way. If _lv is a list of tensor, then vectorizes them with vectorize_all
Computes hessian-vector product (without storing the Hessian) in a naive way. If _lv is a list of tensor, then vectorizes them with vectorize_all
[ "Computes", "hessian", "-", "vector", "product", "(", "without", "storing", "the", "Hessian", ")", "in", "a", "naive", "way", ".", "If", "_lv", "is", "a", "list", "of", "tensor", "then", "vectorizes", "them", "with", "vectorize_all" ]
def hv_1(_dyn, _lv, _v): res = [] for i in range(_v.get_shape()[0].value): _hvi = tf.gradients(_dyn[i], _lv) if isinstance(_lv, list): _hvi = vectorize_all(_hvi) res.append( tf.reduce_sum(_hvi * _v) ) return tf.stack(res)
[ "def", "hv_1", "(", "_dyn", ",", "_lv", ",", "_v", ")", ":", "res", "=", "[", "]", "for", "i", "in", "range", "(", "_v", ".", "get_shape", "(", ")", "[", "0", "]", ".", "value", ")", ":", "_hvi", "=", "tf", ".", "gradients", "(", "_dyn", "[...
Computes hessian-vector product (without storing the Hessian) in a naive way.
[ "Computes", "hessian", "-", "vector", "product", "(", "without", "storing", "the", "Hessian", ")", "in", "a", "naive", "way", "." ]
[ "# NOTE this is not an efficient implementation", "\"\"\"Computes hessian-vector product (without storing the Hessian)\n in a naive way. If _lv is a list of tensor, then vectorizes them with vectorize_all\"\"\"" ]
[ { "param": "_dyn", "type": null }, { "param": "_lv", "type": null }, { "param": "_v", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "_dyn", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "_lv", "type": null, "docstring": null, "docstring_tokens": []...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
hvp
<not_specific>
def hvp(loss, w, v, name='hessian_vector_product'): """ Convenience function for hessian vector product. :param name: :param loss: :param w: :param v: :return: """ # some parameter checking if not isinstance(w, list) and not isinstance(v, list): # single inputs if len(v...
Convenience function for hessian vector product. :param name: :param loss: :param w: :param v: :return:
Convenience function for hessian vector product.
[ "Convenience", "function", "for", "hessian", "vector", "product", "." ]
def hvp(loss, w, v, name='hessian_vector_product'): if not isinstance(w, list) and not isinstance(v, list): if len(v.get_shape().as_list()) == 2 and len(w.get_shape().as_list()) == 1: return tf.stack([ hvp(loss, w, v[:, k]) for k in range(v.get_shape().as_list()[1]) ...
[ "def", "hvp", "(", "loss", ",", "w", ",", "v", ",", "name", "=", "'hessian_vector_product'", ")", ":", "if", "not", "isinstance", "(", "w", ",", "list", ")", "and", "not", "isinstance", "(", "v", ",", "list", ")", ":", "if", "len", "(", "v", ".",...
Convenience function for hessian vector product.
[ "Convenience", "function", "for", "hessian", "vector", "product", "." ]
[ "\"\"\"\n Convenience function for hessian vector product.\n\n :param name:\n :param loss:\n :param w:\n :param v:\n :return:\n \"\"\"", "# some parameter checking", "# single inputs" ]
[ { "param": "loss", "type": null }, { "param": "w", "type": null }, { "param": "v", "type": null }, { "param": "name", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "loss", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, ...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
var_list
<not_specific>
def var_list(self, mode=VlMode.RAW): """ Get the chunks that define this variable. :param mode: (optional, default VL_MODE.RAW) VL_MODE.RAW: returns simply var_list, that may contain tf.Variables or MergedVariables VL_MODE.BASE: returns a list of tf...
Get the chunks that define this variable. :param mode: (optional, default VL_MODE.RAW) VL_MODE.RAW: returns simply var_list, that may contain tf.Variables or MergedVariables VL_MODE.BASE: returns a list of tf.Variables that are the "base" variables that fo...
Get the chunks that define this variable.
[ "Get", "the", "chunks", "that", "define", "this", "variable", "." ]
def var_list(self, mode=VlMode.RAW): if mode == VlMode.RAW: return self._var_list elif mode == VlMode.BASE: return self._get_base_variable_list() elif mode == VlMode.TENSOR: return self._var_list_as_tensors() else: raise NotImplementedErr...
[ "def", "var_list", "(", "self", ",", "mode", "=", "VlMode", ".", "RAW", ")", ":", "if", "mode", "==", "VlMode", ".", "RAW", ":", "return", "self", ".", "_var_list", "elif", "mode", "==", "VlMode", ".", "BASE", ":", "return", "self", ".", "_get_base_v...
Get the chunks that define this variable.
[ "Get", "the", "chunks", "that", "define", "this", "variable", "." ]
[ "\"\"\"\n Get the chunks that define this variable.\n\n :param mode: (optional, default VL_MODE.RAW) VL_MODE.RAW: returns simply var_list, that may contain tf.Variables\n or MergedVariables\n VL_MODE.BASE: returns a list of tf.Variables that are the \"base\"...
[ { "param": "self", "type": null }, { "param": "mode", "type": null } ]
{ "returns": [ { "docstring": "A list that may contain tf.Tensors, tf.Variables and/or MergedVariables", "docstring_tokens": [ "A", "list", "that", "may", "contain", "tf", ".", "Tensors", "tf", ".", "Variables", ...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
initialize
null
def initialize(self, session=None): """ Initialize this merged variable or call `model.initialize` if a model is associated to this variable (see `Network.initialize`) :param session: :return: """ ss = session or tf.get_default_session() assert...
Initialize this merged variable or call `model.initialize` if a model is associated to this variable (see `Network.initialize`) :param session: :return:
Initialize this merged variable or call `model.initialize` if a model is associated to this variable
[ "Initialize", "this", "merged", "variable", "or", "call", "`", "model", ".", "initialize", "`", "if", "a", "model", "is", "associated", "to", "this", "variable" ]
def initialize(self, session=None): ss = session or tf.get_default_session() assert ss, 'No default session' ss.run(tf.variables_initializer(self.var_list(VlMode.BASE))) if self.model: self.model.initialize(session=session)
[ "def", "initialize", "(", "self", ",", "session", "=", "None", ")", ":", "ss", "=", "session", "or", "tf", ".", "get_default_session", "(", ")", "assert", "ss", ",", "'No default session'", "ss", ".", "run", "(", "tf", ".", "variables_initializer", "(", ...
Initialize this merged variable or call `model.initialize` if a model is associated to this variable (see `Network.initialize`)
[ "Initialize", "this", "merged", "variable", "or", "call", "`", "model", ".", "initialize", "`", "if", "a", "model", "is", "associated", "to", "this", "variable", "(", "see", "`", "Network", ".", "initialize", "`", ")" ]
[ "\"\"\"\n Initialize this merged variable or call `model.initialize` if a model is associated to this \n variable (see `Network.initialize`)\n \n :param session: \n :return: \n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "session", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
_get_base_variable_list
<not_specific>
def _get_base_variable_list(self): """ This methods checks that all the elements of var_list are legitimate (tf.Variables or MergedVariables) and returns the underlying tf.Variables. :return: """ res = [] for v in self._var_list: if isinstance(v, Merge...
This methods checks that all the elements of var_list are legitimate (tf.Variables or MergedVariables) and returns the underlying tf.Variables. :return:
This methods checks that all the elements of var_list are legitimate (tf.Variables or MergedVariables) and returns the underlying tf.Variables.
[ "This", "methods", "checks", "that", "all", "the", "elements", "of", "var_list", "are", "legitimate", "(", "tf", ".", "Variables", "or", "MergedVariables", ")", "and", "returns", "the", "underlying", "tf", ".", "Variables", "." ]
def _get_base_variable_list(self): res = [] for v in self._var_list: if isinstance(v, MergedVariable): res.extend(v._get_base_variable_list()) elif isinstance(v, tf.Variable): res.append(v) else: raise ValueError('someth...
[ "def", "_get_base_variable_list", "(", "self", ")", ":", "res", "=", "[", "]", "for", "v", "in", "self", ".", "_var_list", ":", "if", "isinstance", "(", "v", ",", "MergedVariable", ")", ":", "res", ".", "extend", "(", "v", ".", "_get_base_variable_list",...
This methods checks that all the elements of var_list are legitimate (tf.Variables or MergedVariables) and returns the underlying tf.Variables.
[ "This", "methods", "checks", "that", "all", "the", "elements", "of", "var_list", "are", "legitimate", "(", "tf", ".", "Variables", "or", "MergedVariables", ")", "and", "returns", "the", "underlying", "tf", ".", "Variables", "." ]
[ "\"\"\"\n This methods checks that all the elements of var_list are legitimate (tf.Variables or MergedVariables)\n and returns the underlying tf.Variables.\n :return:\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
assign
<not_specific>
def assign(self, value, use_locking=False): """ Behaves as tf.Variable.assign, building assign ops for the underlying (original) Variables :param value: rank-1 tensor. Assumes it has the same structure as the tensor contained in the object. :param use_locking: (optional) see use_lockin...
Behaves as tf.Variable.assign, building assign ops for the underlying (original) Variables :param value: rank-1 tensor. Assumes it has the same structure as the tensor contained in the object. :param use_locking: (optional) see use_locking in `tf.Variables.assign` :return: A list of `...
Behaves as tf.Variable.assign, building assign ops for the underlying (original) Variables
[ "Behaves", "as", "tf", ".", "Variable", ".", "assign", "building", "assign", "ops", "for", "the", "underlying", "(", "original", ")", "Variables" ]
def assign(self, value, use_locking=False): assign_ops = [ wsr(v.assign(reshape(value), use_locking=use_locking)) for v, reshape in self.chunks_info_dict.items() ] return tf.group(*assign_ops)
[ "def", "assign", "(", "self", ",", "value", ",", "use_locking", "=", "False", ")", ":", "assign_ops", "=", "[", "wsr", "(", "v", ".", "assign", "(", "reshape", "(", "value", ")", ",", "use_locking", "=", "use_locking", ")", ")", "for", "v", ",", "r...
Behaves as tf.Variable.assign, building assign ops for the underlying (original) Variables
[ "Behaves", "as", "tf", ".", "Variable", ".", "assign", "building", "assign", "ops", "for", "the", "underlying", "(", "original", ")", "Variables" ]
[ "\"\"\"\n Behaves as tf.Variable.assign, building assign ops for the underlying (original) Variables\n\n\n :param value: rank-1 tensor. Assumes it has the same structure as the tensor contained in the object.\n :param use_locking: (optional) see use_locking in `tf.Variables.assign`\n :re...
[ { "param": "self", "type": null }, { "param": "value", "type": null }, { "param": "use_locking", "type": null } ]
{ "returns": [ { "docstring": "A list of `tf.Variables.assign` ops.", "docstring_tokens": [ "A", "list", "of", "`", "tf", ".", "Variables", ".", "assign", "`", "ops", "." ], "type": null } ...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
tensor_conversion
<not_specific>
def tensor_conversion(value, dtype=None, name=None, as_ref=False): """ tensorflow tensor conversion function. Simply gives to tensorflow the underlying tensor :param value: :param dtype: :param name: :param as_ref: :return: """ # if as_ref: ...
tensorflow tensor conversion function. Simply gives to tensorflow the underlying tensor :param value: :param dtype: :param name: :param as_ref: :return:
tensorflow tensor conversion function. Simply gives to tensorflow the underlying tensor
[ "tensorflow", "tensor", "conversion", "function", ".", "Simply", "gives", "to", "tensorflow", "the", "underlying", "tensor" ]
def tensor_conversion(value, dtype=None, name=None, as_ref=False): return tf.convert_to_tensor(value.tensor, dtype=dtype, name=name)
[ "def", "tensor_conversion", "(", "value", ",", "dtype", "=", "None", ",", "name", "=", "None", ",", "as_ref", "=", "False", ")", ":", "return", "tf", ".", "convert_to_tensor", "(", "value", ".", "tensor", ",", "dtype", "=", "dtype", ",", "name", "=", ...
tensorflow tensor conversion function.
[ "tensorflow", "tensor", "conversion", "function", "." ]
[ "\"\"\"\n tensorflow tensor conversion function. Simply gives to tensorflow the underlying tensor\n\n :param value:\n :param dtype:\n :param name:\n :param as_ref:\n :return:\n \"\"\"", "# if as_ref:", "# raise NotImplemented()" ]
[ { "param": "value", "type": null }, { "param": "dtype", "type": null }, { "param": "name", "type": null }, { "param": "as_ref", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "value", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, ...
e9c155b589adde097f2c8fe0e5d4131e8a7c38ee
lucfra/RFHO
rfho/utils.py
[ "MIT" ]
Python
tensor_conversion
<not_specific>
def tensor_conversion(value, dtype=None, name=None, as_ref=False): """ tensorflow tensor conversion function. Simply gives to tensorflow the underlying tensor :param value: :param dtype: :param name: :param as_ref: :return: """ if as_ref: ...
tensorflow tensor conversion function. Simply gives to tensorflow the underlying tensor :param value: :param dtype: :param name: :param as_ref: :return:
tensorflow tensor conversion function. Simply gives to tensorflow the underlying tensor
[ "tensorflow", "tensor", "conversion", "function", ".", "Simply", "gives", "to", "tensorflow", "the", "underlying", "tensor" ]
def tensor_conversion(value, dtype=None, name=None, as_ref=False): if as_ref: raise NotImplemented() return tf.convert_to_tensor(value.tensor, dtype=dtype, name=name)
[ "def", "tensor_conversion", "(", "value", ",", "dtype", "=", "None", ",", "name", "=", "None", ",", "as_ref", "=", "False", ")", ":", "if", "as_ref", ":", "raise", "NotImplemented", "(", ")", "return", "tf", ".", "convert_to_tensor", "(", "value", ".", ...
tensorflow tensor conversion function.
[ "tensorflow", "tensor", "conversion", "function", "." ]
[ "\"\"\"\n tensorflow tensor conversion function. Simply gives to tensorflow the underlying tensor\n\n :param value:\n :param dtype:\n :param name:\n :param as_ref:\n :return:\n \"\"\"" ]
[ { "param": "value", "type": null }, { "param": "dtype", "type": null }, { "param": "name", "type": null }, { "param": "as_ref", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "value", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, ...
9c8008c20627f33dd160e3c0a4c9dac9353bd05d
lucfra/RFHO
rfho/examples/common.py
[ "MIT" ]
Python
standard_plotter
<not_specific>
def standard_plotter(**plot_kwargs): """ This is a standard plotter that would do for most of the occasions, when there are stream dict are matrices of values that represents scalar measures. If the relative stream_dict has more than one key then standard_plotter will automatically add a legend. :r...
This is a standard plotter that would do for most of the occasions, when there are stream dict are matrices of values that represents scalar measures. If the relative stream_dict has more than one key then standard_plotter will automatically add a legend. :return: A callable, internally called by inst...
This is a standard plotter that would do for most of the occasions, when there are stream dict are matrices of values that represents scalar measures. If the relative stream_dict has more than one key then standard_plotter will automatically add a legend.
[ "This", "is", "a", "standard", "plotter", "that", "would", "do", "for", "most", "of", "the", "occasions", "when", "there", "are", "stream", "dict", "are", "matrices", "of", "values", "that", "represents", "scalar", "measures", ".", "If", "the", "relative", ...
def standard_plotter(**plot_kwargs): def intern(ax, stream_dict, **kwargs): ax.clear() [ax.plot(v, label=k, **merge_dicts(kwargs, plot_kwargs)) for k, v in stream_dict.items()] if len(stream_dict) > 2: ax.legend(loc=0) return intern
[ "def", "standard_plotter", "(", "**", "plot_kwargs", ")", ":", "def", "intern", "(", "ax", ",", "stream_dict", ",", "**", "kwargs", ")", ":", "ax", ".", "clear", "(", ")", "[", "ax", ".", "plot", "(", "v", ",", "label", "=", "k", ",", "**", "merg...
This is a standard plotter that would do for most of the occasions, when there are stream dict are matrices of values that represents scalar measures.
[ "This", "is", "a", "standard", "plotter", "that", "would", "do", "for", "most", "of", "the", "occasions", "when", "there", "are", "stream", "dict", "are", "matrices", "of", "values", "that", "represents", "scalar", "measures", "." ]
[ "\"\"\"\n This is a standard plotter that would do for most of the occasions, when there are stream dict are\n matrices of values that represents scalar measures. If the relative stream_dict has more than one key\n then standard_plotter will automatically add a legend.\n\n :return: A callable, internall...
[]
{ "returns": [ { "docstring": "A callable, internally called by instances of OnlinePlotStream", "docstring_tokens": [ "A", "callable", "internally", "called", "by", "instances", "of", "OnlinePlotStream" ], "type": null } ...
9c8008c20627f33dd160e3c0a4c9dac9353bd05d
lucfra/RFHO
rfho/examples/common.py
[ "MIT" ]
Python
scalar_value_gradient_plotter
<not_specific>
def scalar_value_gradient_plotter(value_color, gradient_color, value_kwargs=None, grad_kwargs=None): """ This is a plotter thought for stream_dict that contains hyperparameters values and hyper-gradients. Will plot these two scalar sequences on different scales. :param grad_kwargs: :param value_kwa...
This is a plotter thought for stream_dict that contains hyperparameters values and hyper-gradients. Will plot these two scalar sequences on different scales. :param grad_kwargs: :param value_kwargs: :param value_color: :param gradient_color: :return:
This is a plotter thought for stream_dict that contains hyperparameters values and hyper-gradients. Will plot these two scalar sequences on different scales.
[ "This", "is", "a", "plotter", "thought", "for", "stream_dict", "that", "contains", "hyperparameters", "values", "and", "hyper", "-", "gradients", ".", "Will", "plot", "these", "two", "scalar", "sequences", "on", "different", "scales", "." ]
def scalar_value_gradient_plotter(value_color, gradient_color, value_kwargs=None, grad_kwargs=None): value_kwargs = value_kwargs or {} grad_kwargs = grad_kwargs or {} ax2 = None def intern(ax, stream_dict, **kwargs): nonlocal ax2 ax.clear() if ax2 is None: ax2 = ax.tw...
[ "def", "scalar_value_gradient_plotter", "(", "value_color", ",", "gradient_color", ",", "value_kwargs", "=", "None", ",", "grad_kwargs", "=", "None", ")", ":", "value_kwargs", "=", "value_kwargs", "or", "{", "}", "grad_kwargs", "=", "grad_kwargs", "or", "{", "}"...
This is a plotter thought for stream_dict that contains hyperparameters values and hyper-gradients.
[ "This", "is", "a", "plotter", "thought", "for", "stream_dict", "that", "contains", "hyperparameters", "values", "and", "hyper", "-", "gradients", "." ]
[ "\"\"\"\n This is a plotter thought for stream_dict that contains hyperparameters values and hyper-gradients.\n Will plot these two scalar sequences on different scales.\n\n :param grad_kwargs:\n :param value_kwargs:\n :param value_color:\n :param gradient_color:\n :return:\n \"\"\"" ]
[ { "param": "value_color", "type": null }, { "param": "gradient_color", "type": null }, { "param": "value_kwargs", "type": null }, { "param": "grad_kwargs", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "value_color", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null,...
8041cb399d65bfef7bf6b4e45ff00acffdfe88ea
LouisMeMyself/SherpaBot
sherpaBot/SherpaBot.py
[ "MIT" ]
Python
sherpapic
<not_specific>
async def sherpapic(self, ctx): """command for personalised profile picture, input a color (RGB or HEX) output a reply with the profile picture""" if ctx.message.guild.id in self.channels.profile_picture and ctx.message.channel.id == self.channels.profile_picture[ctx.message.guild.id].id: an...
command for personalised profile picture, input a color (RGB or HEX) output a reply with the profile picture
command for personalised profile picture, input a color (RGB or HEX) output a reply with the profile picture
[ "command", "for", "personalised", "profile", "picture", "input", "a", "color", "(", "RGB", "or", "HEX", ")", "output", "a", "reply", "with", "the", "profile", "picture" ]
async def sherpapic(self, ctx): if ctx.message.guild.id in self.channels.profile_picture and ctx.message.channel.id == self.channels.profile_picture[ctx.message.guild.id].id: answer = self.sherpaPic_.do_profile_picture(ctx.message.content) if len(answer) == 2: await ctx.r...
[ "async", "def", "sherpapic", "(", "self", ",", "ctx", ")", ":", "if", "ctx", ".", "message", ".", "guild", ".", "id", "in", "self", ".", "channels", ".", "profile_picture", "and", "ctx", ".", "message", ".", "channel", ".", "id", "==", "self", ".", ...
command for personalised profile picture, input a color (RGB or HEX) output a reply with the profile picture
[ "command", "for", "personalised", "profile", "picture", "input", "a", "color", "(", "RGB", "or", "HEX", ")", "output", "a", "reply", "with", "the", "profile", "picture" ]
[ "\"\"\"command for personalised profile picture, input a color (RGB or HEX) output a reply with the profile picture\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "ctx", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": []...
8041cb399d65bfef7bf6b4e45ff00acffdfe88ea
LouisMeMyself/SherpaBot
sherpaBot/SherpaBot.py
[ "MIT" ]
Python
on_raw_reaction_add
<not_specific>
async def on_raw_reaction_add(self, payload): """Add sherpa role when a reaction is added on a particular message (not a message from sherpabot or a reaction of sherpabot) """ if payload.user_id == self.bot.user.id or payload.message_id == self.bot.user.id: # check if user that reacted is not s...
Add sherpa role when a reaction is added on a particular message (not a message from sherpabot or a reaction of sherpabot)
Add sherpa role when a reaction is added on a particular message (not a message from sherpabot or a reaction of sherpabot)
[ "Add", "sherpa", "role", "when", "a", "reaction", "is", "added", "on", "a", "particular", "message", "(", "not", "a", "message", "from", "sherpabot", "or", "a", "reaction", "of", "sherpabot", ")" ]
async def on_raw_reaction_add(self, payload): if payload.user_id == self.bot.user.id or payload.message_id == self.bot.user.id: return if not (payload.guild_id in self.channels.reaction_channel and self.channels.reaction_channel[payload.guild_id].id == payload.channel_id): ...
[ "async", "def", "on_raw_reaction_add", "(", "self", ",", "payload", ")", ":", "if", "payload", ".", "user_id", "==", "self", ".", "bot", ".", "user", ".", "id", "or", "payload", ".", "message_id", "==", "self", ".", "bot", ".", "user", ".", "id", ":"...
Add sherpa role when a reaction is added on a particular message (not a message from sherpabot or a reaction of sherpabot)
[ "Add", "sherpa", "role", "when", "a", "reaction", "is", "added", "on", "a", "particular", "message", "(", "not", "a", "message", "from", "sherpabot", "or", "a", "reaction", "of", "sherpabot", ")" ]
[ "\"\"\"Add sherpa role when a reaction is added on a particular message (not a message from sherpabot or a\n reaction of sherpabot) \"\"\"", "# check if user that reacted is not sherpaBot and that the message isn't from sherpaBot" ]
[ { "param": "self", "type": null }, { "param": "payload", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "payload", "type": null, "docstring": null, "docstring_tokens"...
8041cb399d65bfef7bf6b4e45ff00acffdfe88ea
LouisMeMyself/SherpaBot
sherpaBot/SherpaBot.py
[ "MIT" ]
Python
on_raw_reaction_remove
<not_specific>
async def on_raw_reaction_remove(self, payload): """harder to remove than add a role, to do""" if payload.user_id == self.bot.user.id or payload.message_id == self.bot.user.id: # check if user that reacted is not sherpaBot and that the message isn't from sherpaBot return if not (pay...
harder to remove than add a role, to do
harder to remove than add a role, to do
[ "harder", "to", "remove", "than", "add", "a", "role", "to", "do" ]
async def on_raw_reaction_remove(self, payload): if payload.user_id == self.bot.user.id or payload.message_id == self.bot.user.id: return if not (payload.guild_id in self.channels.reaction_channel and self.channels.reaction_channel[payload.guild_id].id == payload.channel_id...
[ "async", "def", "on_raw_reaction_remove", "(", "self", ",", "payload", ")", ":", "if", "payload", ".", "user_id", "==", "self", ".", "bot", ".", "user", ".", "id", "or", "payload", ".", "message_id", "==", "self", ".", "bot", ".", "user", ".", "id", ...
harder to remove than add a role, to do
[ "harder", "to", "remove", "than", "add", "a", "role", "to", "do" ]
[ "\"\"\"harder to remove than add a role, to do\"\"\"", "# check if user that reacted is not sherpaBot and that the message isn't from sherpaBot" ]
[ { "param": "self", "type": null }, { "param": "payload", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "payload", "type": null, "docstring": null, "docstring_tokens"...
8041cb399d65bfef7bf6b4e45ff00acffdfe88ea
LouisMeMyself/SherpaBot
sherpaBot/SherpaBot.py
[ "MIT" ]
Python
ban
<not_specific>
async def ban(self, ctx, members: commands.Greedy[discord.Member], delete_days: typing.Optional[int] = 0, *, reason: str): """Mass bans members with an optional delete_days parameter, send a message before banning people to be sure it's not a mistake""" if (ctx.channe...
Mass bans members with an optional delete_days parameter, send a message before banning people to be sure it's not a mistake
Mass bans members with an optional delete_days parameter, send a message before banning people to be sure it's not a mistake
[ "Mass", "bans", "members", "with", "an", "optional", "delete_days", "parameter", "send", "a", "message", "before", "banning", "people", "to", "be", "sure", "it", "'", "s", "not", "a", "mistake" ]
async def ban(self, ctx, members: commands.Greedy[discord.Member], delete_days: typing.Optional[int] = 0, *, reason: str): if (ctx.channel.name == Constants.ADMIN_CHANNEL_NAME): accept_decline = await ctx.send( "Do you really want to ban {}".form...
[ "async", "def", "ban", "(", "self", ",", "ctx", ",", "members", ":", "commands", ".", "Greedy", "[", "discord", ".", "Member", "]", ",", "delete_days", ":", "typing", ".", "Optional", "[", "int", "]", "=", "0", ",", "*", ",", "reason", ":", "str", ...
Mass bans members with an optional delete_days parameter, send a message before banning people to be sure it's not a mistake
[ "Mass", "bans", "members", "with", "an", "optional", "delete_days", "parameter", "send", "a", "message", "before", "banning", "people", "to", "be", "sure", "it", "'", "s", "not", "a", "mistake" ]
[ "\"\"\"Mass bans members with an optional delete_days parameter, send a message before banning people to be sure it's not a mistake\"\"\"", "# to change to an id / channel not a name" ]
[ { "param": "self", "type": null }, { "param": "ctx", "type": null }, { "param": "members", "type": "commands.Greedy[discord.Member]" }, { "param": "delete_days", "type": "typing.Optional[int]" }, { "param": "reason", "type": "str" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": []...
d0c993c205cd52674d95a2f017a043113a589139
MwEg777/BEKA-Engine
PowerUps_TestField.py
[ "MIT" ]
Python
generatePowerUp
<not_specific>
def generatePowerUp(t=10, s=0): # Switches """ Switches: if t > 0 then it will check the time, if s is not 0 it will check the score both can be activated at once. """ # ----------Switches Logic------------- if (t > 0) and (s != 0): currentCheck = checkForScore(s) or checkForTime(t) eli...
Switches: if t > 0 then it will check the time, if s is not 0 it will check the score both can be activated at once.
if t > 0 then it will check the time, if s is not 0 it will check the score both can be activated at once.
[ "if", "t", ">", "0", "then", "it", "will", "check", "the", "time", "if", "s", "is", "not", "0", "it", "will", "check", "the", "score", "both", "can", "be", "activated", "at", "once", "." ]
def generatePowerUp(t=10, s=0): if (t > 0) and (s != 0): currentCheck = checkForScore(s) or checkForTime(t) elif t > 0: currentCheck = checkForTime(t) elif s != 0: currentCheck = checkForScore(s) else: currentCheck = False generate = False if currentCheck is Tru...
[ "def", "generatePowerUp", "(", "t", "=", "10", ",", "s", "=", "0", ")", ":", "if", "(", "t", ">", "0", ")", "and", "(", "s", "!=", "0", ")", ":", "currentCheck", "=", "checkForScore", "(", "s", ")", "or", "checkForTime", "(", "t", ")", "elif", ...
Switches: if t > 0 then it will check the time, if s is not 0 it will check the score both can be activated at once.
[ "Switches", ":", "if", "t", ">", "0", "then", "it", "will", "check", "the", "time", "if", "s", "is", "not", "0", "it", "will", "check", "the", "score", "both", "can", "be", "activated", "at", "once", "." ]
[ "# Switches", "\"\"\" Switches: if t > 0 then it will check the time, if s is not 0 it will check the score\n both can be activated at once. \"\"\"", "# ----------Switches Logic-------------", "# -------------------------------------", "#print(\"💃💃💃💃💃💃💃💃💃💃💃💃💃💃 powerup successfully gener...
[ { "param": "t", "type": null }, { "param": "s", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "t", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "s", "type": null, "docstring": null, "docstring_tokens": [], ...
f358b41ec607a4f8e1867a6500db9e6e8f83636b
vietlinhtspt/NewFasterRCNN
lib/datasets/display.py
[ "MIT" ]
Python
image_path_from_index
<not_specific>
def image_path_from_index(self, index): """ Construct an image path from the image's "index" identifier. """ file_name = (str(index) + '.png') image_path = osp.join(self._data_path, self._data_name, file_name) assert osp.exists(image_path), \ 'Path does not ex...
Construct an image path from the image's "index" identifier.
Construct an image path from the image's "index" identifier.
[ "Construct", "an", "image", "path", "from", "the", "image", "'", "s", "\"", "index", "\"", "identifier", "." ]
def image_path_from_index(self, index): file_name = (str(index) + '.png') image_path = osp.join(self._data_path, self._data_name, file_name) assert osp.exists(image_path), \ 'Path does not exist: {}'.format(image_path) return image_path
[ "def", "image_path_from_index", "(", "self", ",", "index", ")", ":", "file_name", "=", "(", "str", "(", "index", ")", "+", "'.png'", ")", "image_path", "=", "osp", ".", "join", "(", "self", ".", "_data_path", ",", "self", ".", "_data_name", ",", "file_...
Construct an image path from the image's "index" identifier.
[ "Construct", "an", "image", "path", "from", "the", "image", "'", "s", "\"", "index", "\"", "identifier", "." ]
[ "\"\"\"\n Construct an image path from the image's \"index\" identifier.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "index", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "index", "type": null, "docstring": null, "docstring_tokens": ...
f358b41ec607a4f8e1867a6500db9e6e8f83636b
vietlinhtspt/NewFasterRCNN
lib/datasets/display.py
[ "MIT" ]
Python
gt_roidb
<not_specific>
def gt_roidb(self): """ Return the database of ground-truth regions of interest. This function loads/saves from/to a cache file to speed up future calls. """ cache_file = osp.join(self.cache_path, self.name + '_gt_roidb.pkl') if osp.exists(cache_file): with op...
Return the database of ground-truth regions of interest. This function loads/saves from/to a cache file to speed up future calls.
Return the database of ground-truth regions of interest. This function loads/saves from/to a cache file to speed up future calls.
[ "Return", "the", "database", "of", "ground", "-", "truth", "regions", "of", "interest", ".", "This", "function", "loads", "/", "saves", "from", "/", "to", "a", "cache", "file", "to", "speed", "up", "future", "calls", "." ]
def gt_roidb(self): cache_file = osp.join(self.cache_path, self.name + '_gt_roidb.pkl') if osp.exists(cache_file): with open(cache_file, 'rb') as fid: roidb = pickle.load(fid) print('{} gt roidb loaded from {}'.format(self.name, cache_file)) return roi...
[ "def", "gt_roidb", "(", "self", ")", ":", "cache_file", "=", "osp", ".", "join", "(", "self", ".", "cache_path", ",", "self", ".", "name", "+", "'_gt_roidb.pkl'", ")", "if", "osp", ".", "exists", "(", "cache_file", ")", ":", "with", "open", "(", "cac...
Return the database of ground-truth regions of interest.
[ "Return", "the", "database", "of", "ground", "-", "truth", "regions", "of", "interest", "." ]
[ "\"\"\"\n Return the database of ground-truth regions of interest.\n This function loads/saves from/to a cache file to speed up future calls.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f358b41ec607a4f8e1867a6500db9e6e8f83636b
vietlinhtspt/NewFasterRCNN
lib/datasets/display.py
[ "MIT" ]
Python
_load_display_annotation
<not_specific>
def _load_display_annotation(self, index): """ Loads Display bounding-box instance annotations. Crowd instances are handled by marking their overlaps (with all categories) to -1. This overlap value means that crowd "instances" are excluded from training. """ annotation_f...
Loads Display bounding-box instance annotations. Crowd instances are handled by marking their overlaps (with all categories) to -1. This overlap value means that crowd "instances" are excluded from training.
Loads Display bounding-box instance annotations. Crowd instances are handled by marking their overlaps (with all categories) to -1. This overlap value means that crowd "instances" are excluded from training.
[ "Loads", "Display", "bounding", "-", "box", "instance", "annotations", ".", "Crowd", "instances", "are", "handled", "by", "marking", "their", "overlaps", "(", "with", "all", "categories", ")", "to", "-", "1", ".", "This", "overlap", "value", "means", "that",...
def _load_display_annotation(self, index): annotation_file = os.path.join( self._data_path, 'annotations/instances_{}.txt'.format(self._image_set)) assert os.path.isfile(annotation_file), annotation_file txt_annotations = open(annotation_file, 'r') annotations = txt_annotatio...
[ "def", "_load_display_annotation", "(", "self", ",", "index", ")", ":", "annotation_file", "=", "os", ".", "path", ".", "join", "(", "self", ".", "_data_path", ",", "'annotations/instances_{}.txt'", ".", "format", "(", "self", ".", "_image_set", ")", ")", "a...
Loads Display bounding-box instance annotations.
[ "Loads", "Display", "bounding", "-", "box", "instance", "annotations", "." ]
[ "\"\"\"\n Loads Display bounding-box instance annotations. Crowd instances are\n handled by marking their overlaps (with all categories) to -1. This\n overlap value means that crowd \"instances\" are excluded from training.\n \"\"\"", "# data in ground truth file has 3 line for each im...
[ { "param": "self", "type": null }, { "param": "index", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "index", "type": null, "docstring": null, "docstring_tokens": ...
d37f3999089670551eab038bca31e8396c2b090d
Tofull/gcs_simulator
example/background_cloud_function.py
[ "MIT" ]
Python
demo_background_cloud_function
null
def demo_background_cloud_function(event, context): """ This background cloud function counts the number of letters in a file. A cloud bucket event is expected as input. See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/functions/helloworld/main.py#L89 Returns: None...
This background cloud function counts the number of letters in a file. A cloud bucket event is expected as input. See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/functions/helloworld/main.py#L89 Returns: None; the output is written to Stackdriver Logging
This background cloud function counts the number of letters in a file. A cloud bucket event is expected as input.
[ "This", "background", "cloud", "function", "counts", "the", "number", "of", "letters", "in", "a", "file", ".", "A", "cloud", "bucket", "event", "is", "expected", "as", "input", "." ]
def demo_background_cloud_function(event, context): storage_client = storage.Client() file_name = event["name"] bucket_name = event["bucket"] with tempfile.TemporaryDirectory() as tmpdirname: local_file = Path(tmpdirname) / str(uuid.uuid4().hex) blob = storage_client.bucket(bucket_name)....
[ "def", "demo_background_cloud_function", "(", "event", ",", "context", ")", ":", "storage_client", "=", "storage", ".", "Client", "(", ")", "file_name", "=", "event", "[", "\"name\"", "]", "bucket_name", "=", "event", "[", "\"bucket\"", "]", "with", "tempfile"...
This background cloud function counts the number of letters in a file.
[ "This", "background", "cloud", "function", "counts", "the", "number", "of", "letters", "in", "a", "file", "." ]
[ "\"\"\"\n This background cloud function counts the number of letters in a file.\n A cloud bucket event is expected as input.\n See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/functions/helloworld/main.py#L89\n\n Returns:\n None; the output is written to Stackdriver Log...
[ { "param": "event", "type": null }, { "param": "context", "type": null } ]
{ "returns": [ { "docstring": "None; the output is written to Stackdriver Logging", "docstring_tokens": [ "None", ";", "the", "output", "is", "written", "to", "Stackdriver", "Logging" ], "type": null } ], "rais...
d37f3999089670551eab038bca31e8396c2b090d
Tofull/gcs_simulator
example/background_cloud_function.py
[ "MIT" ]
Python
simulated_cloud_function
null
def simulated_cloud_function(event, context, data_path: Optional[Path] = None): """ This function is a wrapper of the background function. `data_path` allows giving the function any arbitrary folder as "cloud storage bucket simulator". This is useful for pytest and its tmpdir fixture. Its default ...
This function is a wrapper of the background function. `data_path` allows giving the function any arbitrary folder as "cloud storage bucket simulator". This is useful for pytest and its tmpdir fixture. Its default value sets the `data` folder at the root of the repo as the default "cloud storage buck...
This function is a wrapper of the background function. `data_path` allows giving the function any arbitrary folder as "cloud storage bucket simulator". This is useful for pytest and its tmpdir fixture. Its default value sets the `data` folder at the root of the repo as the default "cloud storage bucket simulator".
[ "This", "function", "is", "a", "wrapper", "of", "the", "background", "function", ".", "`", "data_path", "`", "allows", "giving", "the", "function", "any", "arbitrary", "folder", "as", "\"", "cloud", "storage", "bucket", "simulator", "\"", ".", "This", "is", ...
def simulated_cloud_function(event, context, data_path: Optional[Path] = None): if data_path is None: data_path = Path(__file__).parent / ".." / "data" from unittest import mock from gcs_simulator.storage import MockClient root_folder = Path(data_path).absolute().resolve().as_posix() class...
[ "def", "simulated_cloud_function", "(", "event", ",", "context", ",", "data_path", ":", "Optional", "[", "Path", "]", "=", "None", ")", ":", "if", "data_path", "is", "None", ":", "data_path", "=", "Path", "(", "__file__", ")", ".", "parent", "/", "\"..\"...
This function is a wrapper of the background function.
[ "This", "function", "is", "a", "wrapper", "of", "the", "background", "function", "." ]
[ "\"\"\"\n This function is a wrapper of the background function.\n\n `data_path` allows giving the function any arbitrary folder as \"cloud storage bucket simulator\".\n This is useful for pytest and its tmpdir fixture.\n\n Its default value sets the `data` folder at the root of the repo as the default ...
[ { "param": "event", "type": null }, { "param": "context", "type": null }, { "param": "data_path", "type": "Optional[Path]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "event", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "context", "type": null, "docstring": null, "docstring_tokens...
e408832272e21c581864df6a545f15d4d1a970f7
cyware-labs/cic-misp
misp.py
[ "MIT" ]
Python
handler
<not_specific>
def handler(self, method, endpoint, params=None, data=None, **kwargs): """ Method to handle all requests across the class """ try: url = "{0}/{1}".format(self.base_url, endpoint) if method == "GET": response = requests.get(url=url,...
Method to handle all requests across the class
Method to handle all requests across the class
[ "Method", "to", "handle", "all", "requests", "across", "the", "class" ]
def handler(self, method, endpoint, params=None, data=None, **kwargs): try: url = "{0}/{1}".format(self.base_url, endpoint) if method == "GET": response = requests.get(url=url, json=data, params=params, verify=self.verify, headers=self.headers) ...
[ "def", "handler", "(", "self", ",", "method", ",", "endpoint", ",", "params", "=", "None", ",", "data", "=", "None", ",", "**", "kwargs", ")", ":", "try", ":", "url", "=", "\"{0}/{1}\"", ".", "format", "(", "self", ".", "base_url", ",", "endpoint", ...
Method to handle all requests across the class
[ "Method", "to", "handle", "all", "requests", "across", "the", "class" ]
[ "\"\"\"\n Method to handle all requests across the class\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "method", "type": null }, { "param": "endpoint", "type": null }, { "param": "params", "type": null }, { "param": "data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "method", "type": null, "docstring": null, "docstring_tokens":...
e408832272e21c581864df6a545f15d4d1a970f7
cyware-labs/cic-misp
misp.py
[ "MIT" ]
Python
upload_stix
<not_specific>
def upload_stix(self, stix_data, **kwargs): """ Method to upload STIX as a event on MISP :param stix_data: Enter the STIX data onto MISP. Must be a bundle """ endpoint = "events/upload_stix/2" response = self.handler(method="POST", endpoint=endpoint, d...
Method to upload STIX as a event on MISP :param stix_data: Enter the STIX data onto MISP. Must be a bundle
Method to upload STIX as a event on MISP
[ "Method", "to", "upload", "STIX", "as", "a", "event", "on", "MISP" ]
def upload_stix(self, stix_data, **kwargs): endpoint = "events/upload_stix/2" response = self.handler(method="POST", endpoint=endpoint, data=stix_data) return response
[ "def", "upload_stix", "(", "self", ",", "stix_data", ",", "**", "kwargs", ")", ":", "endpoint", "=", "\"events/upload_stix/2\"", "response", "=", "self", ".", "handler", "(", "method", "=", "\"POST\"", ",", "endpoint", "=", "endpoint", ",", "data", "=", "s...
Method to upload STIX as a event on MISP
[ "Method", "to", "upload", "STIX", "as", "a", "event", "on", "MISP" ]
[ "\"\"\"\n Method to upload STIX as a event on MISP\n :param stix_data: Enter the STIX data onto MISP. Must be a bundle\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "stix_data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "stix_data", "type": null, "docstring": "Enter the STIX data onto MI...
d1b8056823d72903806d741d24e0d483ecbcefef
cyware-labs/cic-misp
main.py
[ "MIT" ]
Python
list_taxii_collections
<not_specific>
def list_taxii_collections(taxii_discovery_url: str, taxii_username: str, taxii_password: str): """ This method is used to list all collections in a TAXII server enabled for the user """ try: taxii_object = CyTaxii(discovery_url=taxii_discove...
This method is used to list all collections in a TAXII server enabled for the user
This method is used to list all collections in a TAXII server enabled for the user
[ "This", "method", "is", "used", "to", "list", "all", "collections", "in", "a", "TAXII", "server", "enabled", "for", "the", "user" ]
def list_taxii_collections(taxii_discovery_url: str, taxii_username: str, taxii_password: str): try: taxii_object = CyTaxii(discovery_url=taxii_discovery_url, username=taxii_username, password...
[ "def", "list_taxii_collections", "(", "taxii_discovery_url", ":", "str", ",", "taxii_username", ":", "str", ",", "taxii_password", ":", "str", ")", ":", "try", ":", "taxii_object", "=", "CyTaxii", "(", "discovery_url", "=", "taxii_discovery_url", ",", "username", ...
This method is used to list all collections in a TAXII server enabled for the user
[ "This", "method", "is", "used", "to", "list", "all", "collections", "in", "a", "TAXII", "server", "enabled", "for", "the", "user" ]
[ "\"\"\"\n This method is used to list all collections in a TAXII server enabled for the user\n \"\"\"" ]
[ { "param": "taxii_discovery_url", "type": "str" }, { "param": "taxii_username", "type": "str" }, { "param": "taxii_password", "type": "str" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "taxii_discovery_url", "type": "str", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "taxii_username", "type": "str", "docstring": null, ...
d1b8056823d72903806d741d24e0d483ecbcefef
cyware-labs/cic-misp
main.py
[ "MIT" ]
Python
poll_indicators_from_ctix
<not_specific>
def poll_indicators_from_ctix(taxii_discovery_url: str, taxii_username: str, taxii_password: str, taxii_collection_id: str, from_date: str, misp_url: str, ...
This method is used to poll indicators from CTIX, package these indicators into a report, and push those packaged indicator to MISP :param taxii_discovery_url: Enter the TAXII discovery URL to connect to :param taxii_username: Enter the TAXII username to authenticate with :param taxii_password: E...
This method is used to poll indicators from CTIX, package these indicators into a report, and push those packaged indicator to MISP
[ "This", "method", "is", "used", "to", "poll", "indicators", "from", "CTIX", "package", "these", "indicators", "into", "a", "report", "and", "push", "those", "packaged", "indicator", "to", "MISP" ]
def poll_indicators_from_ctix(taxii_discovery_url: str, taxii_username: str, taxii_password: str, taxii_collection_id: str, from_date: str, misp_url: str, ...
[ "def", "poll_indicators_from_ctix", "(", "taxii_discovery_url", ":", "str", ",", "taxii_username", ":", "str", ",", "taxii_password", ":", "str", ",", "taxii_collection_id", ":", "str", ",", "from_date", ":", "str", ",", "misp_url", ":", "str", ",", "misp_api_ke...
This method is used to poll indicators from CTIX, package these indicators into a report, and push those packaged indicator to MISP
[ "This", "method", "is", "used", "to", "poll", "indicators", "from", "CTIX", "package", "these", "indicators", "into", "a", "report", "and", "push", "those", "packaged", "indicator", "to", "MISP" ]
[ "\"\"\"\n This method is used to poll indicators from CTIX, package these indicators into a report,\n and push those packaged indicator to MISP\n\n :param taxii_discovery_url: Enter the TAXII discovery URL to connect to\n :param taxii_username: Enter the TAXII username to authenticate with\n :param ...
[ { "param": "taxii_discovery_url", "type": "str" }, { "param": "taxii_username", "type": "str" }, { "param": "taxii_password", "type": "str" }, { "param": "taxii_collection_id", "type": "str" }, { "param": "from_date", "type": "str" }, { "param": "misp_...
{ "returns": [ { "docstring": "Collection of MISP responses", "docstring_tokens": [ "Collection", "of", "MISP", "responses" ], "type": null } ], "raises": [], "params": [ { "identifier": "taxii_discovery_url", "type": "str", "...
d1b8056823d72903806d741d24e0d483ecbcefef
cyware-labs/cic-misp
main.py
[ "MIT" ]
Python
poll_reports_from_ctix
<not_specific>
def poll_reports_from_ctix(taxii_discovery_url: str, taxii_username: str, taxii_password: str, taxii_collection_id: str, from_date: str, misp_url: str, misp_...
This method is used to poll reports from CTIX, and push those packaged indicator to MISP :param taxii_discovery_url: Enter the TAXII discovery URL to connect to :param taxii_username: Enter the TAXII username to authenticate with :param taxii_password: Enter the TAXII password to authenticate with ...
This method is used to poll reports from CTIX, and push those packaged indicator to MISP
[ "This", "method", "is", "used", "to", "poll", "reports", "from", "CTIX", "and", "push", "those", "packaged", "indicator", "to", "MISP" ]
def poll_reports_from_ctix(taxii_discovery_url: str, taxii_username: str, taxii_password: str, taxii_collection_id: str, from_date: str, misp_url: str, misp_a...
[ "def", "poll_reports_from_ctix", "(", "taxii_discovery_url", ":", "str", ",", "taxii_username", ":", "str", ",", "taxii_password", ":", "str", ",", "taxii_collection_id", ":", "str", ",", "from_date", ":", "str", ",", "misp_url", ":", "str", ",", "misp_api_key",...
This method is used to poll reports from CTIX, and push those packaged indicator to MISP
[ "This", "method", "is", "used", "to", "poll", "reports", "from", "CTIX", "and", "push", "those", "packaged", "indicator", "to", "MISP" ]
[ "\"\"\"\n This method is used to poll reports from CTIX, and push those packaged indicator to MISP\n\n :param taxii_discovery_url: Enter the TAXII discovery URL to connect to\n :param taxii_username: Enter the TAXII username to authenticate with\n :param taxii_password: Enter the TAXII password to auth...
[ { "param": "taxii_discovery_url", "type": "str" }, { "param": "taxii_username", "type": "str" }, { "param": "taxii_password", "type": "str" }, { "param": "taxii_collection_id", "type": "str" }, { "param": "from_date", "type": "str" }, { "param": "misp_...
{ "returns": [ { "docstring": "Collection of MISP responses", "docstring_tokens": [ "Collection", "of", "MISP", "responses" ], "type": null } ], "raises": [], "params": [ { "identifier": "taxii_discovery_url", "type": "str", "...
042ac5179ea441e3b2f03fa1328c9d18880eb151
cyware-labs/cic-misp
cytaxii.py
[ "MIT" ]
Python
request_handler
<not_specific>
def request_handler(self, method, url, json_data=None, query_params=None): """ This method is used to handle all TAXII requests :param query_params: Any query params to pass :param method: Enter the HTTP method to use :param url: Enter the URL to make the request to :para...
This method is used to handle all TAXII requests :param query_params: Any query params to pass :param method: Enter the HTTP method to use :param url: Enter the URL to make the request to :param json_data: Enter the json data to pass as a payload
This method is used to handle all TAXII requests
[ "This", "method", "is", "used", "to", "handle", "all", "TAXII", "requests" ]
def request_handler(self, method, url, json_data=None, query_params=None): try: if method == 'GET': response = requests.get(url=url, data=json_data, headers=self.headers, auth=self.auth, params=query_params) elif method == 'POST': ...
[ "def", "request_handler", "(", "self", ",", "method", ",", "url", ",", "json_data", "=", "None", ",", "query_params", "=", "None", ")", ":", "try", ":", "if", "method", "==", "'GET'", ":", "response", "=", "requests", ".", "get", "(", "url", "=", "ur...
This method is used to handle all TAXII requests
[ "This", "method", "is", "used", "to", "handle", "all", "TAXII", "requests" ]
[ "\"\"\"\n This method is used to handle all TAXII requests\n :param query_params: Any query params to pass\n :param method: Enter the HTTP method to use\n :param url: Enter the URL to make the request to\n :param json_data: Enter the json data to pass as a payload\n \"\"\""...
[ { "param": "self", "type": null }, { "param": "method", "type": null }, { "param": "url", "type": null }, { "param": "json_data", "type": null }, { "param": "query_params", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "method", "type": null, "docstring": "Enter the HTTP method to use",...
042ac5179ea441e3b2f03fa1328c9d18880eb151
cyware-labs/cic-misp
cytaxii.py
[ "MIT" ]
Python
discovery_request
<not_specific>
def discovery_request(self): """ This method is used to make a request to the TAXII discovery URL """ response = self.request_handler(method='GET', url=self.discovery_url) return response
This method is used to make a request to the TAXII discovery URL
This method is used to make a request to the TAXII discovery URL
[ "This", "method", "is", "used", "to", "make", "a", "request", "to", "the", "TAXII", "discovery", "URL" ]
def discovery_request(self): response = self.request_handler(method='GET', url=self.discovery_url) return response
[ "def", "discovery_request", "(", "self", ")", ":", "response", "=", "self", ".", "request_handler", "(", "method", "=", "'GET'", ",", "url", "=", "self", ".", "discovery_url", ")", "return", "response" ]
This method is used to make a request to the TAXII discovery URL
[ "This", "method", "is", "used", "to", "make", "a", "request", "to", "the", "TAXII", "discovery", "URL" ]
[ "\"\"\"\n This method is used to make a request to the TAXII discovery URL\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
042ac5179ea441e3b2f03fa1328c9d18880eb151
cyware-labs/cic-misp
cytaxii.py
[ "MIT" ]
Python
poll_request
<not_specific>
def poll_request(self, collection_id, added_after=None, object_id=None, object_type=None, start_range=None, end_range=None): """ This method is used to poll data from a particular collection :param object_type: Enter the indicator type to retrieve :param start_range:...
This method is used to poll data from a particular collection :param object_type: Enter the indicator type to retrieve :param start_range: Enter the start range of items to receive. 0 based :param object_id: Enter a specific object to retrieve :param end_range: Enter the end ran...
This method is used to poll data from a particular collection
[ "This", "method", "is", "used", "to", "poll", "data", "from", "a", "particular", "collection" ]
def poll_request(self, collection_id, added_after=None, object_id=None, object_type=None, start_range=None, end_range=None): if not start_range: start_range = 0 if not end_range: end_range = 100 range = "items {0}-{1}".format(start_range, end_range) ...
[ "def", "poll_request", "(", "self", ",", "collection_id", ",", "added_after", "=", "None", ",", "object_id", "=", "None", ",", "object_type", "=", "None", ",", "start_range", "=", "None", ",", "end_range", "=", "None", ")", ":", "if", "not", "start_range",...
This method is used to poll data from a particular collection
[ "This", "method", "is", "used", "to", "poll", "data", "from", "a", "particular", "collection" ]
[ "\"\"\"\n This method is used to poll data from a particular collection\n :param object_type: Enter the indicator type to retrieve\n :param start_range: Enter the start range of items to receive. 0 based\n :param object_id: Enter a specific object to retrieve\n :param end_range: E...
[ { "param": "self", "type": null }, { "param": "collection_id", "type": null }, { "param": "added_after", "type": null }, { "param": "object_id", "type": null }, { "param": "object_type", "type": null }, { "param": "start_range", "type": null }, ...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "collection_id", "type": null, "docstring": "Enter the collection ID...
4ac6016ef154b101973322a82e7c6a190ab010f7
SimonLarsen/python-endktheme
endktheme/colors.py
[ "MIT" ]
Python
excel
List[str]
def excel() -> List[str]: """Excel color scheme. Use this for plot aesthetics.""" return [ "#09505D", "#00A58D", "#FFD424", "#83CCD8", "#008A8B", "#F8AE3C", "#A0C1C2", "#9FCD91", "#CC493E", ]
Excel color scheme. Use this for plot aesthetics.
Excel color scheme. Use this for plot aesthetics.
[ "Excel", "color", "scheme", ".", "Use", "this", "for", "plot", "aesthetics", "." ]
def excel() -> List[str]: return [ "#09505D", "#00A58D", "#FFD424", "#83CCD8", "#008A8B", "#F8AE3C", "#A0C1C2", "#9FCD91", "#CC493E", ]
[ "def", "excel", "(", ")", "->", "List", "[", "str", "]", ":", "return", "[", "\"#09505D\"", ",", "\"#00A58D\"", ",", "\"#FFD424\"", ",", "\"#83CCD8\"", ",", "\"#008A8B\"", ",", "\"#F8AE3C\"", ",", "\"#A0C1C2\"", ",", "\"#9FCD91\"", ",", "\"#CC493E\"", ",", ...
Excel color scheme.
[ "Excel", "color", "scheme", "." ]
[ "\"\"\"Excel color scheme. Use this for plot aesthetics.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
7a079b3752ab84e6d43b30e20338dc0c8fb1a041
SimonLarsen/python-endktheme
endktheme/plotnine.py
[ "MIT" ]
Python
theme_energinet
p9.themes.theme
def theme_energinet() -> p9.themes.theme: """Create a simple Energinet theme.""" return p9.theme( text=p9.element_text(family=endktheme.style.font_family()), axis_line=p9.element_line(color="black"), plot_background=p9.element_blank(), panel_background=p9.element_rect(fill="white...
Create a simple Energinet theme.
Create a simple Energinet theme.
[ "Create", "a", "simple", "Energinet", "theme", "." ]
def theme_energinet() -> p9.themes.theme: return p9.theme( text=p9.element_text(family=endktheme.style.font_family()), axis_line=p9.element_line(color="black"), plot_background=p9.element_blank(), panel_background=p9.element_rect(fill="white"), legend_background=p9.element_re...
[ "def", "theme_energinet", "(", ")", "->", "p9", ".", "themes", ".", "theme", ":", "return", "p9", ".", "theme", "(", "text", "=", "p9", ".", "element_text", "(", "family", "=", "endktheme", ".", "style", ".", "font_family", "(", ")", ")", ",", "axis_...
Create a simple Energinet theme.
[ "Create", "a", "simple", "Energinet", "theme", "." ]
[ "\"\"\"Create a simple Energinet theme.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
7a079b3752ab84e6d43b30e20338dc0c8fb1a041
SimonLarsen/python-endktheme
endktheme/plotnine.py
[ "MIT" ]
Python
scale_fill_gradient_energinet
p9.scale_fill_gradient
def scale_fill_gradient_energinet( low: int = 0, high: int = 2, **kwargs ) -> p9.scale_fill_gradient: """ Create a two-point fill gradient. Parameters: low (int): Index of low color. high (int): Index of high color. """ pal = endktheme.colors.excel() return p9.scale_fill_gra...
Create a two-point fill gradient. Parameters: low (int): Index of low color. high (int): Index of high color.
Create a two-point fill gradient.
[ "Create", "a", "two", "-", "point", "fill", "gradient", "." ]
def scale_fill_gradient_energinet( low: int = 0, high: int = 2, **kwargs ) -> p9.scale_fill_gradient: pal = endktheme.colors.excel() return p9.scale_fill_gradient(low=pal[low], high=pal[high], **kwargs)
[ "def", "scale_fill_gradient_energinet", "(", "low", ":", "int", "=", "0", ",", "high", ":", "int", "=", "2", ",", "**", "kwargs", ")", "->", "p9", ".", "scale_fill_gradient", ":", "pal", "=", "endktheme", ".", "colors", ".", "excel", "(", ")", "return"...
Create a two-point fill gradient.
[ "Create", "a", "two", "-", "point", "fill", "gradient", "." ]
[ "\"\"\"\n Create a two-point fill gradient.\n\n Parameters:\n low (int): Index of low color.\n high (int): Index of high color.\n \"\"\"" ]
[ { "param": "low", "type": "int" }, { "param": "high", "type": "int" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "low", "type": "int", "docstring": "Index of low color.", "docstring_tokens": [ "Index", "of", "low", "color", "." ], "default": null, "is_optional": false }, { ...
7a079b3752ab84e6d43b30e20338dc0c8fb1a041
SimonLarsen/python-endktheme
endktheme/plotnine.py
[ "MIT" ]
Python
scale_color_gradient_energinet
p9.scale_color_gradient
def scale_color_gradient_energinet( low: int = 0, high: int = 2, **kwargs ) -> p9.scale_color_gradient: """ Create a two-point color gradient. Parameters: low (int): Index of low color. high (int): Index of high color. """ pal = endktheme.colors.excel() return p9.scale_color...
Create a two-point color gradient. Parameters: low (int): Index of low color. high (int): Index of high color.
Create a two-point color gradient.
[ "Create", "a", "two", "-", "point", "color", "gradient", "." ]
def scale_color_gradient_energinet( low: int = 0, high: int = 2, **kwargs ) -> p9.scale_color_gradient: pal = endktheme.colors.excel() return p9.scale_color_gradient(low=pal[low], high=pal[high], **kwargs)
[ "def", "scale_color_gradient_energinet", "(", "low", ":", "int", "=", "0", ",", "high", ":", "int", "=", "2", ",", "**", "kwargs", ")", "->", "p9", ".", "scale_color_gradient", ":", "pal", "=", "endktheme", ".", "colors", ".", "excel", "(", ")", "retur...
Create a two-point color gradient.
[ "Create", "a", "two", "-", "point", "color", "gradient", "." ]
[ "\"\"\"\n Create a two-point color gradient.\n\n Parameters:\n low (int): Index of low color.\n high (int): Index of high color.\n \"\"\"" ]
[ { "param": "low", "type": "int" }, { "param": "high", "type": "int" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "low", "type": "int", "docstring": "Index of low color.", "docstring_tokens": [ "Index", "of", "low", "color", "." ], "default": null, "is_optional": false }, { ...
7a079b3752ab84e6d43b30e20338dc0c8fb1a041
SimonLarsen/python-endktheme
endktheme/plotnine.py
[ "MIT" ]
Python
scale_fill_gradient2_energinet
p9.scale_fill_gradient2
def scale_fill_gradient2_energinet( low: int = 0, mid: int = 1, high: int = 2, **kwargs ) -> p9.scale_fill_gradient2: """ Create a three-point fill gradient. Parameters: low (int): Index of low color. mid (int): Index of middle color. high (int): Index of high color. """ ...
Create a three-point fill gradient. Parameters: low (int): Index of low color. mid (int): Index of middle color. high (int): Index of high color.
Create a three-point fill gradient.
[ "Create", "a", "three", "-", "point", "fill", "gradient", "." ]
def scale_fill_gradient2_energinet( low: int = 0, mid: int = 1, high: int = 2, **kwargs ) -> p9.scale_fill_gradient2: pal = endktheme.colors.excel() return p9.scale_fill_gradient2( low=pal[low], mid=pal[mid], high=pal[high], **kwargs )
[ "def", "scale_fill_gradient2_energinet", "(", "low", ":", "int", "=", "0", ",", "mid", ":", "int", "=", "1", ",", "high", ":", "int", "=", "2", ",", "**", "kwargs", ")", "->", "p9", ".", "scale_fill_gradient2", ":", "pal", "=", "endktheme", ".", "col...
Create a three-point fill gradient.
[ "Create", "a", "three", "-", "point", "fill", "gradient", "." ]
[ "\"\"\"\n Create a three-point fill gradient.\n\n Parameters:\n low (int): Index of low color.\n mid (int): Index of middle color.\n high (int): Index of high color.\n \"\"\"" ]
[ { "param": "low", "type": "int" }, { "param": "mid", "type": "int" }, { "param": "high", "type": "int" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "low", "type": "int", "docstring": "Index of low color.", "docstring_tokens": [ "Index", "of", "low", "color", "." ], "default": null, "is_optional": false }, { ...
7a079b3752ab84e6d43b30e20338dc0c8fb1a041
SimonLarsen/python-endktheme
endktheme/plotnine.py
[ "MIT" ]
Python
scale_color_gradient2_energinet
p9.scale_color_gradient2
def scale_color_gradient2_energinet( low: int = 0, mid: int = 1, high: int = 2, **kwargs ) -> p9.scale_color_gradient2: """ Create a three-point color gradient. Parameters: low (int): Index of low color. mid (int): Index of middle color. high (int): Index of high color. """ ...
Create a three-point color gradient. Parameters: low (int): Index of low color. mid (int): Index of middle color. high (int): Index of high color.
Create a three-point color gradient.
[ "Create", "a", "three", "-", "point", "color", "gradient", "." ]
def scale_color_gradient2_energinet( low: int = 0, mid: int = 1, high: int = 2, **kwargs ) -> p9.scale_color_gradient2: pal = endktheme.colors.excel() return p9.scale_color_gradient2( low=pal[low], mid=pal[mid], high=pal[high], **kwargs )
[ "def", "scale_color_gradient2_energinet", "(", "low", ":", "int", "=", "0", ",", "mid", ":", "int", "=", "1", ",", "high", ":", "int", "=", "2", ",", "**", "kwargs", ")", "->", "p9", ".", "scale_color_gradient2", ":", "pal", "=", "endktheme", ".", "c...
Create a three-point color gradient.
[ "Create", "a", "three", "-", "point", "color", "gradient", "." ]
[ "\"\"\"\n Create a three-point color gradient.\n\n Parameters:\n low (int): Index of low color.\n mid (int): Index of middle color.\n high (int): Index of high color.\n \"\"\"" ]
[ { "param": "low", "type": "int" }, { "param": "mid", "type": "int" }, { "param": "high", "type": "int" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "low", "type": "int", "docstring": "Index of low color.", "docstring_tokens": [ "Index", "of", "low", "color", "." ], "default": null, "is_optional": false }, { ...
897affd6b99e404c72332b81c64d553ca5d899e9
eyalbetzalel/pytorch-generative-v6
pytorch_generative/trainer.py
[ "MIT" ]
Python
load_from_checkpoint
null
def load_from_checkpoint(self): """Attempts to load Trainer state from the internal log_dir.""" self._model.load_state_dict(torch.load(self._path(self.hp_str + "_model_state"))) self._optimizer.load_state_dict(torch.load(self._path(self.hp_str + "_optimizer_state"))) if self._lr_schedule...
Attempts to load Trainer state from the internal log_dir.
Attempts to load Trainer state from the internal log_dir.
[ "Attempts", "to", "load", "Trainer", "state", "from", "the", "internal", "log_dir", "." ]
def load_from_checkpoint(self): self._model.load_state_dict(torch.load(self._path(self.hp_str + "_model_state"))) self._optimizer.load_state_dict(torch.load(self._path(self.hp_str + "_optimizer_state"))) if self._lr_scheduler is not None: self._lr_scheduler.load_state_dict( ...
[ "def", "load_from_checkpoint", "(", "self", ")", ":", "self", ".", "_model", ".", "load_state_dict", "(", "torch", ".", "load", "(", "self", ".", "_path", "(", "self", ".", "hp_str", "+", "\"_model_state\"", ")", ")", ")", "self", ".", "_optimizer", ".",...
Attempts to load Trainer state from the internal log_dir.
[ "Attempts", "to", "load", "Trainer", "state", "from", "the", "internal", "log_dir", "." ]
[ "\"\"\"Attempts to load Trainer state from the internal log_dir.\"\"\"", "# NOTE(eugenhotaj): We need to replace the SummaryWriter and ensure any", "# logs written after the last saved checkpoint are purged." ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
897affd6b99e404c72332b81c64d553ca5d899e9
eyalbetzalel/pytorch-generative-v6
pytorch_generative/trainer.py
[ "MIT" ]
Python
train_one_batch
<not_specific>
def train_one_batch(self, x, y): """Trains the model on a single batch of examples. Subclasses can override this method to define custom training loops. """ preds = self._model(x) loss = self._loss_fn(x, y, preds) return loss
Trains the model on a single batch of examples. Subclasses can override this method to define custom training loops.
Trains the model on a single batch of examples. Subclasses can override this method to define custom training loops.
[ "Trains", "the", "model", "on", "a", "single", "batch", "of", "examples", ".", "Subclasses", "can", "override", "this", "method", "to", "define", "custom", "training", "loops", "." ]
def train_one_batch(self, x, y): preds = self._model(x) loss = self._loss_fn(x, y, preds) return loss
[ "def", "train_one_batch", "(", "self", ",", "x", ",", "y", ")", ":", "preds", "=", "self", ".", "_model", "(", "x", ")", "loss", "=", "self", ".", "_loss_fn", "(", "x", ",", "y", ",", "preds", ")", "return", "loss" ]
Trains the model on a single batch of examples.
[ "Trains", "the", "model", "on", "a", "single", "batch", "of", "examples", "." ]
[ "\"\"\"Trains the model on a single batch of examples.\n\n Subclasses can override this method to define custom training loops.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "x", "type": null }, { "param": "y", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
897affd6b99e404c72332b81c64d553ca5d899e9
eyalbetzalel/pytorch-generative-v6
pytorch_generative/trainer.py
[ "MIT" ]
Python
eval_one_batch
<not_specific>
def eval_one_batch(self, x, y): """Evaluates the model on a single batch of examples. Subclasses can override this method to define custom evaluation loops. """ preds = self._model(x) loss = self._loss_fn(x, y, preds) return loss
Evaluates the model on a single batch of examples. Subclasses can override this method to define custom evaluation loops.
Evaluates the model on a single batch of examples. Subclasses can override this method to define custom evaluation loops.
[ "Evaluates", "the", "model", "on", "a", "single", "batch", "of", "examples", ".", "Subclasses", "can", "override", "this", "method", "to", "define", "custom", "evaluation", "loops", "." ]
def eval_one_batch(self, x, y): preds = self._model(x) loss = self._loss_fn(x, y, preds) return loss
[ "def", "eval_one_batch", "(", "self", ",", "x", ",", "y", ")", ":", "preds", "=", "self", ".", "_model", "(", "x", ")", "loss", "=", "self", ".", "_loss_fn", "(", "x", ",", "y", ",", "preds", ")", "return", "loss" ]
Evaluates the model on a single batch of examples.
[ "Evaluates", "the", "model", "on", "a", "single", "batch", "of", "examples", "." ]
[ "\"\"\"Evaluates the model on a single batch of examples.\n\n Subclasses can override this method to define custom evaluation loops.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "x", "type": null }, { "param": "y", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
897affd6b99e404c72332b81c64d553ca5d899e9
eyalbetzalel/pytorch-generative-v6
pytorch_generative/trainer.py
[ "MIT" ]
Python
plot_images_grid
null
def plot_images_grid(x: torch.tensor, export_img, title: str = '', nrow=8, padding=2, normalize=True, pad_value=0): """Plot 4D Tensor of images of shape (B x C x H x W) as a grid.""" grid = torchvision.utils.make_grid(x, nrow=nrow, padding=padding, normalize=normali...
Plot 4D Tensor of images of shape (B x C x H x W) as a grid.
Plot 4D Tensor of images of shape (B x C x H x W) as a grid.
[ "Plot", "4D", "Tensor", "of", "images", "of", "shape", "(", "B", "x", "C", "x", "H", "x", "W", ")", "as", "a", "grid", "." ]
def plot_images_grid(x: torch.tensor, export_img, title: str = '', nrow=8, padding=2, normalize=True, pad_value=0): grid = torchvision.utils.make_grid(x, nrow=nrow, padding=padding, normalize=normalize, pad_value=pad_value) npgrid = grid.cpu().numpy() im ...
[ "def", "plot_images_grid", "(", "x", ":", "torch", ".", "tensor", ",", "export_img", ",", "title", ":", "str", "=", "''", ",", "nrow", "=", "8", ",", "padding", "=", "2", ",", "normalize", "=", "True", ",", "pad_value", "=", "0", ")", ":", "grid", ...
Plot 4D Tensor of images of shape (B x C x H x W) as a grid.
[ "Plot", "4D", "Tensor", "of", "images", "of", "shape", "(", "B", "x", "C", "x", "H", "x", "W", ")", "as", "a", "grid", "." ]
[ "\"\"\"Plot 4D Tensor of images of shape (B x C x H x W) as a grid.\"\"\"" ]
[ { "param": "x", "type": "torch.tensor" }, { "param": "export_img", "type": null }, { "param": "title", "type": "str" }, { "param": "nrow", "type": null }, { "param": "padding", "type": null }, { "param": "normalize", "type": null }, { "para...
{ "returns": [], "raises": [], "params": [ { "identifier": "x", "type": "torch.tensor", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "export_img", "type": null, "docstring": null, "docstri...
897affd6b99e404c72332b81c64d553ca5d899e9
eyalbetzalel/pytorch-generative-v6
pytorch_generative/trainer.py
[ "MIT" ]
Python
interleaved_train_and_eval
null
def interleaved_train_and_eval(self, n_epochs): """Trains and evaluates (after each epoch) for n_epochs.""" if self.evalFlag: self._eval_full_model() else: for epoch in range(n_epochs): start_time = time.time() print("------------------ ...
Trains and evaluates (after each epoch) for n_epochs.
Trains and evaluates (after each epoch) for n_epochs.
[ "Trains", "and", "evaluates", "(", "after", "each", "epoch", ")", "for", "n_epochs", "." ]
def interleaved_train_and_eval(self, n_epochs): if self.evalFlag: self._eval_full_model() else: for epoch in range(n_epochs): start_time = time.time() print("------------------ Epoch = " + str(epoch) + " ------------------") for i, ...
[ "def", "interleaved_train_and_eval", "(", "self", ",", "n_epochs", ")", ":", "if", "self", ".", "evalFlag", ":", "self", ".", "_eval_full_model", "(", ")", "else", ":", "for", "epoch", "in", "range", "(", "n_epochs", ")", ":", "start_time", "=", "time", ...
Trains and evaluates (after each epoch) for n_epochs.
[ "Trains", "and", "evaluates", "(", "after", "each", "epoch", ")", "for", "n_epochs", "." ]
[ "\"\"\"Trains and evaluates (after each epoch) for n_epochs.\"\"\"", "# Train:", "# Evaluate epoch:", "# Sample / Save cp:" ]
[ { "param": "self", "type": null }, { "param": "n_epochs", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "n_epochs", "type": null, "docstring": null, "docstring_tokens...
1d7398392223b405d9d25a41c56480e950c9a1f3
eyalbetzalel/pytorch-generative-v6
pytorch_generative/models/vq_vae.py
[ "MIT" ]
Python
reproduce
<not_specific>
def reproduce( n_epochs=457, batch_size=128, log_dir="/tmp/run", device="cuda", debug_loader=None ): """Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook. ...
Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook. Args: n_epochs: Number of epochs to train for. batch_size: Batch size to use for training and...
Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook.
[ "Training", "script", "with", "defaults", "to", "reproduce", "results", ".", "The", "code", "inside", "this", "function", "is", "self", "contained", "and", "can", "be", "used", "as", "a", "top", "level", "training", "script", "e", ".", "g", ".", "by", "c...
def reproduce( n_epochs=457, batch_size=128, log_dir="/tmp/run", device="cuda", debug_loader=None ): from torch import optim from torch.nn import functional as F from torch.optim import lr_scheduler from torch.utils import data from torchvision import datasets from torchvision import transfo...
[ "def", "reproduce", "(", "n_epochs", "=", "457", ",", "batch_size", "=", "128", ",", "log_dir", "=", "\"/tmp/run\"", ",", "device", "=", "\"cuda\"", ",", "debug_loader", "=", "None", ")", ":", "from", "torch", "import", "optim", "from", "torch", ".", "nn...
Training script with defaults to reproduce results.
[ "Training", "script", "with", "defaults", "to", "reproduce", "results", "." ]
[ "\"\"\"Training script with defaults to reproduce results.\n\n The code inside this function is self contained and can be used as a top level\n training script, e.g. by copy/pasting it into a Jupyter notebook.\n\n Args:\n n_epochs: Number of epochs to train for.\n batch_size: Batch size to us...
[ { "param": "n_epochs", "type": null }, { "param": "batch_size", "type": null }, { "param": "log_dir", "type": null }, { "param": "device", "type": null }, { "param": "debug_loader", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "n_epochs", "type": null, "docstring": "Number of epochs to train for.", "docstring_tokens": [ "Number", "of", "epochs", "to", "train", "for", "." ], "default"...
7ee77668e80553cb87cd22e0bc0312a11b9d9c9f
eyalbetzalel/pytorch-generative-v6
pytorch_generative/models/vq_vae_2.py
[ "MIT" ]
Python
reproduce
<not_specific>
def reproduce( n_epochs=457, batch_size=128, log_dir="/tmp/run", device="cuda", debug_loader=None ): """Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook. ...
Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook. Args: n_epochs: Number of epochs to train for. batch_size: Batch size to use for training and...
Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook.
[ "Training", "script", "with", "defaults", "to", "reproduce", "results", ".", "The", "code", "inside", "this", "function", "is", "self", "contained", "and", "can", "be", "used", "as", "a", "top", "level", "training", "script", "e", ".", "g", ".", "by", "c...
def reproduce( n_epochs=457, batch_size=128, log_dir="/tmp/run", device="cuda", debug_loader=None ): from torch import optim from torch.nn import functional as F from torch.optim import lr_scheduler from torch.utils import data from torchvision import datasets from torchvision import transfo...
[ "def", "reproduce", "(", "n_epochs", "=", "457", ",", "batch_size", "=", "128", ",", "log_dir", "=", "\"/tmp/run\"", ",", "device", "=", "\"cuda\"", ",", "debug_loader", "=", "None", ")", ":", "from", "torch", "import", "optim", "from", "torch", ".", "nn...
Training script with defaults to reproduce results.
[ "Training", "script", "with", "defaults", "to", "reproduce", "results", "." ]
[ "\"\"\"Training script with defaults to reproduce results.\n\n The code inside this function is self contained and can be used as a top level\n training script, e.g. by copy/pasting it into a Jupyter notebook.\n\n Args:\n n_epochs: Number of epochs to train for.\n batch_size: Batch size to us...
[ { "param": "n_epochs", "type": null }, { "param": "batch_size", "type": null }, { "param": "log_dir", "type": null }, { "param": "device", "type": null }, { "param": "debug_loader", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "n_epochs", "type": null, "docstring": "Number of epochs to train for.", "docstring_tokens": [ "Number", "of", "epochs", "to", "train", "for", "." ], "default"...
da9d907c902c507d99c373e4ecc268feb43023ee
eyalbetzalel/pytorch-generative-v6
transformcifar.py
[ "MIT" ]
Python
plot_images_grid
null
def plot_images_grid(x: torch.tensor, export_img, title: str = '', nrow=8, padding=2, normalize=True, pad_value=0): """Plot 4D Tensor of images of shape (B x C x H x W) as a grid.""" grid = torchvision.utils.make_grid(x, nrow=nrow, padding=padding, normalize=normalize, pad_value=pad_value) npgrid = grid.cpu...
Plot 4D Tensor of images of shape (B x C x H x W) as a grid.
Plot 4D Tensor of images of shape (B x C x H x W) as a grid.
[ "Plot", "4D", "Tensor", "of", "images", "of", "shape", "(", "B", "x", "C", "x", "H", "x", "W", ")", "as", "a", "grid", "." ]
def plot_images_grid(x: torch.tensor, export_img, title: str = '', nrow=8, padding=2, normalize=True, pad_value=0): grid = torchvision.utils.make_grid(x, nrow=nrow, padding=padding, normalize=normalize, pad_value=pad_value) npgrid = grid.cpu().numpy() im = np.transpose(npgrid, (1, 2, 0)) plt.imsave(expo...
[ "def", "plot_images_grid", "(", "x", ":", "torch", ".", "tensor", ",", "export_img", ",", "title", ":", "str", "=", "''", ",", "nrow", "=", "8", ",", "padding", "=", "2", ",", "normalize", "=", "True", ",", "pad_value", "=", "0", ")", ":", "grid", ...
Plot 4D Tensor of images of shape (B x C x H x W) as a grid.
[ "Plot", "4D", "Tensor", "of", "images", "of", "shape", "(", "B", "x", "C", "x", "H", "x", "W", ")", "as", "a", "grid", "." ]
[ "\"\"\"Plot 4D Tensor of images of shape (B x C x H x W) as a grid.\"\"\"" ]
[ { "param": "x", "type": "torch.tensor" }, { "param": "export_img", "type": null }, { "param": "title", "type": "str" }, { "param": "nrow", "type": null }, { "param": "padding", "type": null }, { "param": "normalize", "type": null }, { "para...
{ "returns": [], "raises": [], "params": [ { "identifier": "x", "type": "torch.tensor", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "export_img", "type": null, "docstring": null, "docstri...
a25c1574d24ff3ce005685b4c1af55536554f5a4
eyalbetzalel/pytorch-generative-v6
pytorch_generative/models/base.py
[ "MIT" ]
Python
sample
<not_specific>
def sample(self, out_shape = None, conditioned_on = None): """Generates new samples from the model. Args: out_shape: The expected shape of the sampled output in NCHW format. Should only be provided when 'conditioned_on=None'. conditioned_on: A batch of partial s...
Generates new samples from the model. Args: out_shape: The expected shape of the sampled output in NCHW format. Should only be provided when 'conditioned_on=None'. conditioned_on: A batch of partial samples to condition the generation on. Only dimensions...
Generates new samples from the model.
[ "Generates", "new", "samples", "from", "the", "model", "." ]
def sample(self, out_shape = None, conditioned_on = None): with torch.no_grad(): conditioned_on = self._get_conditioned_on(out_shape, conditioned_on) h, w = conditioned_on.shape n=1 c=1 conditioned_on = conditioned_on.long() for row in rang...
[ "def", "sample", "(", "self", ",", "out_shape", "=", "None", ",", "conditioned_on", "=", "None", ")", ":", "with", "torch", ".", "no_grad", "(", ")", ":", "conditioned_on", "=", "self", ".", "_get_conditioned_on", "(", "out_shape", ",", "conditioned_on", "...
Generates new samples from the model.
[ "Generates", "new", "samples", "from", "the", "model", "." ]
[ "\"\"\"Generates new samples from the model.\n\n Args:\n out_shape: The expected shape of the sampled output in NCHW format. Should\n only be provided when 'conditioned_on=None'.\n conditioned_on: A batch of partial samples to condition the generation on.\n ...
[ { "param": "self", "type": null }, { "param": "out_shape", "type": null }, { "param": "conditioned_on", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "out_shape", "type": null, "docstring": "The expected shape of the s...
bb1a73f411e85f2309a8ecdc279844fa6878fbe0
eyalbetzalel/pytorch-generative-v6
pytorch_generative/models/nade.py
[ "MIT" ]
Python
_forward
<not_specific>
def _forward(self, x): """Computes the forward pass and samples a new output. Returns: (p_hat, x_hat) where p_hat is the probability distribution over dimensions and x_hat is sampled from p_hat. """ # If the input is an image, flatten it during the forward pass. ...
Computes the forward pass and samples a new output. Returns: (p_hat, x_hat) where p_hat is the probability distribution over dimensions and x_hat is sampled from p_hat.
Computes the forward pass and samples a new output.
[ "Computes", "the", "forward", "pass", "and", "samples", "a", "new", "output", "." ]
def _forward(self, x): original_shape = x.shape if len(x.shape) > 2: x = x.view(original_shape[0], -1) in_W, in_b = self.params["in_W"], self.params["in_b"] h_W, h_b = self.params["h_W"], self.params["h_b"] batch_size = 1 if x is None else x.shape[0] p_hat = [...
[ "def", "_forward", "(", "self", ",", "x", ")", ":", "original_shape", "=", "x", ".", "shape", "if", "len", "(", "x", ".", "shape", ")", ">", "2", ":", "x", "=", "x", ".", "view", "(", "original_shape", "[", "0", "]", ",", "-", "1", ")", "in_W...
Computes the forward pass and samples a new output.
[ "Computes", "the", "forward", "pass", "and", "samples", "a", "new", "output", "." ]
[ "\"\"\"Computes the forward pass and samples a new output.\n\n Returns:\n (p_hat, x_hat) where p_hat is the probability distribution over dimensions\n and x_hat is sampled from p_hat.\n \"\"\"", "# If the input is an image, flatten it during the forward pass.", "# Only the bi...
[ { "param": "self", "type": null }, { "param": "x", "type": null } ]
{ "returns": [ { "docstring": "(p_hat, x_hat) where p_hat is the probability distribution over dimensions\nand x_hat is sampled from p_hat.", "docstring_tokens": [ "(", "p_hat", "x_hat", ")", "where", "p_hat", "is", "the", "probab...
bb1a73f411e85f2309a8ecdc279844fa6878fbe0
eyalbetzalel/pytorch-generative-v6
pytorch_generative/models/nade.py
[ "MIT" ]
Python
reproduce
<not_specific>
def reproduce( n_epochs=50, batch_size=512, log_dir="/tmp/run", device="cuda", debug_loader=None ): """Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook. ...
Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook. Args: n_epochs: Number of epochs to train for. batch_size: Batch size to use for training and...
Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook.
[ "Training", "script", "with", "defaults", "to", "reproduce", "results", ".", "The", "code", "inside", "this", "function", "is", "self", "contained", "and", "can", "be", "used", "as", "a", "top", "level", "training", "script", "e", ".", "g", ".", "by", "c...
def reproduce( n_epochs=50, batch_size=512, log_dir="/tmp/run", device="cuda", debug_loader=None ): from torch import optim from torch import distributions from torch.nn import functional as F from torch.optim import lr_scheduler from torch.utils import data from torchvision import datasets ...
[ "def", "reproduce", "(", "n_epochs", "=", "50", ",", "batch_size", "=", "512", ",", "log_dir", "=", "\"/tmp/run\"", ",", "device", "=", "\"cuda\"", ",", "debug_loader", "=", "None", ")", ":", "from", "torch", "import", "optim", "from", "torch", "import", ...
Training script with defaults to reproduce results.
[ "Training", "script", "with", "defaults", "to", "reproduce", "results", "." ]
[ "\"\"\"Training script with defaults to reproduce results.\n\n The code inside this function is self contained and can be used as a top level\n training script, e.g. by copy/pasting it into a Jupyter notebook.\n\n Args:\n n_epochs: Number of epochs to train for.\n batch_size: Batch size to us...
[ { "param": "n_epochs", "type": null }, { "param": "batch_size", "type": null }, { "param": "log_dir", "type": null }, { "param": "device", "type": null }, { "param": "debug_loader", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "n_epochs", "type": null, "docstring": "Number of epochs to train for.", "docstring_tokens": [ "Number", "of", "epochs", "to", "train", "for", "." ], "default"...
2b49d3dc50658016447b6588dd54f8567fdf98a4
eyalbetzalel/pytorch-generative-v6
pytorch_generative/models/pixel_snail.py
[ "MIT" ]
Python
reproduce
<not_specific>
def reproduce(n_epochs=457, batch_size=128, log_dir="/tmp/run", device="cuda", n_channels=1, n_pixel_snail_blocks=1, n_residual_blocks=1, attention_value_channels = 1, attention_key_channels = 1, ...
Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook. Args: n_epochs: Number of epochs to train for. batch_size: Batch size to use for training and...
Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook.
[ "Training", "script", "with", "defaults", "to", "reproduce", "results", ".", "The", "code", "inside", "this", "function", "is", "self", "contained", "and", "can", "be", "used", "as", "a", "top", "level", "training", "script", "e", ".", "g", ".", "by", "c...
def reproduce(n_epochs=457, batch_size=128, log_dir="/tmp/run", device="cuda", n_channels=1, n_pixel_snail_blocks=1, n_residual_blocks=1, attention_value_channels = 1, attention_key_channels = 1, ...
[ "def", "reproduce", "(", "n_epochs", "=", "457", ",", "batch_size", "=", "128", ",", "log_dir", "=", "\"/tmp/run\"", ",", "device", "=", "\"cuda\"", ",", "n_channels", "=", "1", ",", "n_pixel_snail_blocks", "=", "1", ",", "n_residual_blocks", "=", "1", ","...
Training script with defaults to reproduce results.
[ "Training", "script", "with", "defaults", "to", "reproduce", "results", "." ]
[ "\"\"\"Training script with defaults to reproduce results.\n\n The code inside this function is self contained and can be used as a top level\n training script, e.g. by copy/pasting it into a Jupyter notebook.\n\n Args:\n n_epochs: Number of epochs to train for.\n batch_size: Batch size to us...
[ { "param": "n_epochs", "type": null }, { "param": "batch_size", "type": null }, { "param": "log_dir", "type": null }, { "param": "device", "type": null }, { "param": "n_channels", "type": null }, { "param": "n_pixel_snail_blocks", "type": null },...
{ "returns": [], "raises": [], "params": [ { "identifier": "n_epochs", "type": null, "docstring": "Number of epochs to train for.", "docstring_tokens": [ "Number", "of", "epochs", "to", "train", "for", "." ], "default"...
2b6e732b420dfee130e7ebe6c9b1762c96f30fa3
eyalbetzalel/pytorch-generative-v6
pytorch_generative/models/made.py
[ "MIT" ]
Python
reproduce
<not_specific>
def reproduce( n_epochs=427, batch_size=128, log_dir="/tmp/run", device="cuda", debug_loader=None ): """Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook. ...
Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook. Args: n_epochs: Number of epochs to train for. batch_size: Batch size to use for training and...
Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook.
[ "Training", "script", "with", "defaults", "to", "reproduce", "results", ".", "The", "code", "inside", "this", "function", "is", "self", "contained", "and", "can", "be", "used", "as", "a", "top", "level", "training", "script", "e", ".", "g", ".", "by", "c...
def reproduce( n_epochs=427, batch_size=128, log_dir="/tmp/run", device="cuda", debug_loader=None ): from torch import optim from torch import distributions from torch.nn import functional as F from torch.optim import lr_scheduler from torch.utils import data from torchvision import datasets...
[ "def", "reproduce", "(", "n_epochs", "=", "427", ",", "batch_size", "=", "128", ",", "log_dir", "=", "\"/tmp/run\"", ",", "device", "=", "\"cuda\"", ",", "debug_loader", "=", "None", ")", ":", "from", "torch", "import", "optim", "from", "torch", "import", ...
Training script with defaults to reproduce results.
[ "Training", "script", "with", "defaults", "to", "reproduce", "results", "." ]
[ "\"\"\"Training script with defaults to reproduce results.\n\n The code inside this function is self contained and can be used as a top level\n training script, e.g. by copy/pasting it into a Jupyter notebook.\n\n Args:\n n_epochs: Number of epochs to train for.\n batch_size: Batch size to us...
[ { "param": "n_epochs", "type": null }, { "param": "batch_size", "type": null }, { "param": "log_dir", "type": null }, { "param": "device", "type": null }, { "param": "debug_loader", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "n_epochs", "type": null, "docstring": "Number of epochs to train for.", "docstring_tokens": [ "Number", "of", "epochs", "to", "train", "for", "." ], "default"...
a847e9298551a01b813089c22a9a1f082a8916fd
eyalbetzalel/pytorch-generative-v6
pytorch_generative/models/vae.py
[ "MIT" ]
Python
sample
<not_specific>
def sample(self, n_images): """Generates a batch of n_images.""" device = next(self.parameters()).device latents = torch.randn((n_images, self._latent_dim), device=device) return self._decoder(latents)
Generates a batch of n_images.
Generates a batch of n_images.
[ "Generates", "a", "batch", "of", "n_images", "." ]
def sample(self, n_images): device = next(self.parameters()).device latents = torch.randn((n_images, self._latent_dim), device=device) return self._decoder(latents)
[ "def", "sample", "(", "self", ",", "n_images", ")", ":", "device", "=", "next", "(", "self", ".", "parameters", "(", ")", ")", ".", "device", "latents", "=", "torch", ".", "randn", "(", "(", "n_images", ",", "self", ".", "_latent_dim", ")", ",", "d...
Generates a batch of n_images.
[ "Generates", "a", "batch", "of", "n_images", "." ]
[ "\"\"\"Generates a batch of n_images.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "n_images", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "n_images", "type": null, "docstring": null, "docstring_tokens...
a847e9298551a01b813089c22a9a1f082a8916fd
eyalbetzalel/pytorch-generative-v6
pytorch_generative/models/vae.py
[ "MIT" ]
Python
reproduce
<not_specific>
def reproduce( n_epochs=457, batch_size=128, log_dir="/tmp/run", device="cuda", debug_loader=None ): """Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook. ...
Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook. Args: n_epochs: Number of epochs to train for. batch_size: Batch size to use for training and...
Training script with defaults to reproduce results. The code inside this function is self contained and can be used as a top level training script, e.g. by copy/pasting it into a Jupyter notebook.
[ "Training", "script", "with", "defaults", "to", "reproduce", "results", ".", "The", "code", "inside", "this", "function", "is", "self", "contained", "and", "can", "be", "used", "as", "a", "top", "level", "training", "script", "e", ".", "g", ".", "by", "c...
def reproduce( n_epochs=457, batch_size=128, log_dir="/tmp/run", device="cuda", debug_loader=None ): from torch import optim from torch.nn import functional as F from torch.optim import lr_scheduler from torch.utils import data from torchvision import datasets from torchvision import transfo...
[ "def", "reproduce", "(", "n_epochs", "=", "457", ",", "batch_size", "=", "128", ",", "log_dir", "=", "\"/tmp/run\"", ",", "device", "=", "\"cuda\"", ",", "debug_loader", "=", "None", ")", ":", "from", "torch", "import", "optim", "from", "torch", ".", "nn...
Training script with defaults to reproduce results.
[ "Training", "script", "with", "defaults", "to", "reproduce", "results", "." ]
[ "\"\"\"Training script with defaults to reproduce results.\n\n The code inside this function is self contained and can be used as a top level\n training script, e.g. by copy/pasting it into a Jupyter notebook.\n\n Args:\n n_epochs: Number of epochs to train for.\n batch_size: Batch size to us...
[ { "param": "n_epochs", "type": null }, { "param": "batch_size", "type": null }, { "param": "log_dir", "type": null }, { "param": "device", "type": null }, { "param": "debug_loader", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "n_epochs", "type": null, "docstring": "Number of epochs to train for.", "docstring_tokens": [ "Number", "of", "epochs", "to", "train", "for", "." ], "default"...
14ed03c0c8d66ed2f8d50fb4698c502a7c3b200c
justinjoh/analyze-fastq-SW
output_SW.py
[ "MIT" ]
Python
readfastq
<not_specific>
def readfastq(filename): ''' Returns all data from one fastq file''' f = open(filename) entirefastq = f.read() f.close() return entirefastq
Returns all data from one fastq file
Returns all data from one fastq file
[ "Returns", "all", "data", "from", "one", "fastq", "file" ]
def readfastq(filename): f = open(filename) entirefastq = f.read() f.close() return entirefastq
[ "def", "readfastq", "(", "filename", ")", ":", "f", "=", "open", "(", "filename", ")", "entirefastq", "=", "f", ".", "read", "(", ")", "f", ".", "close", "(", ")", "return", "entirefastq" ]
Returns all data from one fastq file
[ "Returns", "all", "data", "from", "one", "fastq", "file" ]
[ "''' Returns all data from one fastq file'''" ]
[ { "param": "filename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filename", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
14ed03c0c8d66ed2f8d50fb4698c502a7c3b200c
justinjoh/analyze-fastq-SW
output_SW.py
[ "MIT" ]
Python
countlines
<not_specific>
def countlines(filename): '''just returns number of lines in data''' with open(filename) as f: num = len(f.readlines()) return(num)
just returns number of lines in data
just returns number of lines in data
[ "just", "returns", "number", "of", "lines", "in", "data" ]
def countlines(filename): with open(filename) as f: num = len(f.readlines()) return(num)
[ "def", "countlines", "(", "filename", ")", ":", "with", "open", "(", "filename", ")", "as", "f", ":", "num", "=", "len", "(", "f", ".", "readlines", "(", ")", ")", "return", "(", "num", ")" ]
just returns number of lines in data
[ "just", "returns", "number", "of", "lines", "in", "data" ]
[ "'''just returns number of lines in data'''" ]
[ { "param": "filename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filename", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
14ed03c0c8d66ed2f8d50fb4698c502a7c3b200c
justinjoh/analyze-fastq-SW
output_SW.py
[ "MIT" ]
Python
createheatmap
<not_specific>
def createheatmap(fileR1, fileR2, maxlinenum): ''' Central function, return numpy "heatmaps" Ensures that files are of same length''' numlines1 = countlines(fileR1); numlines2 = countlines(fileR2) assert numlines1 == numlines2, 'These files are different lengths' vals1, numFaultyCpf1 = getvals(file...
Central function, return numpy "heatmaps" Ensures that files are of same length
Central function, return numpy "heatmaps" Ensures that files are of same length
[ "Central", "function", "return", "numpy", "\"", "heatmaps", "\"", "Ensures", "that", "files", "are", "of", "same", "length" ]
def createheatmap(fileR1, fileR2, maxlinenum): numlines1 = countlines(fileR1); numlines2 = countlines(fileR2) assert numlines1 == numlines2, 'These files are different lengths' vals1, numFaultyCpf1 = getvals(fileR1, maxlinenum, isR2=False) vals2, numFaultycrispr_gate = getvals(fileR2, maxlinenum, isR2=T...
[ "def", "createheatmap", "(", "fileR1", ",", "fileR2", ",", "maxlinenum", ")", ":", "numlines1", "=", "countlines", "(", "fileR1", ")", ";", "numlines2", "=", "countlines", "(", "fileR2", ")", "assert", "numlines1", "==", "numlines2", ",", "'These files are dif...
Central function, return numpy "heatmaps" Ensures that files are of same length
[ "Central", "function", "return", "numpy", "\"", "heatmaps", "\"", "Ensures", "that", "files", "are", "of", "same", "length" ]
[ "''' Central function, return numpy \"heatmaps\"\n Ensures that files are of same length'''", "# Create histogram, heatmap for R1 and show histogram for R1", "\"\"\" plt.hist(declist1, bins=128)\n plt.title(fileR1)\n plt.show()\n\"\"\"", "# Create histogram, heatmap for R2 and show histogram for R2"...
[ { "param": "fileR1", "type": null }, { "param": "fileR2", "type": null }, { "param": "maxlinenum", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "fileR1", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "fileR2", "type": null, "docstring": null, "docstring_tokens...
14ed03c0c8d66ed2f8d50fb4698c502a7c3b200c
justinjoh/analyze-fastq-SW
output_SW.py
[ "MIT" ]
Python
reversecomplement
<not_specific>
def reversecomplement(nucstring): '''Helper method for getvals: input is nucleotide sequence, returns its reverse complement''' bases_dictionary = {'a': 't', 't': 'a', 'c': 'g', 'g': 'c', 'n': 'n'} revcomp = '' try: for pos in reversed(xrange(1, len(nucstring))): revcomp = revcomp + ...
Helper method for getvals: input is nucleotide sequence, returns its reverse complement
Helper method for getvals: input is nucleotide sequence, returns its reverse complement
[ "Helper", "method", "for", "getvals", ":", "input", "is", "nucleotide", "sequence", "returns", "its", "reverse", "complement" ]
def reversecomplement(nucstring): bases_dictionary = {'a': 't', 't': 'a', 'c': 'g', 'g': 'c', 'n': 'n'} revcomp = '' try: for pos in reversed(xrange(1, len(nucstring))): revcomp = revcomp + str((bases_dictionary[nucstring[pos-1].lower()])) return revcomp except Exception as e...
[ "def", "reversecomplement", "(", "nucstring", ")", ":", "bases_dictionary", "=", "{", "'a'", ":", "'t'", ",", "'t'", ":", "'a'", ",", "'c'", ":", "'g'", ",", "'g'", ":", "'c'", ",", "'n'", ":", "'n'", "}", "revcomp", "=", "''", "try", ":", "for", ...
Helper method for getvals: input is nucleotide sequence, returns its reverse complement
[ "Helper", "method", "for", "getvals", ":", "input", "is", "nucleotide", "sequence", "returns", "its", "reverse", "complement" ]
[ "'''Helper method for getvals: input is nucleotide sequence, returns its reverse complement'''", "# print (e)" ]
[ { "param": "nucstring", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "nucstring", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f6565f5d63a8a3185a4c6e04dde243ec47046556
wsoyinka/openstack-ansible
osa_toolkit/filesystem.py
[ "Apache-2.0" ]
Python
_get_search_paths
<not_specific>
def _get_search_paths(preferred_path=None, suffix=None): """Return a list of search paths, including the standard location :param preferred_path: A search path to prefer to a standard location :param suffix: Appended to the search paths, e.g. subdirectory or filename :return: ``(list)`` Path strings to...
Return a list of search paths, including the standard location :param preferred_path: A search path to prefer to a standard location :param suffix: Appended to the search paths, e.g. subdirectory or filename :return: ``(list)`` Path strings to search
Return a list of search paths, including the standard location
[ "Return", "a", "list", "of", "search", "paths", "including", "the", "standard", "location" ]
def _get_search_paths(preferred_path=None, suffix=None): search_paths = [ os.path.join( '/etc', 'openstack_deploy' ), ] if preferred_path is not None: search_paths.insert(0, os.path.expanduser(preferred_path)) if suffix: search_paths = [os.path.join(p, suffix)...
[ "def", "_get_search_paths", "(", "preferred_path", "=", "None", ",", "suffix", "=", "None", ")", ":", "search_paths", "=", "[", "os", ".", "path", ".", "join", "(", "'/etc'", ",", "'openstack_deploy'", ")", ",", "]", "if", "preferred_path", "is", "not", ...
Return a list of search paths, including the standard location
[ "Return", "a", "list", "of", "search", "paths", "including", "the", "standard", "location" ]
[ "\"\"\"Return a list of search paths, including the standard location\n\n :param preferred_path: A search path to prefer to a standard location\n :param suffix: Appended to the search paths, e.g. subdirectory or filename\n :return: ``(list)`` Path strings to search\n \"\"\"" ]
[ { "param": "preferred_path", "type": null }, { "param": "suffix", "type": null } ]
{ "returns": [ { "docstring": "``(list)`` Path strings to search", "docstring_tokens": [ "`", "`", "(", "list", ")", "`", "`", "Path", "strings", "to", "search" ], "type": null } ], "raises": []...
f6565f5d63a8a3185a4c6e04dde243ec47046556
wsoyinka/openstack-ansible
osa_toolkit/filesystem.py
[ "Apache-2.0" ]
Python
file_find
<not_specific>
def file_find(filename, preferred_path=None, raise_if_missing=True): """Return the path to an existing file, or False if no file is found. If no file is found and raise_if_missing is True, MissingDataSource will be raised. The file lookup will be done in the following directories: * ``prefer...
Return the path to an existing file, or False if no file is found. If no file is found and raise_if_missing is True, MissingDataSource will be raised. The file lookup will be done in the following directories: * ``preferred_path`` [Optional] * ``/etc/openstack_deploy/`` :param filenam...
Return the path to an existing file, or False if no file is found. If no file is found and raise_if_missing is True, MissingDataSource will be raised.
[ "Return", "the", "path", "to", "an", "existing", "file", "or", "False", "if", "no", "file", "is", "found", ".", "If", "no", "file", "is", "found", "and", "raise_if_missing", "is", "True", "MissingDataSource", "will", "be", "raised", "." ]
def file_find(filename, preferred_path=None, raise_if_missing=True): search_paths = _get_search_paths(preferred_path, suffix=filename) for file_candidate in search_paths: if os.path.isfile(file_candidate): return file_candidate if raise_if_missing: raise MissingDataSource(search_...
[ "def", "file_find", "(", "filename", ",", "preferred_path", "=", "None", ",", "raise_if_missing", "=", "True", ")", ":", "search_paths", "=", "_get_search_paths", "(", "preferred_path", ",", "suffix", "=", "filename", ")", "for", "file_candidate", "in", "search_...
Return the path to an existing file, or False if no file is found.
[ "Return", "the", "path", "to", "an", "existing", "file", "or", "False", "if", "no", "file", "is", "found", "." ]
[ "\"\"\"Return the path to an existing file, or False if no file is found.\n\n If no file is found and raise_if_missing is True, MissingDataSource\n will be raised.\n\n The file lookup will be done in the following directories:\n * ``preferred_path`` [Optional]\n * ``/etc/openstack_deploy/``\n...
[ { "param": "filename", "type": null }, { "param": "preferred_path", "type": null }, { "param": "raise_if_missing", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filename", "type": null, "docstring": "``str`` Name of the file to find", "docstring_tokens": [ "`", "`", "str", "`", "`", "Name", "of", "the", "file", ...
f6565f5d63a8a3185a4c6e04dde243ec47046556
wsoyinka/openstack-ansible
osa_toolkit/filesystem.py
[ "Apache-2.0" ]
Python
dir_find
<not_specific>
def dir_find(preferred_path=None, suffix=None, raise_if_missing=True): """Return the path to the user configuration files. If no directory is found the system will exit. The lookup will be done in the following directories: * ``preferred_path`` [Optional] * ``/etc/openstack_deploy/`` :pa...
Return the path to the user configuration files. If no directory is found the system will exit. The lookup will be done in the following directories: * ``preferred_path`` [Optional] * ``/etc/openstack_deploy/`` :param preferred_path: ``str`` Additional directory to look in FIRST :param s...
Return the path to the user configuration files. If no directory is found the system will exit. The lookup will be done in the following directories.
[ "Return", "the", "path", "to", "the", "user", "configuration", "files", ".", "If", "no", "directory", "is", "found", "the", "system", "will", "exit", ".", "The", "lookup", "will", "be", "done", "in", "the", "following", "directories", "." ]
def dir_find(preferred_path=None, suffix=None, raise_if_missing=True): search_paths = _get_search_paths(preferred_path, suffix) for f in search_paths: if os.path.isdir(f): return f if raise_if_missing: raise MissingDataSource(search_paths) else: return False
[ "def", "dir_find", "(", "preferred_path", "=", "None", ",", "suffix", "=", "None", ",", "raise_if_missing", "=", "True", ")", ":", "search_paths", "=", "_get_search_paths", "(", "preferred_path", ",", "suffix", ")", "for", "f", "in", "search_paths", ":", "if...
Return the path to the user configuration files.
[ "Return", "the", "path", "to", "the", "user", "configuration", "files", "." ]
[ "\"\"\"Return the path to the user configuration files.\n\n If no directory is found the system will exit.\n\n The lookup will be done in the following directories:\n\n * ``preferred_path`` [Optional]\n * ``/etc/openstack_deploy/``\n\n :param preferred_path: ``str`` Additional directory to look i...
[ { "param": "preferred_path", "type": null }, { "param": "suffix", "type": null }, { "param": "raise_if_missing", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "preferred_path", "type": null, "docstring": "``str`` Additional directory to look in FIRST", "docstring_tokens": [ "`", "`", "str", "`", "`", "Additional", "directory", ...
f6565f5d63a8a3185a4c6e04dde243ec47046556
wsoyinka/openstack-ansible
osa_toolkit/filesystem.py
[ "Apache-2.0" ]
Python
_extra_config
null
def _extra_config(user_defined_config, base_dir): """Discover new items in any extra directories and add the new values. :param user_defined_config: ``dict`` :param base_dir: ``str`` """ for root_dir, _, files in os.walk(base_dir): for name in files: if name.endswith(('.yml', '....
Discover new items in any extra directories and add the new values. :param user_defined_config: ``dict`` :param base_dir: ``str``
Discover new items in any extra directories and add the new values.
[ "Discover", "new", "items", "in", "any", "extra", "directories", "and", "add", "the", "new", "values", "." ]
def _extra_config(user_defined_config, base_dir): for root_dir, _, files in os.walk(base_dir): for name in files: if name.endswith(('.yml', '.yaml')): with open(os.path.join(root_dir, name), 'rb') as f: du.merge_dict( user_defined_confi...
[ "def", "_extra_config", "(", "user_defined_config", ",", "base_dir", ")", ":", "for", "root_dir", ",", "_", ",", "files", "in", "os", ".", "walk", "(", "base_dir", ")", ":", "for", "name", "in", "files", ":", "if", "name", ".", "endswith", "(", "(", ...
Discover new items in any extra directories and add the new values.
[ "Discover", "new", "items", "in", "any", "extra", "directories", "and", "add", "the", "new", "values", "." ]
[ "\"\"\"Discover new items in any extra directories and add the new values.\n\n :param user_defined_config: ``dict``\n :param base_dir: ``str``\n \"\"\"" ]
[ { "param": "user_defined_config", "type": null }, { "param": "base_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "user_defined_config", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, "is_optional": null }, { "identifier": "base_dir", "type": null, "docs...
f6565f5d63a8a3185a4c6e04dde243ec47046556
wsoyinka/openstack-ansible
osa_toolkit/filesystem.py
[ "Apache-2.0" ]
Python
_make_backup
null
def _make_backup(backup_path, source_file_path): """Create a backup of all previous inventory files as a tar archive :param backup_path: where to store the backup file :param source_file_path: path of file to backup :return: """ inventory_backup_file = os.path.join( backup_path, ...
Create a backup of all previous inventory files as a tar archive :param backup_path: where to store the backup file :param source_file_path: path of file to backup :return:
Create a backup of all previous inventory files as a tar archive
[ "Create", "a", "backup", "of", "all", "previous", "inventory", "files", "as", "a", "tar", "archive" ]
def _make_backup(backup_path, source_file_path): inventory_backup_file = os.path.join( backup_path, 'backup_openstack_inventory.tar' ) with tarfile.open(inventory_backup_file, 'a') as tar: members = [i.name for i in tar.getmembers()] if len(members) > 15: with ope...
[ "def", "_make_backup", "(", "backup_path", ",", "source_file_path", ")", ":", "inventory_backup_file", "=", "os", ".", "path", ".", "join", "(", "backup_path", ",", "'backup_openstack_inventory.tar'", ")", "with", "tarfile", ".", "open", "(", "inventory_backup_file"...
Create a backup of all previous inventory files as a tar archive
[ "Create", "a", "backup", "of", "all", "previous", "inventory", "files", "as", "a", "tar", "archive" ]
[ "\"\"\"Create a backup of all previous inventory files as a tar archive\n\n :param backup_path: where to store the backup file\n :param source_file_path: path of file to backup\n :return:\n \"\"\"", "# tar.getmembers() is always ordered with the", "# tar standard append file order" ]
[ { "param": "backup_path", "type": null }, { "param": "source_file_path", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "backup_path", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null,...
f6565f5d63a8a3185a4c6e04dde243ec47046556
wsoyinka/openstack-ansible
osa_toolkit/filesystem.py
[ "Apache-2.0" ]
Python
_get_backup_name
<not_specific>
def _get_backup_name(basename): """Return a name for a backup file based on the time :param basename: serves as prefix for the return value :return: a name for a backup file based on current time """ utctime = datetime.datetime.utcnow() utctime = utctime.strftime("%Y%m%d_%H%M%S") return '{...
Return a name for a backup file based on the time :param basename: serves as prefix for the return value :return: a name for a backup file based on current time
Return a name for a backup file based on the time
[ "Return", "a", "name", "for", "a", "backup", "file", "based", "on", "the", "time" ]
def _get_backup_name(basename): utctime = datetime.datetime.utcnow() utctime = utctime.strftime("%Y%m%d_%H%M%S") return '{}-{}.json'.format(basename, utctime)
[ "def", "_get_backup_name", "(", "basename", ")", ":", "utctime", "=", "datetime", ".", "datetime", ".", "utcnow", "(", ")", "utctime", "=", "utctime", ".", "strftime", "(", "\"%Y%m%d_%H%M%S\"", ")", "return", "'{}-{}.json'", ".", "format", "(", "basename", "...
Return a name for a backup file based on the time
[ "Return", "a", "name", "for", "a", "backup", "file", "based", "on", "the", "time" ]
[ "\"\"\"Return a name for a backup file based on the time\n\n :param basename: serves as prefix for the return value\n :return: a name for a backup file based on current time\n \"\"\"" ]
[ { "param": "basename", "type": null } ]
{ "returns": [ { "docstring": "a name for a backup file based on current time", "docstring_tokens": [ "a", "name", "for", "a", "backup", "file", "based", "on", "current", "time" ], "type": null } ], "ra...
f6565f5d63a8a3185a4c6e04dde243ec47046556
wsoyinka/openstack-ansible
osa_toolkit/filesystem.py
[ "Apache-2.0" ]
Python
write_hostnames
null
def write_hostnames(save_path, hostnames_ips): """Write a list of all hosts and their given IP addresses NOTE: the file is saved in json format to a file with the name ``openstack_hostnames_ips.yml`` :param save_path: path to save the file to, will use default location if None or an invalid pa...
Write a list of all hosts and their given IP addresses NOTE: the file is saved in json format to a file with the name ``openstack_hostnames_ips.yml`` :param save_path: path to save the file to, will use default location if None or an invalid path is provided :param hostnames_ips: the list of a...
Write a list of all hosts and their given IP addresses NOTE: the file is saved in json format to a file with the name ``openstack_hostnames_ips.yml``
[ "Write", "a", "list", "of", "all", "hosts", "and", "their", "given", "IP", "addresses", "NOTE", ":", "the", "file", "is", "saved", "in", "json", "format", "to", "a", "file", "with", "the", "name", "`", "`", "openstack_hostnames_ips", ".", "yml", "`", "...
def write_hostnames(save_path, hostnames_ips): file_path = dir_find(save_path) hostnames_ip_file = os.path.join(file_path, 'openstack_hostnames_ips.yml') with open(hostnames_ip_file, 'wb') as f: f.write( ('# This file is managed by openstack-ansible. No manual edits.\n' + js...
[ "def", "write_hostnames", "(", "save_path", ",", "hostnames_ips", ")", ":", "file_path", "=", "dir_find", "(", "save_path", ")", "hostnames_ip_file", "=", "os", ".", "path", ".", "join", "(", "file_path", ",", "'openstack_hostnames_ips.yml'", ")", "with", "open"...
Write a list of all hosts and their given IP addresses NOTE: the file is saved in json format to a file with the name ``openstack_hostnames_ips.yml``
[ "Write", "a", "list", "of", "all", "hosts", "and", "their", "given", "IP", "addresses", "NOTE", ":", "the", "file", "is", "saved", "in", "json", "format", "to", "a", "file", "with", "the", "name", "`", "`", "openstack_hostnames_ips", ".", "yml", "`", "...
[ "\"\"\"Write a list of all hosts and their given IP addresses\n\n NOTE: the file is saved in json format to a file with the name\n ``openstack_hostnames_ips.yml``\n\n :param save_path: path to save the file to, will use default location if\n None or an invalid path is provided\n :param hostnames_...
[ { "param": "save_path", "type": null }, { "param": "hostnames_ips", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "save_path", "type": null, "docstring": "path to save the file to, will use default location if\nNone or an invalid path is provided", "docstring_tokens": [ "path", "to", "save", "the", "...
f6565f5d63a8a3185a4c6e04dde243ec47046556
wsoyinka/openstack-ansible
osa_toolkit/filesystem.py
[ "Apache-2.0" ]
Python
load_inventory
<not_specific>
def load_inventory(preferred_path=None, default_inv=None, filename=None): """Create an inventory dictionary. Create inventory dictionary from the given source file or a default inventory. If an inventory is found then a backup tarball is created as well. :param preferred_path: ``str`` Pat...
Create an inventory dictionary. Create inventory dictionary from the given source file or a default inventory. If an inventory is found then a backup tarball is created as well. :param preferred_path: ``str`` Path to the inventory directory to try FIRST :param default_inv: ``dict`` Defaul...
Create an inventory dictionary. Create inventory dictionary from the given source file or a default inventory. If an inventory is found then a backup tarball is created as well.
[ "Create", "an", "inventory", "dictionary", ".", "Create", "inventory", "dictionary", "from", "the", "given", "source", "file", "or", "a", "default", "inventory", ".", "If", "an", "inventory", "is", "found", "then", "a", "backup", "tarball", "is", "created", ...
def load_inventory(preferred_path=None, default_inv=None, filename=None): if filename: inv_fn = filename else: inv_fn = INVENTORY_FILENAME inventory, file_loaded = _load_from_json(inv_fn, preferred_path, raise_if_missing=False) if file_loaded ...
[ "def", "load_inventory", "(", "preferred_path", "=", "None", ",", "default_inv", "=", "None", ",", "filename", "=", "None", ")", ":", "if", "filename", ":", "inv_fn", "=", "filename", "else", ":", "inv_fn", "=", "INVENTORY_FILENAME", "inventory", ",", "file_...
Create an inventory dictionary.
[ "Create", "an", "inventory", "dictionary", "." ]
[ "\"\"\"Create an inventory dictionary.\n\n Create inventory dictionary from the given source file or a default\n inventory. If an inventory is found then a backup tarball is created\n as well.\n\n :param preferred_path: ``str`` Path to the inventory directory to try FIRST\n :param default_in...
[ { "param": "preferred_path", "type": null }, { "param": "default_inv", "type": null }, { "param": "filename", "type": null } ]
{ "returns": [ { "docstring": "``(dict, str)`` Dictionary describing the JSON file contents or\n``default_inv``, and the directory from which the inventory was loaded\nor should have been loaded from.", "docstring_tokens": [ "`", "`", "(", "dict", "str", ...
f6565f5d63a8a3185a4c6e04dde243ec47046556
wsoyinka/openstack-ansible
osa_toolkit/filesystem.py
[ "Apache-2.0" ]
Python
load_environment
<not_specific>
def load_environment(config_path, environment): """Create an environment dictionary from config files :param config_path: ``str`` path where the environment files are kept :param environment: ``dict`` dictionary to populate with environment data """ # Load all YAML files found in the env.d directo...
Create an environment dictionary from config files :param config_path: ``str`` path where the environment files are kept :param environment: ``dict`` dictionary to populate with environment data
Create an environment dictionary from config files
[ "Create", "an", "environment", "dictionary", "from", "config", "files" ]
def load_environment(config_path, environment): env_plugins = dir_find(config_path, 'env.d', raise_if_missing=False) if env_plugins is not False: _extra_config(user_defined_config=environment, base_dir=env_plugins) logger.debug("Loaded environment from {}".format(config_path)) return environ...
[ "def", "load_environment", "(", "config_path", ",", "environment", ")", ":", "env_plugins", "=", "dir_find", "(", "config_path", ",", "'env.d'", ",", "raise_if_missing", "=", "False", ")", "if", "env_plugins", "is", "not", "False", ":", "_extra_config", "(", "...
Create an environment dictionary from config files
[ "Create", "an", "environment", "dictionary", "from", "config", "files" ]
[ "\"\"\"Create an environment dictionary from config files\n\n :param config_path: ``str`` path where the environment files are kept\n :param environment: ``dict`` dictionary to populate with environment data\n \"\"\"", "# Load all YAML files found in the env.d directory" ]
[ { "param": "config_path", "type": null }, { "param": "environment", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "config_path", "type": null, "docstring": "``str`` path where the environment files are kept", "docstring_tokens": [ "`", "`", "str", "`", "`", "path", "where", "t...
f6565f5d63a8a3185a4c6e04dde243ec47046556
wsoyinka/openstack-ansible
osa_toolkit/filesystem.py
[ "Apache-2.0" ]
Python
load_user_configuration
<not_specific>
def load_user_configuration(config_path=None): """Create a user configuration dictionary from config files :param config_path: ``str`` path where the configuration files are kept """ user_defined_config = dict() # Load the user defined configuration file user_config_file = file_find('openstac...
Create a user configuration dictionary from config files :param config_path: ``str`` path where the configuration files are kept
Create a user configuration dictionary from config files
[ "Create", "a", "user", "configuration", "dictionary", "from", "config", "files" ]
def load_user_configuration(config_path=None): user_defined_config = dict() user_config_file = file_find('openstack_user_config.yml', preferred_path=config_path, raise_if_missing=False) if user_config_file is not False: with open(user...
[ "def", "load_user_configuration", "(", "config_path", "=", "None", ")", ":", "user_defined_config", "=", "dict", "(", ")", "user_config_file", "=", "file_find", "(", "'openstack_user_config.yml'", ",", "preferred_path", "=", "config_path", ",", "raise_if_missing", "="...
Create a user configuration dictionary from config files
[ "Create", "a", "user", "configuration", "dictionary", "from", "config", "files" ]
[ "\"\"\"Create a user configuration dictionary from config files\n\n :param config_path: ``str`` path where the configuration files are kept\n \"\"\"", "# Load the user defined configuration file", "# Load anything in a conf.d directory if found", "# Exit if no user_config was found and loaded" ]
[ { "param": "config_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "config_path", "type": null, "docstring": "``str`` path where the configuration files are kept", "docstring_tokens": [ "`", "`", "str", "`", "`", "path", "where", ...
23052cb256082f3d43e78dcc5c10659ea0b67631
psoulier/crumbs
crumbs.py
[ "MIT" ]
Python
process
<not_specific>
def process(self, bindata): """Given the binary data for an entry, generate its formatted string representation and return the string to caller. The format string for the entry in the crumb definition file will have "%{name}" sections. This function replaces it with the data from the f...
Given the binary data for an entry, generate its formatted string representation and return the string to caller. The format string for the entry in the crumb definition file will have "%{name}" sections. This function replaces it with the data from the field with the same name. The formattin...
Given the binary data for an entry, generate its formatted string representation and return the string to caller. The format string for the entry in the crumb definition file will have "%{name}" sections. This function replaces it with the data from the field with the same name. The formatting options are the same a...
[ "Given", "the", "binary", "data", "for", "an", "entry", "generate", "its", "formatted", "string", "representation", "and", "return", "the", "string", "to", "caller", ".", "The", "format", "string", "for", "the", "entry", "in", "the", "crumb", "definition", "...
def process(self, bindata): data = struct.unpack(self.packfmt, bindata) output = '' if 'timestamp' in self.fieldbyname: output += '[%012f] ' % (self.getdata('timestamp', data) * TIMESCALE) output += '%s-%s: ' % (self.cat['name'], self.name) i = 0 while i < len...
[ "def", "process", "(", "self", ",", "bindata", ")", ":", "data", "=", "struct", ".", "unpack", "(", "self", ".", "packfmt", ",", "bindata", ")", "output", "=", "''", "if", "'timestamp'", "in", "self", ".", "fieldbyname", ":", "output", "+=", "'[%012f] ...
Given the binary data for an entry, generate its formatted string representation and return the string to caller.
[ "Given", "the", "binary", "data", "for", "an", "entry", "generate", "its", "formatted", "string", "representation", "and", "return", "the", "string", "to", "caller", "." ]
[ "\"\"\"Given the binary data for an entry, generate its formatted string representation\n and return the string to caller. The format string for the entry in the crumb\n definition file will have \"%{name}\" sections. This function replaces it with the\n data from the field with the same name...
[ { "param": "self", "type": null }, { "param": "bindata", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "bindata", "type": null, "docstring": null, "docstring_tokens"...
23052cb256082f3d43e78dcc5c10659ea0b67631
psoulier/crumbs
crumbs.py
[ "MIT" ]
Python
check_crumb_def
null
def check_crumb_def(crumbdef): """Do some sanity checking on the crumb definition file. This is not at all comprehensive, but will catch a lot of common errors. Unfortunately, errors that aren't caught will probably cause some really odd behavior. """ if 'wordsize' not in crumbdef: raise ...
Do some sanity checking on the crumb definition file. This is not at all comprehensive, but will catch a lot of common errors. Unfortunately, errors that aren't caught will probably cause some really odd behavior.
Do some sanity checking on the crumb definition file. This is not at all comprehensive, but will catch a lot of common errors. Unfortunately, errors that aren't caught will probably cause some really odd behavior.
[ "Do", "some", "sanity", "checking", "on", "the", "crumb", "definition", "file", ".", "This", "is", "not", "at", "all", "comprehensive", "but", "will", "catch", "a", "lot", "of", "common", "errors", ".", "Unfortunately", "errors", "that", "aren", "'", "t", ...
def check_crumb_def(crumbdef): if 'wordsize' not in crumbdef: raise CrumbError('Definition of word size for target platform required ("wordsize":bits).') if 'byteorder' not in crumbdef: raise CrumbError('Byte order must be specified (add "byteorder:big|little|netword").') cats = [] for c...
[ "def", "check_crumb_def", "(", "crumbdef", ")", ":", "if", "'wordsize'", "not", "in", "crumbdef", ":", "raise", "CrumbError", "(", "'Definition of word size for target platform required (\"wordsize\":bits).'", ")", "if", "'byteorder'", "not", "in", "crumbdef", ":", "rai...
Do some sanity checking on the crumb definition file.
[ "Do", "some", "sanity", "checking", "on", "the", "crumb", "definition", "file", "." ]
[ "\"\"\"Do some sanity checking on the crumb definition file. This is not\n at all comprehensive, but will catch a lot of common errors. Unfortunately,\n errors that aren't caught will probably cause some really odd behavior.\n \"\"\"" ]
[ { "param": "crumbdef", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "crumbdef", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
52fd8a63859568c13de7751fce85ad424b2f674d
jakeogh/Qcodes
qcodes/tests/dataset/test_nested_measurements.py
[ "MIT" ]
Python
basic_subscriber
<not_specific>
def basic_subscriber(): """ A basic subscriber that just puts results and length into state """ def subscriber(results: List[Tuple[VALUE]], length: int, state: Dict) -> None: state[length] = results return subscriber
A basic subscriber that just puts results and length into state
A basic subscriber that just puts results and length into state
[ "A", "basic", "subscriber", "that", "just", "puts", "results", "and", "length", "into", "state" ]
def basic_subscriber(): def subscriber(results: List[Tuple[VALUE]], length: int, state: Dict) -> None: state[length] = results return subscriber
[ "def", "basic_subscriber", "(", ")", ":", "def", "subscriber", "(", "results", ":", "List", "[", "Tuple", "[", "VALUE", "]", "]", ",", "length", ":", "int", ",", "state", ":", "Dict", ")", "->", "None", ":", "state", "[", "length", "]", "=", "resul...
A basic subscriber that just puts results and length into state
[ "A", "basic", "subscriber", "that", "just", "puts", "results", "and", "length", "into", "state" ]
[ "\"\"\"\n A basic subscriber that just puts results and length into\n state\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
306c5c3cf68037253ea7cbb2ab31e5d8c03eba56
jakeogh/Qcodes
qcodes/instrument_drivers/tektronix/Keithley_2400.py
[ "MIT" ]
Python
_get_read_output_protected
str
def _get_read_output_protected(self) -> str: """ This wrapper function around ":READ?" exists because calling ":READ?" on an instrument with output disabled is an error. So first we check that output is on and if not we return nan for volt, curr etc. """ output = ...
This wrapper function around ":READ?" exists because calling ":READ?" on an instrument with output disabled is an error. So first we check that output is on and if not we return nan for volt, curr etc.
This wrapper function around ":READ?" exists because calling ":READ?" on an instrument with output disabled is an error. So first we check that output is on and if not we return nan for volt, curr etc.
[ "This", "wrapper", "function", "around", "\"", ":", "READ?", "\"", "exists", "because", "calling", "\"", ":", "READ?", "\"", "on", "an", "instrument", "with", "output", "disabled", "is", "an", "error", ".", "So", "first", "we", "check", "that", "output", ...
def _get_read_output_protected(self) -> str: output = self.output.get_latest() if output is None: output = self.output.get() if output == 1: msg = self.ask(':READ?') else: raise RuntimeError("Cannot perform read with output off") return msg
[ "def", "_get_read_output_protected", "(", "self", ")", "->", "str", ":", "output", "=", "self", ".", "output", ".", "get_latest", "(", ")", "if", "output", "is", "None", ":", "output", "=", "self", ".", "output", ".", "get", "(", ")", "if", "output", ...
This wrapper function around ":READ?"
[ "This", "wrapper", "function", "around", "\"", ":", "READ?", "\"" ]
[ "\"\"\"\n This wrapper function around \":READ?\" exists because calling\n \":READ?\" on an instrument with output disabled is an error.\n So first we check that output is on and if not we return\n nan for volt, curr etc.\n \"\"\"", "# if get_latest returns None we have", "# t...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
306c5c3cf68037253ea7cbb2ab31e5d8c03eba56
jakeogh/Qcodes
qcodes/instrument_drivers/tektronix/Keithley_2400.py
[ "MIT" ]
Python
reset
None
def reset(self) -> None: """ Reset the instrument. When the instrument is reset, it performs the following actions. Returns the SourceMeter to the GPIB default conditions. Cancels all pending commands. Cancels all previously send `*OPC` and `*OPC?` ...
Reset the instrument. When the instrument is reset, it performs the following actions. Returns the SourceMeter to the GPIB default conditions. Cancels all pending commands. Cancels all previously send `*OPC` and `*OPC?`
Reset the instrument. When the instrument is reset, it performs the following actions. Returns the SourceMeter to the GPIB default conditions. Cancels all pending commands. Cancels all previously send `*OPC` and `*OPC?`
[ "Reset", "the", "instrument", ".", "When", "the", "instrument", "is", "reset", "it", "performs", "the", "following", "actions", ".", "Returns", "the", "SourceMeter", "to", "the", "GPIB", "default", "conditions", ".", "Cancels", "all", "pending", "commands", "....
def reset(self) -> None: self.write(':*RST')
[ "def", "reset", "(", "self", ")", "->", "None", ":", "self", ".", "write", "(", "':*RST'", ")" ]
Reset the instrument.
[ "Reset", "the", "instrument", "." ]
[ "\"\"\"\n Reset the instrument. When the instrument is reset, it performs the\n following actions.\n\n Returns the SourceMeter to the GPIB default conditions.\n\n Cancels all pending commands.\n\n Cancels all previously send `*OPC` and `*OPC?`\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
aad
'MessageBuilder'
def aad(self, chnum: Union[constants.ChNr, int], adc_type: Union[constants.AAD.Type, int] ) -> 'MessageBuilder': """ This command is used to specify the type of the A/D converter (ADC) for each measurement channel. Execution Conditions: Enter the AIT ...
This command is used to specify the type of the A/D converter (ADC) for each measurement channel. Execution Conditions: Enter the AIT command to set up the ADC. The pulsed-measurement ADC is automatically used for the pulsed spot, pulsed sweep, multi channel pulsed spot, multi...
This command is used to specify the type of the A/D converter (ADC) for each measurement channel. Execution Conditions: Enter the AIT command to set up the ADC. The pulsed-measurement ADC is automatically used for the pulsed spot, pulsed sweep, multi channel pulsed spot, multi channel pulsed sweep, or staircase sweep...
[ "This", "command", "is", "used", "to", "specify", "the", "type", "of", "the", "A", "/", "D", "converter", "(", "ADC", ")", "for", "each", "measurement", "channel", ".", "Execution", "Conditions", ":", "Enter", "the", "AIT", "command", "to", "set", "up", ...
def aad(self, chnum: Union[constants.ChNr, int], adc_type: Union[constants.AAD.Type, int] ) -> 'MessageBuilder': cmd = f'AAD {chnum},{adc_type}' self._msg.append(cmd) return self
[ "def", "aad", "(", "self", ",", "chnum", ":", "Union", "[", "constants", ".", "ChNr", ",", "int", "]", ",", "adc_type", ":", "Union", "[", "constants", ".", "AAD", ".", "Type", ",", "int", "]", ")", "->", "'MessageBuilder'", ":", "cmd", "=", "f'AAD...
This command is used to specify the type of the A/D converter (ADC) for each measurement channel.
[ "This", "command", "is", "used", "to", "specify", "the", "type", "of", "the", "A", "/", "D", "converter", "(", "ADC", ")", "for", "each", "measurement", "channel", "." ]
[ "\"\"\"\n This command is used to specify the type of the A/D converter (ADC) for\n each measurement channel.\n\n Execution Conditions: Enter the AIT command to set up the ADC.\n\n The pulsed-measurement ADC is automatically used for the pulsed spot,\n pulsed sweep, multi channel ...
[ { "param": "self", "type": null }, { "param": "chnum", "type": "Union[constants.ChNr, int]" }, { "param": "adc_type", "type": "Union[constants.AAD.Type, int]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "chnum", "type": "Union[constants.ChNr, int]", "docstring": "SMU mea...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
ab
'MessageBuilder'
def ab(self) -> 'MessageBuilder': """ The AB command aborts the present operation and subsequent command execution. This command stops the operation now in progress, such as the measurement execution, source setup changing, and so on. But this command does not change the...
The AB command aborts the present operation and subsequent command execution. This command stops the operation now in progress, such as the measurement execution, source setup changing, and so on. But this command does not change the present condition. For example, if the ...
The AB command aborts the present operation and subsequent command execution. This command stops the operation now in progress, such as the measurement execution, source setup changing, and so on. But this command does not change the present condition. For example, if the KeysightB1500 just keeps to force the DC bias,...
[ "The", "AB", "command", "aborts", "the", "present", "operation", "and", "subsequent", "command", "execution", ".", "This", "command", "stops", "the", "operation", "now", "in", "progress", "such", "as", "the", "measurement", "execution", "source", "setup", "chang...
def ab(self) -> 'MessageBuilder': cmd = 'AB' self._msg.append(cmd) return self
[ "def", "ab", "(", "self", ")", "->", "'MessageBuilder'", ":", "cmd", "=", "'AB'", "self", ".", "_msg", ".", "append", "(", "cmd", ")", "return", "self" ]
The AB command aborts the present operation and subsequent command execution.
[ "The", "AB", "command", "aborts", "the", "present", "operation", "and", "subsequent", "command", "execution", "." ]
[ "\"\"\"\n The AB command aborts the present operation and subsequent command\n execution.\n\n This command stops the operation now in progress, such as the\n measurement execution, source setup changing, and so on. But this\n command does not change the present condition. For exam...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
ach
'MessageBuilder'
def ach(self, actual: Optional[Union[constants.ChNr, int]] = None, program: Optional[Union[constants.ChNr, int]] = None ) -> 'MessageBuilder': """ The ACH command translates the specified program channel number to the specified actual channel number at the pro...
The ACH command translates the specified program channel number to the specified actual channel number at the program execution. This command is useful when you use a control program created for an instrument, such as the 4142B, 4155B/4155C/4156B/4156C/E5260/E5270, and KeysightB...
The ACH command translates the specified program channel number to the specified actual channel number at the program execution.
[ "The", "ACH", "command", "translates", "the", "specified", "program", "channel", "number", "to", "the", "specified", "actual", "channel", "number", "at", "the", "program", "execution", "." ]
def ach(self, actual: Optional[Union[constants.ChNr, int]] = None, program: Optional[Union[constants.ChNr, int]] = None ) -> 'MessageBuilder': if program is None: if actual is None: cmd = 'ACH' else: cmd = f'ACH {actual}...
[ "def", "ach", "(", "self", ",", "actual", ":", "Optional", "[", "Union", "[", "constants", ".", "ChNr", ",", "int", "]", "]", "=", "None", ",", "program", ":", "Optional", "[", "Union", "[", "constants", ".", "ChNr", ",", "int", "]", "]", "=", "N...
The ACH command translates the specified program channel number to the specified actual channel number at the program execution.
[ "The", "ACH", "command", "translates", "the", "specified", "program", "channel", "number", "to", "the", "specified", "actual", "channel", "number", "at", "the", "program", "execution", "." ]
[ "\"\"\"\n The ACH command translates the specified program channel number to\n the specified actual channel number at the program execution. This\n command is useful when you use a control program created for an\n instrument, such as the 4142B, 4155B/4155C/4156B/4156C/E5260/E5270,\n ...
[ { "param": "self", "type": null }, { "param": "actual", "type": "Optional[Union[constants.ChNr, int]]" }, { "param": "program", "type": "Optional[Union[constants.ChNr, int]]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "actual", "type": "Optional[Union[constants.ChNr, int]]", "docstring...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
act
'MessageBuilder'
def act(self, mode: Union[constants.ACT.Mode, int], coeff: Optional[int] = None ) -> 'MessageBuilder': """ This command sets the number of averaging samples or the averaging time set to the A/D converter of the MFCMU. Args: mode: Averaging...
This command sets the number of averaging samples or the averaging time set to the A/D converter of the MFCMU. Args: mode: Averaging mode. Integer expression. 0 (initial setting) or 2. - 0: Auto mode: Defines the number of averaging samples ...
This command sets the number of averaging samples or the averaging time set to the A/D converter of the MFCMU.
[ "This", "command", "sets", "the", "number", "of", "averaging", "samples", "or", "the", "averaging", "time", "set", "to", "the", "A", "/", "D", "converter", "of", "the", "MFCMU", "." ]
def act(self, mode: Union[constants.ACT.Mode, int], coeff: Optional[int] = None ) -> 'MessageBuilder': cmd = f'ACT {mode}' if coeff is not None: cmd += f',{coeff}' self._msg.append(cmd) return self
[ "def", "act", "(", "self", ",", "mode", ":", "Union", "[", "constants", ".", "ACT", ".", "Mode", ",", "int", "]", ",", "coeff", ":", "Optional", "[", "int", "]", "=", "None", ")", "->", "'MessageBuilder'", ":", "cmd", "=", "f'ACT {mode}'", "if", "c...
This command sets the number of averaging samples or the averaging time set to the A/D converter of the MFCMU.
[ "This", "command", "sets", "the", "number", "of", "averaging", "samples", "or", "the", "averaging", "time", "set", "to", "the", "A", "/", "D", "converter", "of", "the", "MFCMU", "." ]
[ "\"\"\"\n This command sets the number of averaging samples or the averaging\n time set to the A/D converter of the MFCMU.\n\n Args:\n mode: Averaging mode.\n Integer expression. 0 (initial setting) or 2.\n\n - 0: Auto mode: Defines the number of ave...
[ { "param": "self", "type": null }, { "param": "mode", "type": "Union[constants.ACT.Mode, int]" }, { "param": "coeff", "type": "Optional[int]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "mode", "type": "Union[constants.ACT.Mode, int]", "docstring": "Aver...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
acv
'MessageBuilder'
def acv(self, chnum: Union[constants.ChNr, int], voltage: float ) -> 'MessageBuilder': """ This command sets the output signal level of the MFCMU, and starts the AC voltage output. Output signal frequency is set by the FC command. Execution co...
This command sets the output signal level of the MFCMU, and starts the AC voltage output. Output signal frequency is set by the FC command. Execution conditions: The CN/CNX command has been executed for the specified channel. Args: chnum: MFCMU channel numb...
This command sets the output signal level of the MFCMU, and starts the AC voltage output. Output signal frequency is set by the FC command. Execution conditions: The CN/CNX command has been executed for the specified channel.
[ "This", "command", "sets", "the", "output", "signal", "level", "of", "the", "MFCMU", "and", "starts", "the", "AC", "voltage", "output", ".", "Output", "signal", "frequency", "is", "set", "by", "the", "FC", "command", ".", "Execution", "conditions", ":", "T...
def acv(self, chnum: Union[constants.ChNr, int], voltage: float ) -> 'MessageBuilder': cmd = f'ACV {chnum},{voltage}' self._msg.append(cmd) return self
[ "def", "acv", "(", "self", ",", "chnum", ":", "Union", "[", "constants", ".", "ChNr", ",", "int", "]", ",", "voltage", ":", "float", ")", "->", "'MessageBuilder'", ":", "cmd", "=", "f'ACV {chnum},{voltage}'", "self", ".", "_msg", ".", "append", "(", "c...
This command sets the output signal level of the MFCMU, and starts the AC voltage output.
[ "This", "command", "sets", "the", "output", "signal", "level", "of", "the", "MFCMU", "and", "starts", "the", "AC", "voltage", "output", "." ]
[ "\"\"\"\n This command sets the output signal level of the MFCMU, and starts\n the AC voltage output. Output signal frequency is set by the FC\n command.\n\n Execution conditions: The CN/CNX command has been executed for the\n specified channel.\n\n Args:\n chnum...
[ { "param": "self", "type": null }, { "param": "chnum", "type": "Union[constants.ChNr, int]" }, { "param": "voltage", "type": "float" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "chnum", "type": "Union[constants.ChNr, int]", "docstring": "MFCMU c...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
adj_query
'MessageBuilder'
def adj_query(self, chnum: Union[constants.ChNr, int], mode: Optional[Union[constants.ADJQuery.Mode, int]] = None ) -> 'MessageBuilder': """ This command performs the MFCMU phase compensation, and sets the compensation data to the KeysightB15...
This command performs the MFCMU phase compensation, and sets the compensation data to the KeysightB1500. This command also returns the execution results. This command resets the MFCMU. Before executing this command, set the phase compensation mode to manual by using the ADJ com...
This command performs the MFCMU phase compensation, and sets the compensation data to the KeysightB1500. This command also returns the execution results. This command resets the MFCMU. Before executing this command, set the phase compensation mode to manual by using the ADJ command. During this command, open the measu...
[ "This", "command", "performs", "the", "MFCMU", "phase", "compensation", "and", "sets", "the", "compensation", "data", "to", "the", "KeysightB1500", ".", "This", "command", "also", "returns", "the", "execution", "results", ".", "This", "command", "resets", "the",...
def adj_query(self, chnum: Union[constants.ChNr, int], mode: Optional[Union[constants.ADJQuery.Mode, int]] = None ) -> 'MessageBuilder': cmd = f'ADJ? {chnum}' if mode is not None: cmd += f',{mode}' self._msg.append(cmd) re...
[ "def", "adj_query", "(", "self", ",", "chnum", ":", "Union", "[", "constants", ".", "ChNr", ",", "int", "]", ",", "mode", ":", "Optional", "[", "Union", "[", "constants", ".", "ADJQuery", ".", "Mode", ",", "int", "]", "]", "=", "None", ")", "->", ...
This command performs the MFCMU phase compensation, and sets the compensation data to the KeysightB1500.
[ "This", "command", "performs", "the", "MFCMU", "phase", "compensation", "and", "sets", "the", "compensation", "data", "to", "the", "KeysightB1500", "." ]
[ "\"\"\"\n This command performs the MFCMU phase compensation, and sets the\n compensation data to the KeysightB1500. This command also returns the\n execution results.\n\n This command resets the MFCMU. Before executing this command, set the\n phase compensation mode to manual by ...
[ { "param": "self", "type": null }, { "param": "chnum", "type": "Union[constants.ChNr, int]" }, { "param": "mode", "type": "Optional[Union[constants.ADJQuery.Mode, int]]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "chnum", "type": "Union[constants.ChNr, int]", "docstring": "MFCMU c...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
ait
'MessageBuilder'
def ait(self, adc_type: Union[constants.AIT.Type, int], mode: Union[constants.AIT.Mode, int], coeff: Optional[Union[int, float]] = None ) -> 'MessageBuilder': """ This command is used to set the operation mode and the setup parameter of the A/D con...
This command is used to set the operation mode and the setup parameter of the A/D converter (ADC) for each ADC type. Execution conditions: Enter the AAD command to specify the ADC type for each measurement channel. The pulsed-measurement ADC (type=2) is available for the all ...
This command is used to set the operation mode and the setup parameter of the A/D converter (ADC) for each ADC type. Execution conditions: Enter the AAD command to specify the ADC type for each measurement channel. The pulsed-measurement ADC (type=2) is available for the all measurement channels used for the pulsed s...
[ "This", "command", "is", "used", "to", "set", "the", "operation", "mode", "and", "the", "setup", "parameter", "of", "the", "A", "/", "D", "converter", "(", "ADC", ")", "for", "each", "ADC", "type", ".", "Execution", "conditions", ":", "Enter", "the", "...
def ait(self, adc_type: Union[constants.AIT.Type, int], mode: Union[constants.AIT.Mode, int], coeff: Optional[Union[int, float]] = None ) -> 'MessageBuilder': cmd = f'AIT {adc_type},{mode}' if coeff is not None: cmd += f',{coeff}' self....
[ "def", "ait", "(", "self", ",", "adc_type", ":", "Union", "[", "constants", ".", "AIT", ".", "Type", ",", "int", "]", ",", "mode", ":", "Union", "[", "constants", ".", "AIT", ".", "Mode", ",", "int", "]", ",", "coeff", ":", "Optional", "[", "Unio...
This command is used to set the operation mode and the setup parameter of the A/D converter (ADC) for each ADC type.
[ "This", "command", "is", "used", "to", "set", "the", "operation", "mode", "and", "the", "setup", "parameter", "of", "the", "A", "/", "D", "converter", "(", "ADC", ")", "for", "each", "ADC", "type", "." ]
[ "\"\"\"\n This command is used to set the operation mode and the setup\n parameter of the A/D converter (ADC) for each ADC type.\n\n Execution conditions: Enter the AAD command to specify the ADC type\n for each measurement channel.\n\n The pulsed-measurement ADC (type=2) is avail...
[ { "param": "self", "type": null }, { "param": "adc_type", "type": "Union[constants.AIT.Type, int]" }, { "param": "mode", "type": "Union[constants.AIT.Mode, int]" }, { "param": "coeff", "type": "Optional[Union[int, float]]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "adc_type", "type": "Union[constants.AIT.Type, int]", "docstring": "...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
aitm
'MessageBuilder'
def aitm(self, operation_type: Union[constants.APIVersion, int] ) -> 'MessageBuilder': """ Only for the current measurement by using HRSMU. This command sets the operation type of the high-resolution ADC that is set to the power line cycle (PLC) mode by the AIT 1, 2, N comma...
Only for the current measurement by using HRSMU. This command sets the operation type of the high-resolution ADC that is set to the power line cycle (PLC) mode by the AIT 1, 2, N command. This setting is cleared by the ``*RST`` or a device clear. Args: operation_ty...
Only for the current measurement by using HRSMU. This command sets the operation type of the high-resolution ADC that is set to the power line cycle (PLC) mode by the AIT 1, 2, N command. This setting is cleared by the ``*RST`` or a device clear.
[ "Only", "for", "the", "current", "measurement", "by", "using", "HRSMU", ".", "This", "command", "sets", "the", "operation", "type", "of", "the", "high", "-", "resolution", "ADC", "that", "is", "set", "to", "the", "power", "line", "cycle", "(", "PLC", ")"...
def aitm(self, operation_type: Union[constants.APIVersion, int] ) -> 'MessageBuilder': cmd = f'AITM {operation_type}' self._msg.append(cmd) return self
[ "def", "aitm", "(", "self", ",", "operation_type", ":", "Union", "[", "constants", ".", "APIVersion", ",", "int", "]", ")", "->", "'MessageBuilder'", ":", "cmd", "=", "f'AITM {operation_type}'", "self", ".", "_msg", ".", "append", "(", "cmd", ")", "return"...
Only for the current measurement by using HRSMU.
[ "Only", "for", "the", "current", "measurement", "by", "using", "HRSMU", "." ]
[ "\"\"\"\n Only for the current measurement by using HRSMU. This command sets\n the operation type of the high-resolution ADC that is set to the\n power line cycle (PLC) mode by the AIT 1, 2, N command.\n\n This setting is cleared by the ``*RST`` or a device clear.\n\n Args:\n ...
[ { "param": "self", "type": null }, { "param": "operation_type", "type": "Union[constants.APIVersion, int]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "operation_type", "type": "Union[constants.APIVersion, int]", "docst...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
aitm_query
'MessageBuilder'
def aitm_query(self) -> 'MessageBuilder': """ This command returns the operation type of the high-resolution ADC that is set by the AITM command. """ cmd = f'AITM?' self._msg.append(cmd) return self
This command returns the operation type of the high-resolution ADC that is set by the AITM command.
This command returns the operation type of the high-resolution ADC that is set by the AITM command.
[ "This", "command", "returns", "the", "operation", "type", "of", "the", "high", "-", "resolution", "ADC", "that", "is", "set", "by", "the", "AITM", "command", "." ]
def aitm_query(self) -> 'MessageBuilder': cmd = f'AITM?' self._msg.append(cmd) return self
[ "def", "aitm_query", "(", "self", ")", "->", "'MessageBuilder'", ":", "cmd", "=", "f'AITM?'", "self", ".", "_msg", ".", "append", "(", "cmd", ")", "return", "self" ]
This command returns the operation type of the high-resolution ADC that is set by the AITM command.
[ "This", "command", "returns", "the", "operation", "type", "of", "the", "high", "-", "resolution", "ADC", "that", "is", "set", "by", "the", "AITM", "command", "." ]
[ "\"\"\"\n This command returns the operation type of the high-resolution ADC\n that is set by the AITM command.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
als_query
'MessageBuilder'
def als_query(self, chnum: Union[constants.ChNr, int]) -> 'MessageBuilder': """ This query command returns the ALWG sequence data of the specified SPGU channel. Query response: Returns the ALWG sequence data (binary format, big endian). Args: chnum: SPGU cha...
This query command returns the ALWG sequence data of the specified SPGU channel. Query response: Returns the ALWG sequence data (binary format, big endian). Args: chnum: SPGU channel number. Integer expression. 1 to 10 or 101 to 1002. See Table 4-1....
This query command returns the ALWG sequence data of the specified SPGU channel. Query response: Returns the ALWG sequence data (binary format, big endian).
[ "This", "query", "command", "returns", "the", "ALWG", "sequence", "data", "of", "the", "specified", "SPGU", "channel", ".", "Query", "response", ":", "Returns", "the", "ALWG", "sequence", "data", "(", "binary", "format", "big", "endian", ")", "." ]
def als_query(self, chnum: Union[constants.ChNr, int]) -> 'MessageBuilder': cmd = f'ALS? {chnum}' self._msg.append(cmd) return self
[ "def", "als_query", "(", "self", ",", "chnum", ":", "Union", "[", "constants", ".", "ChNr", ",", "int", "]", ")", "->", "'MessageBuilder'", ":", "cmd", "=", "f'ALS? {chnum}'", "self", ".", "_msg", ".", "append", "(", "cmd", ")", "return", "self" ]
This query command returns the ALWG sequence data of the specified SPGU channel.
[ "This", "query", "command", "returns", "the", "ALWG", "sequence", "data", "of", "the", "specified", "SPGU", "channel", "." ]
[ "\"\"\"\n This query command returns the ALWG sequence data of the specified\n SPGU channel.\n\n Query response: Returns the ALWG sequence data (binary format,\n big endian).\n\n Args:\n chnum: SPGU channel number. Integer expression. 1 to 10 or 101\n to ...
[ { "param": "self", "type": null }, { "param": "chnum", "type": "Union[constants.ChNr, int]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "chnum", "type": "Union[constants.ChNr, int]", "docstring": "SPGU ch...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
alw_query
'MessageBuilder'
def alw_query(self, chnum: Union[constants.ChNr, int]) -> 'MessageBuilder': """ This query command returns the ALWG pattern data of the specified SPGU channel. Query response: Returns the ALWG pattern data (binary format, big endian). Args: chnum: SPGU chann...
This query command returns the ALWG pattern data of the specified SPGU channel. Query response: Returns the ALWG pattern data (binary format, big endian). Args: chnum: SPGU channel number. Integer expression. 1 to 10 or 101 to 1002. See Table 4-1. ...
This query command returns the ALWG pattern data of the specified SPGU channel. Query response: Returns the ALWG pattern data (binary format, big endian).
[ "This", "query", "command", "returns", "the", "ALWG", "pattern", "data", "of", "the", "specified", "SPGU", "channel", ".", "Query", "response", ":", "Returns", "the", "ALWG", "pattern", "data", "(", "binary", "format", "big", "endian", ")", "." ]
def alw_query(self, chnum: Union[constants.ChNr, int]) -> 'MessageBuilder': cmd = f'ALW? {chnum}' self._msg.append(cmd) return self
[ "def", "alw_query", "(", "self", ",", "chnum", ":", "Union", "[", "constants", ".", "ChNr", ",", "int", "]", ")", "->", "'MessageBuilder'", ":", "cmd", "=", "f'ALW? {chnum}'", "self", ".", "_msg", ".", "append", "(", "cmd", ")", "return", "self" ]
This query command returns the ALWG pattern data of the specified SPGU channel.
[ "This", "query", "command", "returns", "the", "ALWG", "pattern", "data", "of", "the", "specified", "SPGU", "channel", "." ]
[ "\"\"\"\n This query command returns the ALWG pattern data of the specified\n SPGU channel.\n\n Query response: Returns the ALWG pattern data (binary format,\n big endian).\n\n Args:\n chnum: SPGU channel number. Integer expression. 1 to 10 or 101\n to 10...
[ { "param": "self", "type": null }, { "param": "chnum", "type": "Union[constants.ChNr, int]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "chnum", "type": "Union[constants.ChNr, int]", "docstring": "SPGU ch...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
av
'MessageBuilder'
def av(self, number: int, mode: Optional[Union[constants.AV.Mode, int]] = None ) -> 'MessageBuilder': """ This command sets the number of averaging samples of the high-speed ADC (A/D converter). This command is not effective for the high-resolution ADC. T...
This command sets the number of averaging samples of the high-speed ADC (A/D converter). This command is not effective for the high-resolution ADC. This command is not effective for the measurements using pulse. Args: number: 1 to 1023, or -1 to -100. ...
This command sets the number of averaging samples of the high-speed ADC (A/D converter). This command is not effective for the high-resolution ADC. This command is not effective for the measurements using pulse.
[ "This", "command", "sets", "the", "number", "of", "averaging", "samples", "of", "the", "high", "-", "speed", "ADC", "(", "A", "/", "D", "converter", ")", ".", "This", "command", "is", "not", "effective", "for", "the", "high", "-", "resolution", "ADC", ...
def av(self, number: int, mode: Optional[Union[constants.AV.Mode, int]] = None ) -> 'MessageBuilder': cmd = f'AV {number}' if mode is not None: cmd += f',{mode}' self._msg.append(cmd) return self
[ "def", "av", "(", "self", ",", "number", ":", "int", ",", "mode", ":", "Optional", "[", "Union", "[", "constants", ".", "AV", ".", "Mode", ",", "int", "]", "]", "=", "None", ")", "->", "'MessageBuilder'", ":", "cmd", "=", "f'AV {number}'", "if", "m...
This command sets the number of averaging samples of the high-speed ADC (A/D converter).
[ "This", "command", "sets", "the", "number", "of", "averaging", "samples", "of", "the", "high", "-", "speed", "ADC", "(", "A", "/", "D", "converter", ")", "." ]
[ "\"\"\"\n This command sets the number of averaging samples of the high-speed\n ADC (A/D converter). This command is not effective for the\n high-resolution ADC. This command is not effective for the\n measurements using pulse.\n\n Args:\n number: 1 to 1023, or -1 to -1...
[ { "param": "self", "type": null }, { "param": "number", "type": "int" }, { "param": "mode", "type": "Optional[Union[constants.AV.Mode, int]]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "number", "type": "int", "docstring": "\n\nFor positive number input...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
bc
'MessageBuilder'
def bc(self) -> 'MessageBuilder': """ The BC command clears the output data buffer that stores measurement data and query command response data. This command does not change the measurement settings. Note: Multi command statement is not allowed for this command. """ ...
The BC command clears the output data buffer that stores measurement data and query command response data. This command does not change the measurement settings. Note: Multi command statement is not allowed for this command.
The BC command clears the output data buffer that stores measurement data and query command response data. This command does not change the measurement settings. Multi command statement is not allowed for this command.
[ "The", "BC", "command", "clears", "the", "output", "data", "buffer", "that", "stores", "measurement", "data", "and", "query", "command", "response", "data", ".", "This", "command", "does", "not", "change", "the", "measurement", "settings", ".", "Multi", "comma...
def bc(self) -> 'MessageBuilder': cmd = 'BC' self._msg.append(cmd) return self
[ "def", "bc", "(", "self", ")", "->", "'MessageBuilder'", ":", "cmd", "=", "'BC'", "self", ".", "_msg", ".", "append", "(", "cmd", ")", "return", "self" ]
The BC command clears the output data buffer that stores measurement data and query command response data.
[ "The", "BC", "command", "clears", "the", "output", "data", "buffer", "that", "stores", "measurement", "data", "and", "query", "command", "response", "data", "." ]
[ "\"\"\"\n The BC command clears the output data buffer that stores measurement\n data and query command response data. This command does not change\n the measurement settings.\n\n Note: Multi command statement is not allowed for this command.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
bdm
'MessageBuilder'
def bdm(self, interval: Union[constants.BDM.Interval, int], mode: Optional[Union[constants.BDM.Mode, int]] = None ) -> 'MessageBuilder': """ The BDM command specifies the settling detection interval and the measurement mode; voltage or current, for the quasi-p...
The BDM command specifies the settling detection interval and the measurement mode; voltage or current, for the quasi-pulsed measurements. Remarks: The following conditions must be true to perform the measurement successfully: When interval=0: A > 1 V/ms and B <= 3 s Wh...
The BDM command specifies the settling detection interval and the measurement mode; voltage or current, for the quasi-pulsed measurements. The following conditions must be true to perform the measurement successfully: When interval=0: A > 1 V/ms and B <= 3 s When interval=1: A > 0.1 V/ms and B <= 12 s where A means th...
[ "The", "BDM", "command", "specifies", "the", "settling", "detection", "interval", "and", "the", "measurement", "mode", ";", "voltage", "or", "current", "for", "the", "quasi", "-", "pulsed", "measurements", ".", "The", "following", "conditions", "must", "be", "...
def bdm(self, interval: Union[constants.BDM.Interval, int], mode: Optional[Union[constants.BDM.Mode, int]] = None ) -> 'MessageBuilder': cmd = f'BDM {interval}' if mode is not None: cmd += f',{mode}' self._msg.append(cmd) return self
[ "def", "bdm", "(", "self", ",", "interval", ":", "Union", "[", "constants", ".", "BDM", ".", "Interval", ",", "int", "]", ",", "mode", ":", "Optional", "[", "Union", "[", "constants", ".", "BDM", ".", "Mode", ",", "int", "]", "]", "=", "None", ")...
The BDM command specifies the settling detection interval and the measurement mode; voltage or current, for the quasi-pulsed measurements.
[ "The", "BDM", "command", "specifies", "the", "settling", "detection", "interval", "and", "the", "measurement", "mode", ";", "voltage", "or", "current", "for", "the", "quasi", "-", "pulsed", "measurements", "." ]
[ "\"\"\"\n The BDM command specifies the settling detection interval and the\n measurement mode; voltage or current, for the quasi-pulsed\n measurements.\n\n Remarks: The following conditions must be true to perform the\n measurement successfully: When interval=0: A > 1 V/ms and B ...
[ { "param": "self", "type": null }, { "param": "interval", "type": "Union[constants.BDM.Interval, int]" }, { "param": "mode", "type": "Optional[Union[constants.BDM.Mode, int]]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "interval", "type": "Union[constants.BDM.Interval, int]", "docstring...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
bdt
'MessageBuilder'
def bdt(self, hold: float, delay: float) -> 'MessageBuilder': """ The BDT command specifies the hold time and delay time for the quasi-pulsed measurements. Args: hold: Hold time (in sec). Numeric expression. 0 to 655.35 s, 0.01 s resolution. Initial setting i...
The BDT command specifies the hold time and delay time for the quasi-pulsed measurements. Args: hold: Hold time (in sec). Numeric expression. 0 to 655.35 s, 0.01 s resolution. Initial setting is 0. delay: Delay time (in sec). Numeric expression. 0 to 6....
The BDT command specifies the hold time and delay time for the quasi-pulsed measurements.
[ "The", "BDT", "command", "specifies", "the", "hold", "time", "and", "delay", "time", "for", "the", "quasi", "-", "pulsed", "measurements", "." ]
def bdt(self, hold: float, delay: float) -> 'MessageBuilder': cmd = f'BDT {hold},{delay}' self._msg.append(cmd) return self
[ "def", "bdt", "(", "self", ",", "hold", ":", "float", ",", "delay", ":", "float", ")", "->", "'MessageBuilder'", ":", "cmd", "=", "f'BDT {hold},{delay}'", "self", ".", "_msg", ".", "append", "(", "cmd", ")", "return", "self" ]
The BDT command specifies the hold time and delay time for the quasi-pulsed measurements.
[ "The", "BDT", "command", "specifies", "the", "hold", "time", "and", "delay", "time", "for", "the", "quasi", "-", "pulsed", "measurements", "." ]
[ "\"\"\"\n The BDT command specifies the hold time and delay time for the\n quasi-pulsed measurements.\n\n Args:\n hold: Hold time (in sec). Numeric expression. 0 to 655.35 s,\n 0.01 s resolution. Initial setting is 0.\n\n delay: Delay time (in sec). Numeric ...
[ { "param": "self", "type": null }, { "param": "hold", "type": "float" }, { "param": "delay", "type": "float" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "hold", "type": "float", "docstring": "Hold time (in sec). Numeric e...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
bdv
'MessageBuilder'
def bdv(self, chnum: Union[constants.ChNr, int], v_range: Union[constants.VOutputRange, int], start: float, stop: float, i_comp: Optional[float] = None ) -> 'MessageBuilder': """ The BDV command specifies the quasi-pulsed voltage so...
The BDV command specifies the quasi-pulsed voltage source and its parameters. Remarks: The time forcing the stop value will be approximately 1.5 ms to 1.8 ms with the following settings: - BDM, BDT command parameters: interval=0, mode=0, delay=0 - AV or AAD/AI...
The BDV command specifies the quasi-pulsed voltage source and its parameters. The time forcing the stop value will be approximately 1.5 ms to 1.8 ms with the following settings. BDM, BDT command parameters: interval=0, mode=0, delay=0 AV or AAD/AIT command parameters: initial setting
[ "The", "BDV", "command", "specifies", "the", "quasi", "-", "pulsed", "voltage", "source", "and", "its", "parameters", ".", "The", "time", "forcing", "the", "stop", "value", "will", "be", "approximately", "1", ".", "5", "ms", "to", "1", ".", "8", "ms", ...
def bdv(self, chnum: Union[constants.ChNr, int], v_range: Union[constants.VOutputRange, int], start: float, stop: float, i_comp: Optional[float] = None ) -> 'MessageBuilder': cmd = f'BDV {chnum},{v_range},{start},{stop}' if i_comp i...
[ "def", "bdv", "(", "self", ",", "chnum", ":", "Union", "[", "constants", ".", "ChNr", ",", "int", "]", ",", "v_range", ":", "Union", "[", "constants", ".", "VOutputRange", ",", "int", "]", ",", "start", ":", "float", ",", "stop", ":", "float", ",",...
The BDV command specifies the quasi-pulsed voltage source and its parameters.
[ "The", "BDV", "command", "specifies", "the", "quasi", "-", "pulsed", "voltage", "source", "and", "its", "parameters", "." ]
[ "\"\"\"\n The BDV command specifies the quasi-pulsed voltage source and its\n parameters.\n\n Remarks: The time forcing the stop value will be approximately\n 1.5 ms to 1.8 ms with the following settings:\n\n - BDM, BDT command parameters: interval=0, mode=0, delay=0\n\n ...
[ { "param": "self", "type": null }, { "param": "chnum", "type": "Union[constants.ChNr, int]" }, { "param": "v_range", "type": "Union[constants.VOutputRange, int]" }, { "param": "start", "type": "float" }, { "param": "stop", "type": "float" }, { "param":...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "chnum", "type": "Union[constants.ChNr, int]", "docstring": "SMU sou...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
bgi
'MessageBuilder'
def bgi(self, chnum: Union[constants.ChNr, int], searchmode: Union[constants.BinarySearchMode, int], stop_condition: Union[float, int], i_range: Union[constants.IMeasRange, int], target: float ) -> 'MessageBuilder': """ The BGI comm...
The BGI command sets the current monitor channel for the binary search measurement (MM15). This command setting clears, and is cleared by, the BGV command setting. This command ignores the RI command setting. Remarks: In the limit search mode, if search cannot find the search ...
The BGI command sets the current monitor channel for the binary search measurement (MM15). This command setting clears, and is cleared by, the BGV command setting. This command ignores the RI command setting. In the limit search mode, if search cannot find the search target and the following two conditions are satisf...
[ "The", "BGI", "command", "sets", "the", "current", "monitor", "channel", "for", "the", "binary", "search", "measurement", "(", "MM15", ")", ".", "This", "command", "setting", "clears", "and", "is", "cleared", "by", "the", "BGV", "command", "setting", ".", ...
def bgi(self, chnum: Union[constants.ChNr, int], searchmode: Union[constants.BinarySearchMode, int], stop_condition: Union[float, int], i_range: Union[constants.IMeasRange, int], target: float ) -> 'MessageBuilder': cmd = f'BGI {chnum},{sea...
[ "def", "bgi", "(", "self", ",", "chnum", ":", "Union", "[", "constants", ".", "ChNr", ",", "int", "]", ",", "searchmode", ":", "Union", "[", "constants", ".", "BinarySearchMode", ",", "int", "]", ",", "stop_condition", ":", "Union", "[", "float", ",", ...
The BGI command sets the current monitor channel for the binary search measurement (MM15).
[ "The", "BGI", "command", "sets", "the", "current", "monitor", "channel", "for", "the", "binary", "search", "measurement", "(", "MM15", ")", "." ]
[ "\"\"\"\n The BGI command sets the current monitor channel for the binary\n search measurement (MM15). This command setting clears, and is\n cleared by, the BGV command setting.\n\n This command ignores the RI command setting.\n\n Remarks: In the limit search mode, if search canno...
[ { "param": "self", "type": null }, { "param": "chnum", "type": "Union[constants.ChNr, int]" }, { "param": "searchmode", "type": "Union[constants.BinarySearchMode, int]" }, { "param": "stop_condition", "type": "Union[float, int]" }, { "param": "i_range", "type"...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "chnum", "type": "Union[constants.ChNr, int]", "docstring": "SMU sea...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
bgv
'MessageBuilder'
def bgv(self, chnum: Union[constants.ChNr, int], searchmode: Union[constants.BinarySearchMode, int], stop_condition: Union[float, int], v_range: Union[constants.VMeasRange, int], target: float ) -> 'MessageBuilder': """ The BGV comm...
The BGV command specifies the voltage monitor channel and its search parameters for the binary search measurement (MM15). This command setting clears, and is cleared by, the BGI command setting. This command ignores the RV command setting. Remarks: In the limit search mode, if ...
The BGV command specifies the voltage monitor channel and its search parameters for the binary search measurement (MM15). This command setting clears, and is cleared by, the BGI command setting. This command ignores the RV command setting. In the limit search mode, if search cannot find the search target and the follo...
[ "The", "BGV", "command", "specifies", "the", "voltage", "monitor", "channel", "and", "its", "search", "parameters", "for", "the", "binary", "search", "measurement", "(", "MM15", ")", ".", "This", "command", "setting", "clears", "and", "is", "cleared", "by", ...
def bgv(self, chnum: Union[constants.ChNr, int], searchmode: Union[constants.BinarySearchMode, int], stop_condition: Union[float, int], v_range: Union[constants.VMeasRange, int], target: float ) -> 'MessageBuilder': cmd = f'BGV {chnum},{sea...
[ "def", "bgv", "(", "self", ",", "chnum", ":", "Union", "[", "constants", ".", "ChNr", ",", "int", "]", ",", "searchmode", ":", "Union", "[", "constants", ".", "BinarySearchMode", ",", "int", "]", ",", "stop_condition", ":", "Union", "[", "float", ",", ...
The BGV command specifies the voltage monitor channel and its search parameters for the binary search measurement (MM15).
[ "The", "BGV", "command", "specifies", "the", "voltage", "monitor", "channel", "and", "its", "search", "parameters", "for", "the", "binary", "search", "measurement", "(", "MM15", ")", "." ]
[ "\"\"\"\n The BGV command specifies the voltage monitor channel and its search\n parameters for the binary search measurement (MM15). This command\n setting clears, and is cleared by, the BGI command setting. This\n command ignores the RV command setting.\n\n Remarks: In the limit...
[ { "param": "self", "type": null }, { "param": "chnum", "type": "Union[constants.ChNr, int]" }, { "param": "searchmode", "type": "Union[constants.BinarySearchMode, int]" }, { "param": "stop_condition", "type": "Union[float, int]" }, { "param": "v_range", "type"...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "chnum", "type": "Union[constants.ChNr, int]", "docstring": "SMU sea...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
bsi
'MessageBuilder'
def bsi(self, chnum: Union[constants.ChNr, int], i_range: Union[constants.IOutputRange, int], start: float, stop: float, v_comp: Optional[float] = None ) -> 'MessageBuilder': """ The BSI command sets the current search source for th...
The BSI command sets the current search source for the binary search measurement (MM15). After search stops, the search channel forces the value specified by the BSM command. This command clears the BSV, BSSI, and BSSV command settings. This command setting is cleared by the BS...
The BSI command sets the current search source for the binary search measurement (MM15). After search stops, the search channel forces the value specified by the BSM command. This command clears the BSV, BSSI, and BSSV command settings. This command setting is cleared by the BSV command. Execution conditions: If Vcom...
[ "The", "BSI", "command", "sets", "the", "current", "search", "source", "for", "the", "binary", "search", "measurement", "(", "MM15", ")", ".", "After", "search", "stops", "the", "search", "channel", "forces", "the", "value", "specified", "by", "the", "BSM", ...
def bsi(self, chnum: Union[constants.ChNr, int], i_range: Union[constants.IOutputRange, int], start: float, stop: float, v_comp: Optional[float] = None ) -> 'MessageBuilder': cmd = f'BSI {chnum},{i_range},{start},{stop}' if v_comp i...
[ "def", "bsi", "(", "self", ",", "chnum", ":", "Union", "[", "constants", ".", "ChNr", ",", "int", "]", ",", "i_range", ":", "Union", "[", "constants", ".", "IOutputRange", ",", "int", "]", ",", "start", ":", "float", ",", "stop", ":", "float", ",",...
The BSI command sets the current search source for the binary search measurement (MM15).
[ "The", "BSI", "command", "sets", "the", "current", "search", "source", "for", "the", "binary", "search", "measurement", "(", "MM15", ")", "." ]
[ "\"\"\"\n The BSI command sets the current search source for the binary search\n measurement (MM15). After search stops, the search channel forces the\n value specified by the BSM command.\n\n This command clears the BSV, BSSI, and BSSV command settings. This\n command setting is ...
[ { "param": "self", "type": null }, { "param": "chnum", "type": "Union[constants.ChNr, int]" }, { "param": "i_range", "type": "Union[constants.IOutputRange, int]" }, { "param": "start", "type": "float" }, { "param": "stop", "type": "float" }, { "param":...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "chnum", "type": "Union[constants.ChNr, int]", "docstring": "SMU sea...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
bssi
'MessageBuilder'
def bssi(self, chnum: Union[constants.ChNr, int], polarity: Union[constants.Polarity, int], offset: float, v_comp: Optional[float] = None ) -> 'MessageBuilder': """ The BSSI command sets the synchronous current source for the binary ...
The BSSI command sets the synchronous current source for the binary search measurement (MM15). The synchronous source output will be: Synchronous source output = polarity * BSI source output + offset where BSI source output means the output set by the BSI command. This command s...
The BSSI command sets the synchronous current source for the binary search measurement (MM15). The synchronous source output will be: Synchronous source output = polarity * BSI source output + offset where BSI source output means the output set by the BSI command. This command setting is cleared by the BSV/BSI command....
[ "The", "BSSI", "command", "sets", "the", "synchronous", "current", "source", "for", "the", "binary", "search", "measurement", "(", "MM15", ")", ".", "The", "synchronous", "source", "output", "will", "be", ":", "Synchronous", "source", "output", "=", "polarity"...
def bssi(self, chnum: Union[constants.ChNr, int], polarity: Union[constants.Polarity, int], offset: float, v_comp: Optional[float] = None ) -> 'MessageBuilder': cmd = f'BSSI {chnum},{polarity},{offset}' if v_comp is not None: c...
[ "def", "bssi", "(", "self", ",", "chnum", ":", "Union", "[", "constants", ".", "ChNr", ",", "int", "]", ",", "polarity", ":", "Union", "[", "constants", ".", "Polarity", ",", "int", "]", ",", "offset", ":", "float", ",", "v_comp", ":", "Optional", ...
The BSSI command sets the synchronous current source for the binary search measurement (MM15).
[ "The", "BSSI", "command", "sets", "the", "synchronous", "current", "source", "for", "the", "binary", "search", "measurement", "(", "MM15", ")", "." ]
[ "\"\"\"\n The BSSI command sets the synchronous current source for the binary\n search measurement (MM15). The synchronous source output will be:\n Synchronous source output = polarity * BSI source output + offset\n where BSI source output means the output set by the BSI command. This\n ...
[ { "param": "self", "type": null }, { "param": "chnum", "type": "Union[constants.ChNr, int]" }, { "param": "polarity", "type": "Union[constants.Polarity, int]" }, { "param": "offset", "type": "float" }, { "param": "v_comp", "type": "Optional[float]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "chnum", "type": "Union[constants.ChNr, int]", "docstring": "SMU syn...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
bssv
'MessageBuilder'
def bssv(self, chnum: Union[constants.ChNr, int], polarity: Union[constants.Polarity, int], offset: float, i_comp: Optional[float] = None ) -> 'MessageBuilder': """ The BSSV command sets the synchronous voltage source for the binary ...
The BSSV command sets the synchronous voltage source for the binary search measurement (MM15). The synchronous source output will be: Synchronous source output = polarity * BSV source output + offset where BSV source output means the output set by the BSV command. This command s...
The BSSV command sets the synchronous voltage source for the binary search measurement (MM15). The synchronous source output will be: Synchronous source output = polarity * BSV source output + offset where BSV source output means the output set by the BSV command. This command setting is cleared by the BSI/BSV command....
[ "The", "BSSV", "command", "sets", "the", "synchronous", "voltage", "source", "for", "the", "binary", "search", "measurement", "(", "MM15", ")", ".", "The", "synchronous", "source", "output", "will", "be", ":", "Synchronous", "source", "output", "=", "polarity"...
def bssv(self, chnum: Union[constants.ChNr, int], polarity: Union[constants.Polarity, int], offset: float, i_comp: Optional[float] = None ) -> 'MessageBuilder': cmd = f'BSSV {chnum},{polarity},{offset}' if i_comp is not None: c...
[ "def", "bssv", "(", "self", ",", "chnum", ":", "Union", "[", "constants", ".", "ChNr", ",", "int", "]", ",", "polarity", ":", "Union", "[", "constants", ".", "Polarity", ",", "int", "]", ",", "offset", ":", "float", ",", "i_comp", ":", "Optional", ...
The BSSV command sets the synchronous voltage source for the binary search measurement (MM15).
[ "The", "BSSV", "command", "sets", "the", "synchronous", "voltage", "source", "for", "the", "binary", "search", "measurement", "(", "MM15", ")", "." ]
[ "\"\"\"\n The BSSV command sets the synchronous voltage source for the binary\n search measurement (MM15). The synchronous source output will be:\n Synchronous source output = polarity * BSV source output + offset\n where BSV source output means the output set by the BSV command. This\n ...
[ { "param": "self", "type": null }, { "param": "chnum", "type": "Union[constants.ChNr, int]" }, { "param": "polarity", "type": "Union[constants.Polarity, int]" }, { "param": "offset", "type": "float" }, { "param": "i_comp", "type": "Optional[float]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "chnum", "type": "Union[constants.ChNr, int]", "docstring": "SMU syn...
5ca186241de23e50263904bdf08349f5c8eddcce
jakeogh/Qcodes
qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py
[ "MIT" ]
Python
bst
'MessageBuilder'
def bst(self, hold: float, delay: float) -> 'MessageBuilder': """ The BST command sets the hold time and delay time for the binary search measurement (MM15). If you do not enter this command, all parameters are set to 0. Args: hold: Hold time (in seconds) that is the...
The BST command sets the hold time and delay time for the binary search measurement (MM15). If you do not enter this command, all parameters are set to 0. Args: hold: Hold time (in seconds) that is the wait time after starting the search measurement and befo...
The BST command sets the hold time and delay time for the binary search measurement (MM15). If you do not enter this command, all parameters are set to 0.
[ "The", "BST", "command", "sets", "the", "hold", "time", "and", "delay", "time", "for", "the", "binary", "search", "measurement", "(", "MM15", ")", ".", "If", "you", "do", "not", "enter", "this", "command", "all", "parameters", "are", "set", "to", "0", ...
def bst(self, hold: float, delay: float) -> 'MessageBuilder': cmd = f'BST {hold},{delay}' self._msg.append(cmd) return self
[ "def", "bst", "(", "self", ",", "hold", ":", "float", ",", "delay", ":", "float", ")", "->", "'MessageBuilder'", ":", "cmd", "=", "f'BST {hold},{delay}'", "self", ".", "_msg", ".", "append", "(", "cmd", ")", "return", "self" ]
The BST command sets the hold time and delay time for the binary search measurement (MM15).
[ "The", "BST", "command", "sets", "the", "hold", "time", "and", "delay", "time", "for", "the", "binary", "search", "measurement", "(", "MM15", ")", "." ]
[ "\"\"\"\n The BST command sets the hold time and delay time for the binary\n search measurement (MM15). If you do not enter this command,\n all parameters are set to 0.\n\n Args:\n hold: Hold time (in seconds) that is the wait time after\n starting the search me...
[ { "param": "self", "type": null }, { "param": "hold", "type": "float" }, { "param": "delay", "type": "float" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "hold", "type": "float", "docstring": "Hold time (in seconds) that i...