body_hash
stringlengths
64
64
body
stringlengths
23
109k
docstring
stringlengths
1
57k
path
stringlengths
4
198
name
stringlengths
1
115
repository_name
stringlengths
7
111
repository_stars
float64
0
191k
lang
stringclasses
1 value
body_without_docstring
stringlengths
14
108k
unified
stringlengths
45
133k
5e2a75d3e9b1caae057acba9d808c83beca09416d138e005c9d038f51006ddd4
def might_contains_all(self, collection): '\n The might_contains_all method enables you to check if Bloom Filter may contains each element from collection.\n\n :param collection: a collection with elements to be checked.\n :return: True if Bloom Filter can contains each element (Remember that c...
The might_contains_all method enables you to check if Bloom Filter may contains each element from collection. :param collection: a collection with elements to be checked. :return: True if Bloom Filter can contains each element (Remember that can be false positive result). False if Bloom Filter cannot contains ...
bloom_filter.py
might_contains_all
DahDev/BloomFilter-Python
0
python
def might_contains_all(self, collection): '\n The might_contains_all method enables you to check if Bloom Filter may contains each element from collection.\n\n :param collection: a collection with elements to be checked.\n :return: True if Bloom Filter can contains each element (Remember that c...
def might_contains_all(self, collection): '\n The might_contains_all method enables you to check if Bloom Filter may contains each element from collection.\n\n :param collection: a collection with elements to be checked.\n :return: True if Bloom Filter can contains each element (Remember that c...
e3ab5d0c620020b6cfb2775f8d3a01a447f11e5c7f62c5f9dddb628f9ee1b983
def get_expected_probability_of_false_positives(self): '\n The get_expected_probability_of_false_positives method enables you to get expected probability of false positives.\n\n :return: expected probability of false positives.\n ' return self.get_probability_of_false_positives(self.expecte...
The get_expected_probability_of_false_positives method enables you to get expected probability of false positives. :return: expected probability of false positives.
bloom_filter.py
get_expected_probability_of_false_positives
DahDev/BloomFilter-Python
0
python
def get_expected_probability_of_false_positives(self): '\n The get_expected_probability_of_false_positives method enables you to get expected probability of false positives.\n\n :return: expected probability of false positives.\n ' return self.get_probability_of_false_positives(self.expecte...
def get_expected_probability_of_false_positives(self): '\n The get_expected_probability_of_false_positives method enables you to get expected probability of false positives.\n\n :return: expected probability of false positives.\n ' return self.get_probability_of_false_positives(self.expecte...
fc939373dbeeb86897684ee649b9b5827018fecf11b29902807619d75ced591d
def get_current_probability_of_false_positives(self): '\n The get_current_probability_of_false_positives method enables you to get actual probability of false positives.\n\n :return: actual probability of false positives.\n ' return self.get_probability_of_false_positives(self.number_of_ele...
The get_current_probability_of_false_positives method enables you to get actual probability of false positives. :return: actual probability of false positives.
bloom_filter.py
get_current_probability_of_false_positives
DahDev/BloomFilter-Python
0
python
def get_current_probability_of_false_positives(self): '\n The get_current_probability_of_false_positives method enables you to get actual probability of false positives.\n\n :return: actual probability of false positives.\n ' return self.get_probability_of_false_positives(self.number_of_ele...
def get_current_probability_of_false_positives(self): '\n The get_current_probability_of_false_positives method enables you to get actual probability of false positives.\n\n :return: actual probability of false positives.\n ' return self.get_probability_of_false_positives(self.number_of_ele...
6c58d017ce2314830f258a9f67727010a51d66a0e861cb44f3e5216c06904256
def get_probability_of_false_positives(self, number_of_elements): '\n The get_probability_of_false_positives method enables you to get probability of false positives based on parameter.\n\n :param number_of_elements: a number of elements in Bloom Filter.\n :return: probability of false positive...
The get_probability_of_false_positives method enables you to get probability of false positives based on parameter. :param number_of_elements: a number of elements in Bloom Filter. :return: probability of false positives based on parameter.
bloom_filter.py
get_probability_of_false_positives
DahDev/BloomFilter-Python
0
python
def get_probability_of_false_positives(self, number_of_elements): '\n The get_probability_of_false_positives method enables you to get probability of false positives based on parameter.\n\n :param number_of_elements: a number of elements in Bloom Filter.\n :return: probability of false positive...
def get_probability_of_false_positives(self, number_of_elements): '\n The get_probability_of_false_positives method enables you to get probability of false positives based on parameter.\n\n :param number_of_elements: a number of elements in Bloom Filter.\n :return: probability of false positive...
7400451106f072d6ba603d468d6bb26f0dd22e8c99812b085df2835c13d6d4cd
def clear(self): '\n The clear method enables you to delete all elements from Bloom Filter.\n ' self.number_of_elements = 0 self.bit_set.setall(0)
The clear method enables you to delete all elements from Bloom Filter.
bloom_filter.py
clear
DahDev/BloomFilter-Python
0
python
def clear(self): '\n \n ' self.number_of_elements = 0 self.bit_set.setall(0)
def clear(self): '\n \n ' self.number_of_elements = 0 self.bit_set.setall(0)<|docstring|>The clear method enables you to delete all elements from Bloom Filter.<|endoftext|>
61afff7d5ab655ebd00bf4cb3db381bca68bdfff38374438242bed1a6210018c
def is_empty(self): '\n The is_empty method enables you to check if Bloom Filter is empty.\n\n :return: True, if Bloom Filter is empty.\n False, if Bloom Filter is not empty.\n ' return (self.number_of_elements == 0)
The is_empty method enables you to check if Bloom Filter is empty. :return: True, if Bloom Filter is empty. False, if Bloom Filter is not empty.
bloom_filter.py
is_empty
DahDev/BloomFilter-Python
0
python
def is_empty(self): '\n The is_empty method enables you to check if Bloom Filter is empty.\n\n :return: True, if Bloom Filter is empty.\n False, if Bloom Filter is not empty.\n ' return (self.number_of_elements == 0)
def is_empty(self): '\n The is_empty method enables you to check if Bloom Filter is empty.\n\n :return: True, if Bloom Filter is empty.\n False, if Bloom Filter is not empty.\n ' return (self.number_of_elements == 0)<|docstring|>The is_empty method enables you to check if Blo...
f4e6c9c720800ad521e01057f3dbaa7b635941d7102c9c4b981aaf0dc70c21cc
def get_bits_per_element(self): '\n The get_bits_per_element method enables you to get actual bits per element.\n\n :return: actual bits per element.\n :raise ValueError: when actual number of inserted element = 0.\n ' if (self.number_of_elements <= 0): raise ValueError('Bloo...
The get_bits_per_element method enables you to get actual bits per element. :return: actual bits per element. :raise ValueError: when actual number of inserted element = 0.
bloom_filter.py
get_bits_per_element
DahDev/BloomFilter-Python
0
python
def get_bits_per_element(self): '\n The get_bits_per_element method enables you to get actual bits per element.\n\n :return: actual bits per element.\n :raise ValueError: when actual number of inserted element = 0.\n ' if (self.number_of_elements <= 0): raise ValueError('Bloo...
def get_bits_per_element(self): '\n The get_bits_per_element method enables you to get actual bits per element.\n\n :return: actual bits per element.\n :raise ValueError: when actual number of inserted element = 0.\n ' if (self.number_of_elements <= 0): raise ValueError('Bloo...
70f078ff2a466735e405309f5f5e1436f947a9e0a7ed7eb97f8ec8aacaa3b9bc
def get_value_from_generated_hash(self, data, hash_func): '\n The get_value_from_generated_hash method enables you to get value from created hash.\n :param data: data to hash.\n :param hash_func: hash function.\n :return: value from hash.\n ' h = hash_func(data) return int...
The get_value_from_generated_hash method enables you to get value from created hash. :param data: data to hash. :param hash_func: hash function. :return: value from hash.
bloom_filter.py
get_value_from_generated_hash
DahDev/BloomFilter-Python
0
python
def get_value_from_generated_hash(self, data, hash_func): '\n The get_value_from_generated_hash method enables you to get value from created hash.\n :param data: data to hash.\n :param hash_func: hash function.\n :return: value from hash.\n ' h = hash_func(data) return int...
def get_value_from_generated_hash(self, data, hash_func): '\n The get_value_from_generated_hash method enables you to get value from created hash.\n :param data: data to hash.\n :param hash_func: hash function.\n :return: value from hash.\n ' h = hash_func(data) return int...
8a5e41570662b4dce802443b2adec3d091035eb5137be69718b5f09f97a27f18
def __repr__(self): 'Just the binding, without the id key.' return ('<NexusPortBinding(%s,%s,%s,%s)>' % (self.port_id, self.vlan_id, self.switch_ip, self.instance_id))
Just the binding, without the id key.
neutron/plugins/ml2/drivers/cisco/nexus/nexus_models_v2.py
__repr__
leenheer/neutron
10
python
def __repr__(self): return ('<NexusPortBinding(%s,%s,%s,%s)>' % (self.port_id, self.vlan_id, self.switch_ip, self.instance_id))
def __repr__(self): return ('<NexusPortBinding(%s,%s,%s,%s)>' % (self.port_id, self.vlan_id, self.switch_ip, self.instance_id))<|docstring|>Just the binding, without the id key.<|endoftext|>
76711a3e7c14f7bd87da566489ee3857322434a4fd4a4c13353f84edf76dcff6
def __eq__(self, other): 'Compare only the binding, without the id key.' return ((self.port_id == other.port_id) and (self.vlan_id == other.vlan_id) and (self.switch_ip == other.switch_ip) and (self.instance_id == other.instance_id))
Compare only the binding, without the id key.
neutron/plugins/ml2/drivers/cisco/nexus/nexus_models_v2.py
__eq__
leenheer/neutron
10
python
def __eq__(self, other): return ((self.port_id == other.port_id) and (self.vlan_id == other.vlan_id) and (self.switch_ip == other.switch_ip) and (self.instance_id == other.instance_id))
def __eq__(self, other): return ((self.port_id == other.port_id) and (self.vlan_id == other.vlan_id) and (self.switch_ip == other.switch_ip) and (self.instance_id == other.instance_id))<|docstring|>Compare only the binding, without the id key.<|endoftext|>
f1a3fcda082c7569158022d73db707063500c5ab114460d1ca660e0418bfcacb
def save(self, *args, **kwargs): 'Automatically create the root index template node' super(Index, self).save(*args, **kwargs) IndexTemplateNode.objects.get_or_create(parent=None, index=self)
Automatically create the root index template node
mayan/apps/document_indexing/models.py
save
camerondphillips/MAYAN
0
python
def save(self, *args, **kwargs): super(Index, self).save(*args, **kwargs) IndexTemplateNode.objects.get_or_create(parent=None, index=self)
def save(self, *args, **kwargs): super(Index, self).save(*args, **kwargs) IndexTemplateNode.objects.get_or_create(parent=None, index=self)<|docstring|>Automatically create the root index template node<|endoftext|>
01515429f2a610c264191db43d035660f26a17bb89f538f682311be6600efe74
@classmethod def from_dict(cls, json_object): 'Constructs a `TransformerConfig` from a Python dictionary of parameters.' _params = {} for key in json_object: _params[key] = json_object[key] return cls(**_params)
Constructs a `TransformerConfig` from a Python dictionary of parameters.
research/nlp/atae_lstm/src/config.py
from_dict
mindspore-ai/models
77
python
@classmethod def from_dict(cls, json_object): _params = {} for key in json_object: _params[key] = json_object[key] return cls(**_params)
@classmethod def from_dict(cls, json_object): _params = {} for key in json_object: _params[key] = json_object[key] return cls(**_params)<|docstring|>Constructs a `TransformerConfig` from a Python dictionary of parameters.<|endoftext|>
95d0be5850c506a8d7eb40c36ed75e457f14ef4312338825838d300313834049
@classmethod def from_json_file(cls, json_file): 'Constructs a `TransformerConfig` from a json file of parameters.' with open(json_file, 'r') as reader: return cls.from_dict(json.load(reader))
Constructs a `TransformerConfig` from a json file of parameters.
research/nlp/atae_lstm/src/config.py
from_json_file
mindspore-ai/models
77
python
@classmethod def from_json_file(cls, json_file): with open(json_file, 'r') as reader: return cls.from_dict(json.load(reader))
@classmethod def from_json_file(cls, json_file): with open(json_file, 'r') as reader: return cls.from_dict(json.load(reader))<|docstring|>Constructs a `TransformerConfig` from a json file of parameters.<|endoftext|>
37a2fabbf34fa196634b773ab45b7ac4538bf22fac31b1fd44b21c3fd84c33ea
def extractUnreliabletranslationsWordpressCom(item): "\n\tParser for 'unreliabletranslations.wordpress.com'\n\t" (vol, chp, frag, postfix) = extractVolChapterFragmentPostfix(item['title']) if ((not (chp or vol)) or ('preview' in item['title'].lower())): return None if ((item['tags'] == ['5:50'])...
Parser for 'unreliabletranslations.wordpress.com'
WebMirror/management/rss_parser_funcs/feed_parse_extractUnreliabletranslationsWordpressCom.py
extractUnreliabletranslationsWordpressCom
fake-name/ReadableWebProxy
193
python
def extractUnreliabletranslationsWordpressCom(item): "\n\t\n\t" (vol, chp, frag, postfix) = extractVolChapterFragmentPostfix(item['title']) if ((not (chp or vol)) or ('preview' in item['title'].lower())): return None if ((item['tags'] == ['5:50']) and (chp != 5)): return buildReleaseMess...
def extractUnreliabletranslationsWordpressCom(item): "\n\t\n\t" (vol, chp, frag, postfix) = extractVolChapterFragmentPostfix(item['title']) if ((not (chp or vol)) or ('preview' in item['title'].lower())): return None if ((item['tags'] == ['5:50']) and (chp != 5)): return buildReleaseMess...
97f7d23deeeb0fcabaa390c3f2601ed60b8fa032a9c70b7cd2549e3029c300bb
@blueprint.app_template_global() def add_page_arg(args, page) -> dict[(str, Any)]: "Add the 'page' value.\n\n Used for pagination.\n " if (args is None): args = {} args['page'] = page return args
Add the 'page' value. Used for pagination.
byceps/blueprints/common/core/views.py
add_page_arg
GSH-LAN/byceps
0
python
@blueprint.app_template_global() def add_page_arg(args, page) -> dict[(str, Any)]: "Add the 'page' value.\n\n Used for pagination.\n " if (args is None): args = {} args['page'] = page return args
@blueprint.app_template_global() def add_page_arg(args, page) -> dict[(str, Any)]: "Add the 'page' value.\n\n Used for pagination.\n " if (args is None): args = {} args['page'] = page return args<|docstring|>Add the 'page' value. Used for pagination.<|endoftext|>
3c41e707c480d369ad026830373450a0a4d7ad76ccd17eaa90d662b623acfb85
def betterThan(self, point2compare, altLinInEq=False, bestFeasiblePoint=None): '\n usage: result = involvedPoint.better(pointToCompare)\n\n returns True if the involvedPoint is better than pointToCompare\n and False otherwise\n (if NOT better, mb same fval and same residuals or residuals...
usage: result = involvedPoint.better(pointToCompare) returns True if the involvedPoint is better than pointToCompare and False otherwise (if NOT better, mb same fval and same residuals or residuals less than desired contol)
OpenOpt/openopt/kernel/Point.py
betterThan
PythonCharmers/OOSuite
5
python
def betterThan(self, point2compare, altLinInEq=False, bestFeasiblePoint=None): '\n usage: result = involvedPoint.better(pointToCompare)\n\n returns True if the involvedPoint is better than pointToCompare\n and False otherwise\n (if NOT better, mb same fval and same residuals or residuals...
def betterThan(self, point2compare, altLinInEq=False, bestFeasiblePoint=None): '\n usage: result = involvedPoint.better(pointToCompare)\n\n returns True if the involvedPoint is better than pointToCompare\n and False otherwise\n (if NOT better, mb same fval and same residuals or residuals...
33640876126169817242c6db65b9774d82b60368cb0bb0c28069251268d7081c
def eggroll_compute_XY(X, Y): '\n compute X * Y\n :param X: DTable, with shape (feature_dim, sample_dim)\n :param Y: DTable, with shape (feature_dim, sample_dim)\n :return: a DTable\n ' R = X.join(Y, (lambda x, y: (x * y))) val = R.collect() table = dict(val) R.destroy() return ta...
compute X * Y :param X: DTable, with shape (feature_dim, sample_dim) :param Y: DTable, with shape (feature_dim, sample_dim) :return: a DTable
federatedml/ftl/eggroll_computation/util.py
eggroll_compute_XY
bentanust/FedRec
32
python
def eggroll_compute_XY(X, Y): '\n compute X * Y\n :param X: DTable, with shape (feature_dim, sample_dim)\n :param Y: DTable, with shape (feature_dim, sample_dim)\n :return: a DTable\n ' R = X.join(Y, (lambda x, y: (x * y))) val = R.collect() table = dict(val) R.destroy() return ta...
def eggroll_compute_XY(X, Y): '\n compute X * Y\n :param X: DTable, with shape (feature_dim, sample_dim)\n :param Y: DTable, with shape (feature_dim, sample_dim)\n :return: a DTable\n ' R = X.join(Y, (lambda x, y: (x * y))) val = R.collect() table = dict(val) R.destroy() return ta...
be9d6e0d726df44b2c88672a81472f9fc2655d0a3e9e0af3af4d6ac0f949dc02
def eggroll_compute_X_plus_Y(X, Y): '\n compute X + Y\n :param X: DTable, with shape (feature_dim, sample_dim)\n :param Y: DTable, with shape (feature_dim, sample_dim)\n :return: a DTable\n ' R = X.join(Y, (lambda x, y: (x + y))) val = R.collect() table = dict(val) R.destroy() ret...
compute X + Y :param X: DTable, with shape (feature_dim, sample_dim) :param Y: DTable, with shape (feature_dim, sample_dim) :return: a DTable
federatedml/ftl/eggroll_computation/util.py
eggroll_compute_X_plus_Y
bentanust/FedRec
32
python
def eggroll_compute_X_plus_Y(X, Y): '\n compute X + Y\n :param X: DTable, with shape (feature_dim, sample_dim)\n :param Y: DTable, with shape (feature_dim, sample_dim)\n :return: a DTable\n ' R = X.join(Y, (lambda x, y: (x + y))) val = R.collect() table = dict(val) R.destroy() ret...
def eggroll_compute_X_plus_Y(X, Y): '\n compute X + Y\n :param X: DTable, with shape (feature_dim, sample_dim)\n :param Y: DTable, with shape (feature_dim, sample_dim)\n :return: a DTable\n ' R = X.join(Y, (lambda x, y: (x + y))) val = R.collect() table = dict(val) R.destroy() ret...
fecd114533a295137f608ddb94819bd0b85d3c8fbe8ac9ec706cc62a1a6c211b
def eggroll_compute_hSum_XY(X, Y): '\n compute np.sum(X * Y, axis=1)\n :param X: DTable, with shape (feature_dim, sample_dim)\n :param Y: DTable, with shape (feature_dim, sample_dim)\n :return: a DTable\n ' R = X.join(Y, (lambda x, y: np.sum((x * y)))) val = R.collect() table = dict(val) ...
compute np.sum(X * Y, axis=1) :param X: DTable, with shape (feature_dim, sample_dim) :param Y: DTable, with shape (feature_dim, sample_dim) :return: a DTable
federatedml/ftl/eggroll_computation/util.py
eggroll_compute_hSum_XY
bentanust/FedRec
32
python
def eggroll_compute_hSum_XY(X, Y): '\n compute np.sum(X * Y, axis=1)\n :param X: DTable, with shape (feature_dim, sample_dim)\n :param Y: DTable, with shape (feature_dim, sample_dim)\n :return: a DTable\n ' R = X.join(Y, (lambda x, y: np.sum((x * y)))) val = R.collect() table = dict(val) ...
def eggroll_compute_hSum_XY(X, Y): '\n compute np.sum(X * Y, axis=1)\n :param X: DTable, with shape (feature_dim, sample_dim)\n :param Y: DTable, with shape (feature_dim, sample_dim)\n :return: a DTable\n ' R = X.join(Y, (lambda x, y: np.sum((x * y)))) val = R.collect() table = dict(val) ...
ff8137f03ca1580e95cb588781d8679971462b1d89f5ab3ca1b844d5b99b72b1
def eggroll_compute_vAvg_XY(X, Y, sample_dim): '\n compute np.mean(X * Y, axis=0)\n :param X: DTable, with shape (feature_dim, sample_dim)\n :param Y: DTable, with shape (feature_dim, sample_dim) or (1, sample_dim)\n :param feature_dim:\n :param sample_dim:\n :return: a DTable\n ' R = X.joi...
compute np.mean(X * Y, axis=0) :param X: DTable, with shape (feature_dim, sample_dim) :param Y: DTable, with shape (feature_dim, sample_dim) or (1, sample_dim) :param feature_dim: :param sample_dim: :return: a DTable
federatedml/ftl/eggroll_computation/util.py
eggroll_compute_vAvg_XY
bentanust/FedRec
32
python
def eggroll_compute_vAvg_XY(X, Y, sample_dim): '\n compute np.mean(X * Y, axis=0)\n :param X: DTable, with shape (feature_dim, sample_dim)\n :param Y: DTable, with shape (feature_dim, sample_dim) or (1, sample_dim)\n :param feature_dim:\n :param sample_dim:\n :return: a DTable\n ' R = X.joi...
def eggroll_compute_vAvg_XY(X, Y, sample_dim): '\n compute np.mean(X * Y, axis=0)\n :param X: DTable, with shape (feature_dim, sample_dim)\n :param Y: DTable, with shape (feature_dim, sample_dim) or (1, sample_dim)\n :param feature_dim:\n :param sample_dim:\n :return: a DTable\n ' R = X.joi...
e907ae2dcff783e852811dd07085f7a99a418582446f1fbf30f5d10fd9081307
def eggroll_encrypt(public_key, X): '\n encrypt X\n :param X: DTable\n :return: a dictionary\n ' X2 = X.mapValues((lambda x: encrypt_matrix(public_key, x))) val = X2.collect() val = dict(val) X2.destroy() return val
encrypt X :param X: DTable :return: a dictionary
federatedml/ftl/eggroll_computation/util.py
eggroll_encrypt
bentanust/FedRec
32
python
def eggroll_encrypt(public_key, X): '\n encrypt X\n :param X: DTable\n :return: a dictionary\n ' X2 = X.mapValues((lambda x: encrypt_matrix(public_key, x))) val = X2.collect() val = dict(val) X2.destroy() return val
def eggroll_encrypt(public_key, X): '\n encrypt X\n :param X: DTable\n :return: a dictionary\n ' X2 = X.mapValues((lambda x: encrypt_matrix(public_key, x))) val = X2.collect() val = dict(val) X2.destroy() return val<|docstring|>encrypt X :param X: DTable :return: a dictionary<|endoft...
87f5334d5258305321f97715e4773a23f7c07d192e7d81a0af8375359c218b97
def eggroll_decrypt(private_key, X): '\n decrypt X\n :param X: DTable\n :return: a dictionary\n ' X2 = X.mapValues((lambda x: decrypt_matrix(private_key, x))) val = X2.collect() val = dict(val) X2.destroy() return val
decrypt X :param X: DTable :return: a dictionary
federatedml/ftl/eggroll_computation/util.py
eggroll_decrypt
bentanust/FedRec
32
python
def eggroll_decrypt(private_key, X): '\n decrypt X\n :param X: DTable\n :return: a dictionary\n ' X2 = X.mapValues((lambda x: decrypt_matrix(private_key, x))) val = X2.collect() val = dict(val) X2.destroy() return val
def eggroll_decrypt(private_key, X): '\n decrypt X\n :param X: DTable\n :return: a dictionary\n ' X2 = X.mapValues((lambda x: decrypt_matrix(private_key, x))) val = X2.collect() val = dict(val) X2.destroy() return val<|docstring|>decrypt X :param X: DTable :return: a dictionary<|endo...
018e34b502899c3931926aaea2cb00c179e356c4da23a422b086cd34991b5fd6
@mpl.rc_context(fname=CONFIG_FILE) def plot_activity_hours(images: pd.DataFrame, names: Union[(list, str, pd.Series)], kind: str='kde', polar: bool=False, hist_kws: dict=None, kde_kws: dict=None, polar_kws: dict=None) -> Union[(plt.Axes, plt.PolarAxes)]: "\n Plots the activity hours of one or multiple taxa by gr...
Plots the activity hours of one or multiple taxa by grouping all observations into a 24-hour range. Parameters ---------- images : DataFrame DataFrame with the project's images. names : list, str or Series List of names to plot activity hours for. kind : str Type of plot. Values can be: - 'hist' for h...
wiutils/plotting.py
plot_activity_hours
PEM-Humboldt/wiutils
0
python
@mpl.rc_context(fname=CONFIG_FILE) def plot_activity_hours(images: pd.DataFrame, names: Union[(list, str, pd.Series)], kind: str='kde', polar: bool=False, hist_kws: dict=None, kde_kws: dict=None, polar_kws: dict=None) -> Union[(plt.Axes, plt.PolarAxes)]: "\n Plots the activity hours of one or multiple taxa by gr...
@mpl.rc_context(fname=CONFIG_FILE) def plot_activity_hours(images: pd.DataFrame, names: Union[(list, str, pd.Series)], kind: str='kde', polar: bool=False, hist_kws: dict=None, kde_kws: dict=None, polar_kws: dict=None) -> Union[(plt.Axes, plt.PolarAxes)]: "\n Plots the activity hours of one or multiple taxa by gr...
1d9a1965db004d676a40d713986a8eb2035a96b00a0454556135209d83659b05
@mpl.rc_context(fname=CONFIG_FILE) def plot_date_ranges(images: pd.DataFrame=None, deployments: pd.DataFrame=None, source: str='both', **kwargs) -> plt.Axes: "\n Plots deployment date ranges.\n\n Parameters\n ----------\n images : DataFrame\n DataFrame with the project's images.\n deployments ...
Plots deployment date ranges. Parameters ---------- images : DataFrame DataFrame with the project's images. deployments : DataFrame DataFrame with the project's deployments. source : bool Source to plot date ranges from: Values can be: - 'images' to plot date ranges from images (i.e. first image ...
wiutils/plotting.py
plot_date_ranges
PEM-Humboldt/wiutils
0
python
@mpl.rc_context(fname=CONFIG_FILE) def plot_date_ranges(images: pd.DataFrame=None, deployments: pd.DataFrame=None, source: str='both', **kwargs) -> plt.Axes: "\n Plots deployment date ranges.\n\n Parameters\n ----------\n images : DataFrame\n DataFrame with the project's images.\n deployments ...
@mpl.rc_context(fname=CONFIG_FILE) def plot_date_ranges(images: pd.DataFrame=None, deployments: pd.DataFrame=None, source: str='both', **kwargs) -> plt.Axes: "\n Plots deployment date ranges.\n\n Parameters\n ----------\n images : DataFrame\n DataFrame with the project's images.\n deployments ...
84a3f45f807c8aed516c9eab682a98eb69351969a03b88e56460e286c7018817
@mpl.rc_context(fname=CONFIG_FILE) def plot_detection_history(images: pd.DataFrame, deployments: pd.DataFrame, name: str, mask: bool=False, compute_detection_history_kws: dict=None, heatmap_kws: dict=None) -> plt.Axes: "\n Plots detection history matrix for a given species.\n\n Parameters\n ----------\n ...
Plots detection history matrix for a given species. Parameters ---------- images : DataFrame DataFrame with the project's images. deployments : DataFrame DataFrame with the project's deployments. name : str Scientific name of the species to plot the detection history for. mask : bool Whether to mask ce...
wiutils/plotting.py
plot_detection_history
PEM-Humboldt/wiutils
0
python
@mpl.rc_context(fname=CONFIG_FILE) def plot_detection_history(images: pd.DataFrame, deployments: pd.DataFrame, name: str, mask: bool=False, compute_detection_history_kws: dict=None, heatmap_kws: dict=None) -> plt.Axes: "\n Plots detection history matrix for a given species.\n\n Parameters\n ----------\n ...
@mpl.rc_context(fname=CONFIG_FILE) def plot_detection_history(images: pd.DataFrame, deployments: pd.DataFrame, name: str, mask: bool=False, compute_detection_history_kws: dict=None, heatmap_kws: dict=None) -> plt.Axes: "\n Plots detection history matrix for a given species.\n\n Parameters\n ----------\n ...
36c2c6fa14d7d3a4408cd4d218015568f98ff8c3550f2382c250428ea46cc574
def assign_poolinfos_to_allocates_in_primfunc(primfunc, pool_infos): 'Helper to assign poolinfos to allocate nodes in a tir.PrimFunc' def set_poolinfos(stmt): if isinstance(stmt, tvm.tir.Allocate): return tvm.tir.Allocate(buffer_var=stmt.buffer_var, dtype=stmt.dtype, extents=stmt.extents, c...
Helper to assign poolinfos to allocate nodes in a tir.PrimFunc
tests/python/unittest/test_tir_usmp_transform_convert_pool_allocations_to_offsets.py
assign_poolinfos_to_allocates_in_primfunc
billishyahao/tvm
4,640
python
def assign_poolinfos_to_allocates_in_primfunc(primfunc, pool_infos): def set_poolinfos(stmt): if isinstance(stmt, tvm.tir.Allocate): return tvm.tir.Allocate(buffer_var=stmt.buffer_var, dtype=stmt.dtype, extents=stmt.extents, condition=stmt.condition, body=stmt.body, annotations={tvm.tir.us...
def assign_poolinfos_to_allocates_in_primfunc(primfunc, pool_infos): def set_poolinfos(stmt): if isinstance(stmt, tvm.tir.Allocate): return tvm.tir.Allocate(buffer_var=stmt.buffer_var, dtype=stmt.dtype, extents=stmt.extents, condition=stmt.condition, body=stmt.body, annotations={tvm.tir.us...
8d33a285012f4217785e7feddb866074b8e07569366f9b612c6e844c43991d9d
def assign_poolinfos_to_allocates_in_irmodule(mod, pool_infos): 'Helper to assign poolinfos to allocate nodes in a IRModule' ret = tvm.IRModule() for (global_var, basefunc) in mod.functions.items(): if isinstance(basefunc, tvm.tir.PrimFunc): ret[global_var] = assign_poolinfos_to_allocate...
Helper to assign poolinfos to allocate nodes in a IRModule
tests/python/unittest/test_tir_usmp_transform_convert_pool_allocations_to_offsets.py
assign_poolinfos_to_allocates_in_irmodule
billishyahao/tvm
4,640
python
def assign_poolinfos_to_allocates_in_irmodule(mod, pool_infos): ret = tvm.IRModule() for (global_var, basefunc) in mod.functions.items(): if isinstance(basefunc, tvm.tir.PrimFunc): ret[global_var] = assign_poolinfos_to_allocates_in_primfunc(basefunc, pool_infos) return ret
def assign_poolinfos_to_allocates_in_irmodule(mod, pool_infos): ret = tvm.IRModule() for (global_var, basefunc) in mod.functions.items(): if isinstance(basefunc, tvm.tir.PrimFunc): ret[global_var] = assign_poolinfos_to_allocates_in_primfunc(basefunc, pool_infos) return ret<|docstrin...
c3bc5517dd57df2ff65215e7991260452dfd20af99a5aa30ff9d0a4f88a816cd
def _assign_targets_to_primfuncs_irmodule(mod, target): 'Helper to assign target for PrimFunc in a IRModule' ret = tvm.IRModule() for (global_var, basefunc) in mod.functions.items(): if isinstance(basefunc, tvm.tir.PrimFunc): ret[global_var] = basefunc.with_attr('target', target) ret...
Helper to assign target for PrimFunc in a IRModule
tests/python/unittest/test_tir_usmp_transform_convert_pool_allocations_to_offsets.py
_assign_targets_to_primfuncs_irmodule
billishyahao/tvm
4,640
python
def _assign_targets_to_primfuncs_irmodule(mod, target): ret = tvm.IRModule() for (global_var, basefunc) in mod.functions.items(): if isinstance(basefunc, tvm.tir.PrimFunc): ret[global_var] = basefunc.with_attr('target', target) return ret
def _assign_targets_to_primfuncs_irmodule(mod, target): ret = tvm.IRModule() for (global_var, basefunc) in mod.functions.items(): if isinstance(basefunc, tvm.tir.PrimFunc): ret[global_var] = basefunc.with_attr('target', target) return ret<|docstring|>Helper to assign target for Prim...
4c48dbfccb346dd0a64ce52b5e1ba49c0eb8642e16f452a9028dfc7e6cb0b151
def bezier(p0, p1, p2, p3, t): '\n @param p0\n @param p1\n @param p2\n @param p3\n @param t\n ' cx = (3.0 * (p1[0] - p0[0])) bx = ((3.0 * (p2[0] - p1[0])) - cx) ax = (((p3[0] - p0[0]) - cx) - bx) cy = (3.0 * (p1[1] - p0[1])) by = ((3.0 * (p2[1] - p1[1])) - cy) ay = (((p3[1]...
@param p0 @param p1 @param p2 @param p3 @param t
fitbeat_project/fitbeats/functions.py
bezier
huddlej/fitbeats
0
python
def bezier(p0, p1, p2, p3, t): '\n @param p0\n @param p1\n @param p2\n @param p3\n @param t\n ' cx = (3.0 * (p1[0] - p0[0])) bx = ((3.0 * (p2[0] - p1[0])) - cx) ax = (((p3[0] - p0[0]) - cx) - bx) cy = (3.0 * (p1[1] - p0[1])) by = ((3.0 * (p2[1] - p1[1])) - cy) ay = (((p3[1]...
def bezier(p0, p1, p2, p3, t): '\n @param p0\n @param p1\n @param p2\n @param p3\n @param t\n ' cx = (3.0 * (p1[0] - p0[0])) bx = ((3.0 * (p2[0] - p1[0])) - cx) ax = (((p3[0] - p0[0]) - cx) - bx) cy = (3.0 * (p1[1] - p0[1])) by = ((3.0 * (p2[1] - p1[1])) - cy) ay = (((p3[1]...
f63474939695082812acfea0c5e4e78a9442c9377ba80e30a1a8e4c32920fde7
def calculate_cos(x, y): '\n Calculate the cosine simlarity between two vectors\n \n @param list x\n @param list y\n @return float cos the cosine similarity between the two vectors\n ' x = normalize(x) y = normalize(y) cos = 0 for key in xrange(len(x)): x_i = x[key] ...
Calculate the cosine simlarity between two vectors @param list x @param list y @return float cos the cosine similarity between the two vectors
fitbeat_project/fitbeats/functions.py
calculate_cos
huddlej/fitbeats
0
python
def calculate_cos(x, y): '\n Calculate the cosine simlarity between two vectors\n \n @param list x\n @param list y\n @return float cos the cosine similarity between the two vectors\n ' x = normalize(x) y = normalize(y) cos = 0 for key in xrange(len(x)): x_i = x[key] ...
def calculate_cos(x, y): '\n Calculate the cosine simlarity between two vectors\n \n @param list x\n @param list y\n @return float cos the cosine similarity between the two vectors\n ' x = normalize(x) y = normalize(y) cos = 0 for key in xrange(len(x)): x_i = x[key] ...
0b0983abeb8c1e0f29cce24b83e5cf2e54dbb9d1d25ebad2b5a6f22b140f2ef6
def send_message(self, message, tx_id, case_id): '\n Sends a message to rabbit mq and returns a true or false depending on if it was successful\n :param message: The message to send to the rabbit mq queue\n :param tx_id: Transaction ID used to trace a transaction through the whole system.\n ...
Sends a message to rabbit mq and returns a true or false depending on if it was successful :param message: The message to send to the rabbit mq queue :param tx_id: Transaction ID used to trace a transaction through the whole system. :param case_id: ID used to identify a single instance of a survey collection for a resp...
app/submitter/submitter.py
send_message
ONSdigital/eq-questionnaire-runner
3
python
def send_message(self, message, tx_id, case_id): '\n Sends a message to rabbit mq and returns a true or false depending on if it was successful\n :param message: The message to send to the rabbit mq queue\n :param tx_id: Transaction ID used to trace a transaction through the whole system.\n ...
def send_message(self, message, tx_id, case_id): '\n Sends a message to rabbit mq and returns a true or false depending on if it was successful\n :param message: The message to send to the rabbit mq queue\n :param tx_id: Transaction ID used to trace a transaction through the whole system.\n ...
92718bf7764007f3c5a27eb015885ffdbd4a1e4c5ff62048657bb71aab104387
def run(self): 'Execute subprocess job.' cmd = ' '.join([os.fspath(self.executable), ''.join(map(str, self.args)), os.fspath(self.input)]) with open(self.output, 'w') as outf: p = subprocess.Popen(shlex.split(cmd), stdout=outf, close_fds=True) (out, error) = p.communicate() p.kill() ...
Execute subprocess job.
src/haddock/libs/libsubprocess.py
run
Seaxingzhou/haddock3
1
python
def run(self): cmd = ' '.join([os.fspath(self.executable), .join(map(str, self.args)), os.fspath(self.input)]) with open(self.output, 'w') as outf: p = subprocess.Popen(shlex.split(cmd), stdout=outf, close_fds=True) (out, error) = p.communicate() p.kill() if error: raise Job...
def run(self): cmd = ' '.join([os.fspath(self.executable), .join(map(str, self.args)), os.fspath(self.input)]) with open(self.output, 'w') as outf: p = subprocess.Popen(shlex.split(cmd), stdout=outf, close_fds=True) (out, error) = p.communicate() p.kill() if error: raise Job...
2c3c05c4531066d4ccae91127e0b6485cd40577b33a3dca35cd5161d9227833d
def __init__(self, input_file, output_file, cns_folder, modpath, config_path, cns_exec=None, toppar=None): '\n CNS subprocess.\n\n To execute the job, call the `.run()` method.\n\n Parameters\n ----------\n input_file : str or pathlib.Path\n The path to the .inp CNS fil...
CNS subprocess. To execute the job, call the `.run()` method. Parameters ---------- input_file : str or pathlib.Path The path to the .inp CNS file. output_file : str or pathlib.Path The path to the .out CNS file, where the standard output will be saved. cns_folder : str of pathlib.Path The path wher...
src/haddock/libs/libsubprocess.py
__init__
Seaxingzhou/haddock3
1
python
def __init__(self, input_file, output_file, cns_folder, modpath, config_path, cns_exec=None, toppar=None): '\n CNS subprocess.\n\n To execute the job, call the `.run()` method.\n\n Parameters\n ----------\n input_file : str or pathlib.Path\n The path to the .inp CNS fil...
def __init__(self, input_file, output_file, cns_folder, modpath, config_path, cns_exec=None, toppar=None): '\n CNS subprocess.\n\n To execute the job, call the `.run()` method.\n\n Parameters\n ----------\n input_file : str or pathlib.Path\n The path to the .inp CNS fil...
d795d7d30955e0373d26899c18fc7c6b5ce60db1570d8ea81603af1a77ab6f9b
@property def cns_exec(self): 'CNS executable path.' return self._cns_exec
CNS executable path.
src/haddock/libs/libsubprocess.py
cns_exec
Seaxingzhou/haddock3
1
python
@property def cns_exec(self): return self._cns_exec
@property def cns_exec(self): return self._cns_exec<|docstring|>CNS executable path.<|endoftext|>
36c93226e932f10a2ccaf9e3f56f80b394ecbc3cf9c93cb0d00781edd8f659a4
def run(self): 'Run this CNS job script.' with open(self.input_file) as inp, open(self.output_file, 'w+') as outf: env = {'MODDIR': str(self.modpath), 'MODULE': str(self.cns_folder), 'RUN': str(self.config_path), 'TOPPAR': str(self.toppar)} p = subprocess.Popen(self.cns_exec, stdin=inp, stdout=o...
Run this CNS job script.
src/haddock/libs/libsubprocess.py
run
Seaxingzhou/haddock3
1
python
def run(self): with open(self.input_file) as inp, open(self.output_file, 'w+') as outf: env = {'MODDIR': str(self.modpath), 'MODULE': str(self.cns_folder), 'RUN': str(self.config_path), 'TOPPAR': str(self.toppar)} p = subprocess.Popen(self.cns_exec, stdin=inp, stdout=outf, stderr=subprocess.PIP...
def run(self): with open(self.input_file) as inp, open(self.output_file, 'w+') as outf: env = {'MODDIR': str(self.modpath), 'MODULE': str(self.cns_folder), 'RUN': str(self.config_path), 'TOPPAR': str(self.toppar)} p = subprocess.Popen(self.cns_exec, stdin=inp, stdout=outf, stderr=subprocess.PIP...
743351f7e801a6dab2c5f4a5b7b83df404f28c2504e019bd00da496bf1a07640
def glInitConvolutionEXT(): 'Return boolean indicating whether this extension is available' from OpenGL import extensions return extensions.hasGLExtension(EXTENSION_NAME)
Return boolean indicating whether this extension is available
PyOpenGL-3.0.2/OpenGL/raw/GL/EXT/convolution.py
glInitConvolutionEXT
frederica07/Dragon_Programming_Process
0
python
def glInitConvolutionEXT(): from OpenGL import extensions return extensions.hasGLExtension(EXTENSION_NAME)
def glInitConvolutionEXT(): from OpenGL import extensions return extensions.hasGLExtension(EXTENSION_NAME)<|docstring|>Return boolean indicating whether this extension is available<|endoftext|>
4f68c0ee35bf3fecce023c5b5fe4b40e69d7c32ecb8979b98d8f4c91b543a705
def is_in_range(self, range, origin_in_degrees, destination_in_degrees): '\n Function to encapsulate figuring out if two GPS coordinates are within a\n given range\n\n Args:\n range: The maximum range between two GPS coordinates\n origin_in_degrees: Origin GPS coordinates\...
Function to encapsulate figuring out if two GPS coordinates are within a given range Args: range: The maximum range between two GPS coordinates origin_in_degrees: Origin GPS coordinates destination_in_degrees: Destination GPS coordinates Returns: bool: Whether the GPS coordinates are in a given range
gps_distance_calculator/calculator.py
is_in_range
terepaii/GPS-Distance-Calculator
0
python
def is_in_range(self, range, origin_in_degrees, destination_in_degrees): '\n Function to encapsulate figuring out if two GPS coordinates are within a\n given range\n\n Args:\n range: The maximum range between two GPS coordinates\n origin_in_degrees: Origin GPS coordinates\...
def is_in_range(self, range, origin_in_degrees, destination_in_degrees): '\n Function to encapsulate figuring out if two GPS coordinates are within a\n given range\n\n Args:\n range: The maximum range between two GPS coordinates\n origin_in_degrees: Origin GPS coordinates\...
a3f1aaa46c7d727afd137b5f43ce4f65cb19fd9c8891727bbe8748a5caad5ae2
def calculate_distance(self, origin_in_degrees, destination_in_degrees): '\n Given some GPS coordinates, calculate the distance\n between 2 points. Uses the Haversine formula.\n\n As dataset grows, it might be more beneficial to use\n a quicker estimate formula such as the equirectangula...
Given some GPS coordinates, calculate the distance between 2 points. Uses the Haversine formula. As dataset grows, it might be more beneficial to use a quicker estimate formula such as the equirectangular distance approximation Args: origin (dict): origin GPS coordinates destination (dict): Destination GPS co...
gps_distance_calculator/calculator.py
calculate_distance
terepaii/GPS-Distance-Calculator
0
python
def calculate_distance(self, origin_in_degrees, destination_in_degrees): '\n Given some GPS coordinates, calculate the distance\n between 2 points. Uses the Haversine formula.\n\n As dataset grows, it might be more beneficial to use\n a quicker estimate formula such as the equirectangula...
def calculate_distance(self, origin_in_degrees, destination_in_degrees): '\n Given some GPS coordinates, calculate the distance\n between 2 points. Uses the Haversine formula.\n\n As dataset grows, it might be more beneficial to use\n a quicker estimate formula such as the equirectangula...
e3bd27d5aa02058edbdbbcb9a517e0b3f725c66922f07f1b7e50df7c140eeac7
def convert_gps_coordinates_to_radians(self, gps_coordinates): '\n Convert a set of gps coordinates from degrees to radians\n\n Args:\n gps_coordinates (dict): A dictionary containing gps coordinates\n\n Returns:\n Dict: A dictionary of GPS coordinates converted to radian...
Convert a set of gps coordinates from degrees to radians Args: gps_coordinates (dict): A dictionary containing gps coordinates Returns: Dict: A dictionary of GPS coordinates converted to radians
gps_distance_calculator/calculator.py
convert_gps_coordinates_to_radians
terepaii/GPS-Distance-Calculator
0
python
def convert_gps_coordinates_to_radians(self, gps_coordinates): '\n Convert a set of gps coordinates from degrees to radians\n\n Args:\n gps_coordinates (dict): A dictionary containing gps coordinates\n\n Returns:\n Dict: A dictionary of GPS coordinates converted to radian...
def convert_gps_coordinates_to_radians(self, gps_coordinates): '\n Convert a set of gps coordinates from degrees to radians\n\n Args:\n gps_coordinates (dict): A dictionary containing gps coordinates\n\n Returns:\n Dict: A dictionary of GPS coordinates converted to radian...
edbc515ead7dd5dff58f76b19edc5db12e78d91c6277ef79735150ecaf07df35
def degrees_to_radians(self, degrees): '\n Function to convert degrees to radians. Round to 7 decimal places\n\n Args:\n degrees: Degrees\n ' _logger.debug(f'Converting {degrees} degrees to radians') return round((float(degrees) * (pi / 180)), 5)
Function to convert degrees to radians. Round to 7 decimal places Args: degrees: Degrees
gps_distance_calculator/calculator.py
degrees_to_radians
terepaii/GPS-Distance-Calculator
0
python
def degrees_to_radians(self, degrees): '\n Function to convert degrees to radians. Round to 7 decimal places\n\n Args:\n degrees: Degrees\n ' _logger.debug(f'Converting {degrees} degrees to radians') return round((float(degrees) * (pi / 180)), 5)
def degrees_to_radians(self, degrees): '\n Function to convert degrees to radians. Round to 7 decimal places\n\n Args:\n degrees: Degrees\n ' _logger.debug(f'Converting {degrees} degrees to radians') return round((float(degrees) * (pi / 180)), 5)<|docstring|>Function to conve...
67b4880f1459304157efa1efc4007cd43419fdff25f7c650b2012c4dcc1185e1
def forward_kinematics(self, joints_readings, up_to_joint=7): "This function solve forward kinematics by multiplying frame transformation up until a specified\n joint. Reference Lecture 9 slide 13.\n Args:\n joints_readings (list): the state of the robot joints.\n up_to_joint (in...
This function solve forward kinematics by multiplying frame transformation up until a specified joint. Reference Lecture 9 slide 13. Args: joints_readings (list): the state of the robot joints. up_to_joint (int, optional): Specify up to what frame you want to compute forward kinematics. Defaults to 7. R...
cw3/cw3q2/src/cw3q2/iiwa14DynStudent.py
forward_kinematics
joerowelll/COMP0127_Robotic_Systems_Engineering-Courseworks
0
python
def forward_kinematics(self, joints_readings, up_to_joint=7): "This function solve forward kinematics by multiplying frame transformation up until a specified\n joint. Reference Lecture 9 slide 13.\n Args:\n joints_readings (list): the state of the robot joints.\n up_to_joint (in...
def forward_kinematics(self, joints_readings, up_to_joint=7): "This function solve forward kinematics by multiplying frame transformation up until a specified\n joint. Reference Lecture 9 slide 13.\n Args:\n joints_readings (list): the state of the robot joints.\n up_to_joint (in...
f657e5cc451437012ae45bb20dad204e640d20ec8b9c4a061e5eb458ce9e626e
def get_jacobian_centre_of_mass(self, joint_readings, up_to_joint=7): 'Given the joint values of the robot, compute the Jacobian matrix at the centre of mass of the link.\n Reference - Lecture 9 slide 14.\n\n Args:\n joint_readings (list): the state of the robot joints.\n up_to_j...
Given the joint values of the robot, compute the Jacobian matrix at the centre of mass of the link. Reference - Lecture 9 slide 14. Args: joint_readings (list): the state of the robot joints. up_to_joint (int, optional): Specify up to what frame you want to compute the Jacobian. Defaults to 7. Returns: ...
cw3/cw3q2/src/cw3q2/iiwa14DynStudent.py
get_jacobian_centre_of_mass
joerowelll/COMP0127_Robotic_Systems_Engineering-Courseworks
0
python
def get_jacobian_centre_of_mass(self, joint_readings, up_to_joint=7): 'Given the joint values of the robot, compute the Jacobian matrix at the centre of mass of the link.\n Reference - Lecture 9 slide 14.\n\n Args:\n joint_readings (list): the state of the robot joints.\n up_to_j...
def get_jacobian_centre_of_mass(self, joint_readings, up_to_joint=7): 'Given the joint values of the robot, compute the Jacobian matrix at the centre of mass of the link.\n Reference - Lecture 9 slide 14.\n\n Args:\n joint_readings (list): the state of the robot joints.\n up_to_j...
c1e5b07c162735bc4bc80e462cf5759fa0a44c5490d9f8ba4219ae4451e8f526
def forward_kinematics_centre_of_mass(self, joints_readings, up_to_joint=7): 'This function computes the forward kinematics up to the centre of mass for the given joint frame.\n Reference - Lecture 9 slide 14.\n Args:\n joints_readings (list): the state of the robot joints.\n up_...
This function computes the forward kinematics up to the centre of mass for the given joint frame. Reference - Lecture 9 slide 14. Args: joints_readings (list): the state of the robot joints. up_to_joint (int, optional): Specify up to what frame you want to compute forward kinematicks. Defaults to 5. Ret...
cw3/cw3q2/src/cw3q2/iiwa14DynStudent.py
forward_kinematics_centre_of_mass
joerowelll/COMP0127_Robotic_Systems_Engineering-Courseworks
0
python
def forward_kinematics_centre_of_mass(self, joints_readings, up_to_joint=7): 'This function computes the forward kinematics up to the centre of mass for the given joint frame.\n Reference - Lecture 9 slide 14.\n Args:\n joints_readings (list): the state of the robot joints.\n up_...
def forward_kinematics_centre_of_mass(self, joints_readings, up_to_joint=7): 'This function computes the forward kinematics up to the centre of mass for the given joint frame.\n Reference - Lecture 9 slide 14.\n Args:\n joints_readings (list): the state of the robot joints.\n up_...
9b5b5a90d0c0fe90cd27c12d7eb2c6d0a4667de9caa9574b3446a9519cccfa3b
def get_B(self, joint_readings): 'Given the joint positions of the robot, compute inertia matrix B.\n Args:\n joint_readings (list): The positions of the robot joints.\n\n Returns:\n B (numpy.ndarray): The output is a numpy 7*7 matrix describing the inertia matrix B.\n ' ...
Given the joint positions of the robot, compute inertia matrix B. Args: joint_readings (list): The positions of the robot joints. Returns: B (numpy.ndarray): The output is a numpy 7*7 matrix describing the inertia matrix B.
cw3/cw3q2/src/cw3q2/iiwa14DynStudent.py
get_B
joerowelll/COMP0127_Robotic_Systems_Engineering-Courseworks
0
python
def get_B(self, joint_readings): 'Given the joint positions of the robot, compute inertia matrix B.\n Args:\n joint_readings (list): The positions of the robot joints.\n\n Returns:\n B (numpy.ndarray): The output is a numpy 7*7 matrix describing the inertia matrix B.\n ' ...
def get_B(self, joint_readings): 'Given the joint positions of the robot, compute inertia matrix B.\n Args:\n joint_readings (list): The positions of the robot joints.\n\n Returns:\n B (numpy.ndarray): The output is a numpy 7*7 matrix describing the inertia matrix B.\n ' ...
f265046f858de0cd45f22940f96a8bf21a5c65cfe1a3a8ed2420c0ced456ecf5
def get_C_times_qdot(self, joint_readings, joint_velocities): 'Given the joint positions and velocities of the robot, compute Coriolis terms C.\n Args:\n joint_readings (list): The positions of the robot joints.\n joint_velocities (list): The velocities of the robot joints.\n\n R...
Given the joint positions and velocities of the robot, compute Coriolis terms C. Args: joint_readings (list): The positions of the robot joints. joint_velocities (list): The velocities of the robot joints. Returns: C (numpy.ndarray): The output is a numpy 7*1 matrix describing the Coriolis terms C times jo...
cw3/cw3q2/src/cw3q2/iiwa14DynStudent.py
get_C_times_qdot
joerowelll/COMP0127_Robotic_Systems_Engineering-Courseworks
0
python
def get_C_times_qdot(self, joint_readings, joint_velocities): 'Given the joint positions and velocities of the robot, compute Coriolis terms C.\n Args:\n joint_readings (list): The positions of the robot joints.\n joint_velocities (list): The velocities of the robot joints.\n\n R...
def get_C_times_qdot(self, joint_readings, joint_velocities): 'Given the joint positions and velocities of the robot, compute Coriolis terms C.\n Args:\n joint_readings (list): The positions of the robot joints.\n joint_velocities (list): The velocities of the robot joints.\n\n R...
6a106823f77c7b4c526644277de291e6c7f4c22b8b08ff3b1bcb099c7773183e
def get_G(self, joint_readings): 'Given the joint positions of the robot, compute the gravity matrix g.\n Args:\n joint_readings (list): The positions of the robot joints.\n\n Returns:\n G (numpy.ndarray): The output is a numpy 7*1 numpy array describing the gravity matrix g.\n ...
Given the joint positions of the robot, compute the gravity matrix g. Args: joint_readings (list): The positions of the robot joints. Returns: G (numpy.ndarray): The output is a numpy 7*1 numpy array describing the gravity matrix g.
cw3/cw3q2/src/cw3q2/iiwa14DynStudent.py
get_G
joerowelll/COMP0127_Robotic_Systems_Engineering-Courseworks
0
python
def get_G(self, joint_readings): 'Given the joint positions of the robot, compute the gravity matrix g.\n Args:\n joint_readings (list): The positions of the robot joints.\n\n Returns:\n G (numpy.ndarray): The output is a numpy 7*1 numpy array describing the gravity matrix g.\n ...
def get_G(self, joint_readings): 'Given the joint positions of the robot, compute the gravity matrix g.\n Args:\n joint_readings (list): The positions of the robot joints.\n\n Returns:\n G (numpy.ndarray): The output is a numpy 7*1 numpy array describing the gravity matrix g.\n ...
4251cecd383ecfd982b260bdf556dcef4a3063d2be1b914979071cc004759873
def develop(seed: FiniteSequence, **kwargs) -> Sequence: "Grow a sequence from a given 'seed' (motive).\n The process does not operate in realtime, and may well\n raise DeadEndReached if it hits a dead-end\n The process is controlled by the following kwargs:\n\n min_beats - controls the length of the se...
Grow a sequence from a given 'seed' (motive). The process does not operate in realtime, and may well raise DeadEndReached if it hits a dead-end The process is controlled by the following kwargs: min_beats - controls the length of the sequence. It is recommended to keep this figure smaller to start with. mutators - li...
src/composerstoolkit/composers/solvers.py
develop
nickpeck/composerstoolkitv2
0
python
def develop(seed: FiniteSequence, **kwargs) -> Sequence: "Grow a sequence from a given 'seed' (motive).\n The process does not operate in realtime, and may well\n raise DeadEndReached if it hits a dead-end\n The process is controlled by the following kwargs:\n\n min_beats - controls the length of the se...
def develop(seed: FiniteSequence, **kwargs) -> Sequence: "Grow a sequence from a given 'seed' (motive).\n The process does not operate in realtime, and may well\n raise DeadEndReached if it hits a dead-end\n The process is controlled by the following kwargs:\n\n min_beats - controls the length of the se...
59de3d708c4c2f3f6b9b2d2c74e80bd09bfc59e3b67d7e002e6c3e69b98c2b6d
def backtracking_markov_solver(starting_event: Event, table: Dict[(int, Dict[(int, int)])], **kwargs) -> FiniteSequence: 'Compose a melodic sequence based upon the\n domain and constraints given.\n\n starting_event: Event dictate the starting pitch.\n All subsequent events will be of similar duration.\n\n ...
Compose a melodic sequence based upon the domain and constraints given. starting_event: Event dictate the starting pitch. All subsequent events will be of similar duration. constraints - list of constraint functions (see composerstoolkit.composers.constraints) heuristics - list of heuristics (weight maps) that can b...
src/composerstoolkit/composers/solvers.py
backtracking_markov_solver
nickpeck/composerstoolkitv2
0
python
def backtracking_markov_solver(starting_event: Event, table: Dict[(int, Dict[(int, int)])], **kwargs) -> FiniteSequence: 'Compose a melodic sequence based upon the\n domain and constraints given.\n\n starting_event: Event dictate the starting pitch.\n All subsequent events will be of similar duration.\n\n ...
def backtracking_markov_solver(starting_event: Event, table: Dict[(int, Dict[(int, int)])], **kwargs) -> FiniteSequence: 'Compose a melodic sequence based upon the\n domain and constraints given.\n\n starting_event: Event dictate the starting pitch.\n All subsequent events will be of similar duration.\n\n ...
51b8f3f7a5c4b39194611cc035299f31e5505d0a39ad47a3ba4b0aa4db29b74b
def backtracking_solver(starting_event: Event, **kwargs) -> FiniteSequence: 'Compose a melodic sequence based upon the\n domain and constraints given.\n\n starting_event: Event dictate the starting pitch.\n All subsequent events will be of similar duration.\n\n constraints - list of constraint functions...
Compose a melodic sequence based upon the domain and constraints given. starting_event: Event dictate the starting pitch. All subsequent events will be of similar duration. constraints - list of constraint functions (see composerstoolkit.composers.constraints) heuristics - list of heuristics (weight maps) that can b...
src/composerstoolkit/composers/solvers.py
backtracking_solver
nickpeck/composerstoolkitv2
0
python
def backtracking_solver(starting_event: Event, **kwargs) -> FiniteSequence: 'Compose a melodic sequence based upon the\n domain and constraints given.\n\n starting_event: Event dictate the starting pitch.\n All subsequent events will be of similar duration.\n\n constraints - list of constraint functions...
def backtracking_solver(starting_event: Event, **kwargs) -> FiniteSequence: 'Compose a melodic sequence based upon the\n domain and constraints given.\n\n starting_event: Event dictate the starting pitch.\n All subsequent events will be of similar duration.\n\n constraints - list of constraint functions...
764f1325b07d8223392fab164a22f7c5c27a4b4b9508a66da6dff7e2c694f2a2
def __init__(self, vocab=None, sos=True, eos=True): '\n vocab:\n - 当为list或tuple时,它是一个词表列表\n - 当为str并且存在路径时,是一个以换行为分割的,每行一个词的词表文件\n sos: 是否在转换的时候加入[CLS]开头\n sos: 是否在转换的时候加入[SEP]结尾\n ' super(TextTransformer, self).__init__(self, dynamic=True) ...
vocab: - 当为list或tuple时,它是一个词表列表 - 当为str并且存在路径时,是一个以换行为分割的,每行一个词的词表文件 sos: 是否在转换的时候加入[CLS]开头 sos: 是否在转换的时候加入[SEP]结尾
tf_text_model/text_transformer.py
__init__
deepdialog/tf-text-model
0
python
def __init__(self, vocab=None, sos=True, eos=True): '\n vocab:\n - 当为list或tuple时,它是一个词表列表\n - 当为str并且存在路径时,是一个以换行为分割的,每行一个词的词表文件\n sos: 是否在转换的时候加入[CLS]开头\n sos: 是否在转换的时候加入[SEP]结尾\n ' super(TextTransformer, self).__init__(self, dynamic=True) ...
def __init__(self, vocab=None, sos=True, eos=True): '\n vocab:\n - 当为list或tuple时,它是一个词表列表\n - 当为str并且存在路径时,是一个以换行为分割的,每行一个词的词表文件\n sos: 是否在转换的时候加入[CLS]开头\n sos: 是否在转换的时候加入[SEP]结尾\n ' super(TextTransformer, self).__init__(self, dynamic=True) ...
69e657ffef60e5b526b94572a18a7a9de039a3d358052a9fe871bb23b3b4c359
def nodejs_binary_macro(name, data=[], args=[], visibility=None, tags=[], testonly=0, **kwargs): 'This macro exists only to wrap the nodejs_binary as an .exe for Windows.\n\n This is exposed in the public API at `//:defs.bzl` as `nodejs_binary`, so most\n users loading `nodejs_binary` are actually executing t...
This macro exists only to wrap the nodejs_binary as an .exe for Windows. This is exposed in the public API at `//:defs.bzl` as `nodejs_binary`, so most users loading `nodejs_binary` are actually executing this macro. Args: name: name of the label data: runtime dependencies args: applied to the wrapper binary ...
internal/node/node.bzl
nodejs_binary_macro
Jumblemuddle/rules_nodejs
2
python
def nodejs_binary_macro(name, data=[], args=[], visibility=None, tags=[], testonly=0, **kwargs): 'This macro exists only to wrap the nodejs_binary as an .exe for Windows.\n\n This is exposed in the public API at `//:defs.bzl` as `nodejs_binary`, so most\n users loading `nodejs_binary` are actually executing t...
def nodejs_binary_macro(name, data=[], args=[], visibility=None, tags=[], testonly=0, **kwargs): 'This macro exists only to wrap the nodejs_binary as an .exe for Windows.\n\n This is exposed in the public API at `//:defs.bzl` as `nodejs_binary`, so most\n users loading `nodejs_binary` are actually executing t...
7717820be1693cfe77b97ef906203d2e4a2ec87dcf3ea378ddc08c697ebcab2f
def nodejs_test_macro(name, data=[], args=[], visibility=None, tags=[], **kwargs): 'This macro exists only to wrap the nodejs_test as an .exe for Windows.\n\n This is exposed in the public API at `//:defs.bzl` as `nodejs_test`, so most\n users loading `nodejs_test` are actually executing this macro.\n\n Ar...
This macro exists only to wrap the nodejs_test as an .exe for Windows. This is exposed in the public API at `//:defs.bzl` as `nodejs_test`, so most users loading `nodejs_test` are actually executing this macro. Args: name: name of the label data: runtime dependencies args: applied to the wrapper binary visibi...
internal/node/node.bzl
nodejs_test_macro
Jumblemuddle/rules_nodejs
2
python
def nodejs_test_macro(name, data=[], args=[], visibility=None, tags=[], **kwargs): 'This macro exists only to wrap the nodejs_test as an .exe for Windows.\n\n This is exposed in the public API at `//:defs.bzl` as `nodejs_test`, so most\n users loading `nodejs_test` are actually executing this macro.\n\n Ar...
def nodejs_test_macro(name, data=[], args=[], visibility=None, tags=[], **kwargs): 'This macro exists only to wrap the nodejs_test as an .exe for Windows.\n\n This is exposed in the public API at `//:defs.bzl` as `nodejs_test`, so most\n users loading `nodejs_test` are actually executing this macro.\n\n Ar...
dbcb1298d839fb4acae1ff5f8384c61673e92a30212a2bd6efb0bdd8fba21ba4
async def async_setup_platform(hass, config, async_add_devices, discovery_info=None): 'Set up platform.' import broadlink host = (config.get(CONF_HOST), config.get(CONF_PORT)) mac = get_broadlink_mac(config.get(CONF_MAC)) link = broadlink.rm(host, mac, None) try: (await hass.async_add_jo...
Set up platform.
media_player.py
async_setup_platform
elupus/hass_broadlink
0
python
async def async_setup_platform(hass, config, async_add_devices, discovery_info=None): import broadlink host = (config.get(CONF_HOST), config.get(CONF_PORT)) mac = get_broadlink_mac(config.get(CONF_MAC)) link = broadlink.rm(host, mac, None) try: (await hass.async_add_job(link.auth)) ...
async def async_setup_platform(hass, config, async_add_devices, discovery_info=None): import broadlink host = (config.get(CONF_HOST), config.get(CONF_PORT)) mac = get_broadlink_mac(config.get(CONF_MAC)) link = broadlink.rm(host, mac, None) try: (await hass.async_add_job(link.auth)) ...
ed66c220141064441a5fe43122de648d4bc40efb11b92ce6933e528308dfbf73
def get_supported_by_config(config): 'Calculate support flags based on available configuration entries.' support = 0 for mapping in SUPPORT_MAPPING: if (mapping[0] in config): support = (support | mapping[1]) if config.get(CONF_SOURCES): support = (support | SUPPORT_SELECT_SO...
Calculate support flags based on available configuration entries.
media_player.py
get_supported_by_config
elupus/hass_broadlink
0
python
def get_supported_by_config(config): support = 0 for mapping in SUPPORT_MAPPING: if (mapping[0] in config): support = (support | mapping[1]) if config.get(CONF_SOURCES): support = (support | SUPPORT_SELECT_SOURCE) if config.get(CONF_SOUND_MODES): support = (suppo...
def get_supported_by_config(config): support = 0 for mapping in SUPPORT_MAPPING: if (mapping[0] in config): support = (support | mapping[1]) if config.get(CONF_SOURCES): support = (support | SUPPORT_SELECT_SOURCE) if config.get(CONF_SOUND_MODES): support = (suppo...
c93807d21720cbd2e029c8a14b54feae2a9cb10a204b8e85cf4620d910d70a66
def get_broadlink_mac(mac: str): 'Convert a mac address string with : in it to just a flat string.' return binascii.unhexlify(mac.encode().replace(b':', b''))
Convert a mac address string with : in it to just a flat string.
media_player.py
get_broadlink_mac
elupus/hass_broadlink
0
python
def get_broadlink_mac(mac: str): return binascii.unhexlify(mac.encode().replace(b':', b))
def get_broadlink_mac(mac: str): return binascii.unhexlify(mac.encode().replace(b':', b))<|docstring|>Convert a mac address string with : in it to just a flat string.<|endoftext|>
02d9b92c09fc66939caafddd2be0e80a7cf76ea3302a974157e17391949436d5
def __init__(self, link, config): 'Initialize device.' super().__init__() self._support = get_supported_by_config(config) self._config = config self._link = link self._state = STATE_OFF self._source = None self._sound_mode = None self._muted = None self._volume_level = None s...
Initialize device.
media_player.py
__init__
elupus/hass_broadlink
0
python
def __init__(self, link, config): super().__init__() self._support = get_supported_by_config(config) self._config = config self._link = link self._state = STATE_OFF self._source = None self._sound_mode = None self._muted = None self._volume_level = None self._lock = asyncio....
def __init__(self, link, config): super().__init__() self._support = get_supported_by_config(config) self._config = config self._link = link self._state = STATE_OFF self._source = None self._sound_mode = None self._muted = None self._volume_level = None self._lock = asyncio....
b3beab0634c5853cfb697b3879ecbf8e8249c61aea2ddb94317139d90d26eb8a
async def send(self, command): 'Send b64 encoded command to device.' if (command is None): raise Exception('No command defined!') packet = b64decode(command[CONF_CODE]) (await self.hass.async_add_job(self._link.send_data, packet)) if command[CONF_DELAY]: (await asyncio.sleep(command[...
Send b64 encoded command to device.
media_player.py
send
elupus/hass_broadlink
0
python
async def send(self, command): if (command is None): raise Exception('No command defined!') packet = b64decode(command[CONF_CODE]) (await self.hass.async_add_job(self._link.send_data, packet)) if command[CONF_DELAY]: (await asyncio.sleep(command[CONF_DELAY]))
async def send(self, command): if (command is None): raise Exception('No command defined!') packet = b64decode(command[CONF_CODE]) (await self.hass.async_add_job(self._link.send_data, packet)) if command[CONF_DELAY]: (await asyncio.sleep(command[CONF_DELAY]))<|docstring|>Send b64 en...
c139875c7374a849c481dbbb4b721ff429a14d0c2ee013476aac3776a803ee50
@property def name(self): 'Return the name of the controlled device.' return self._config.get(CONF_NAME)
Return the name of the controlled device.
media_player.py
name
elupus/hass_broadlink
0
python
@property def name(self): return self._config.get(CONF_NAME)
@property def name(self): return self._config.get(CONF_NAME)<|docstring|>Return the name of the controlled device.<|endoftext|>
e42efc876f1e9ba1fff8e262b88bbfd4ac0401dbf9d3af60a09896093ccf5c48
@property def state(self): 'Return the state of the device.' return self._state
Return the state of the device.
media_player.py
state
elupus/hass_broadlink
0
python
@property def state(self): return self._state
@property def state(self): return self._state<|docstring|>Return the state of the device.<|endoftext|>
13d8372e686430de03804a7b98750f895bfda47e68c3a022b45164adf07534e0
@property def supported_features(self): 'Flag media player features that are supported.' return self._support
Flag media player features that are supported.
media_player.py
supported_features
elupus/hass_broadlink
0
python
@property def supported_features(self): return self._support
@property def supported_features(self): return self._support<|docstring|>Flag media player features that are supported.<|endoftext|>
f22c291cbdd32d507bd2395dcc44cd13c0e487be97b1493e4efa63e1bdc9377d
async def async_turn_on(self): 'Turn on media player.' async with self._lock: (await self.send(self._config.get(CONF_COMMAND_ON))) self._state = STATE_ON if self._volume_restore: (await self.async_set_volume_level(self._volume_restore))
Turn on media player.
media_player.py
async_turn_on
elupus/hass_broadlink
0
python
async def async_turn_on(self): async with self._lock: (await self.send(self._config.get(CONF_COMMAND_ON))) self._state = STATE_ON if self._volume_restore: (await self.async_set_volume_level(self._volume_restore))
async def async_turn_on(self): async with self._lock: (await self.send(self._config.get(CONF_COMMAND_ON))) self._state = STATE_ON if self._volume_restore: (await self.async_set_volume_level(self._volume_restore))<|docstring|>Turn on media player.<|endoftext|>
75cce3fadb98e1cc37505d8bb7db4ee6da018f9ac0a0fcb5e85acba3122a8884
async def async_turn_off(self): 'Turn off media player.' async with self._lock: (await self.send(self._config.get(CONF_COMMAND_OFF))) self._state = STATE_OFF
Turn off media player.
media_player.py
async_turn_off
elupus/hass_broadlink
0
python
async def async_turn_off(self): async with self._lock: (await self.send(self._config.get(CONF_COMMAND_OFF))) self._state = STATE_OFF
async def async_turn_off(self): async with self._lock: (await self.send(self._config.get(CONF_COMMAND_OFF))) self._state = STATE_OFF<|docstring|>Turn off media player.<|endoftext|>
9af4bef44cc9e77ecfd3c56e25fe279fac946f7cfb8387ea268df8483a856be3
async def async_volume_up(self): 'Volume up media player.' async with self._lock: (await self.send_volume(self._config.get(CONF_VOLUME_UP))) if ((CONF_VOLUME_STEP in self._config) and (self._volume_level is not None)): self._volume_level += self._volume_step
Volume up media player.
media_player.py
async_volume_up
elupus/hass_broadlink
0
python
async def async_volume_up(self): async with self._lock: (await self.send_volume(self._config.get(CONF_VOLUME_UP))) if ((CONF_VOLUME_STEP in self._config) and (self._volume_level is not None)): self._volume_level += self._volume_step
async def async_volume_up(self): async with self._lock: (await self.send_volume(self._config.get(CONF_VOLUME_UP))) if ((CONF_VOLUME_STEP in self._config) and (self._volume_level is not None)): self._volume_level += self._volume_step<|docstring|>Volume up media player.<|endoftext|>
cb8a03306233c0762b11558f2473e3bdc2ca7bc10dc27e2b617965353873eb50
async def async_volume_down(self): 'Volume down media player.' async with self._lock: (await self.send_volume(self._config.get(CONF_VOLUME_DOWN))) if ((CONF_VOLUME_STEP in self._config) and (self._volume_level is not None)): self._volume_level -= self._volume_step
Volume down media player.
media_player.py
async_volume_down
elupus/hass_broadlink
0
python
async def async_volume_down(self): async with self._lock: (await self.send_volume(self._config.get(CONF_VOLUME_DOWN))) if ((CONF_VOLUME_STEP in self._config) and (self._volume_level is not None)): self._volume_level -= self._volume_step
async def async_volume_down(self): async with self._lock: (await self.send_volume(self._config.get(CONF_VOLUME_DOWN))) if ((CONF_VOLUME_STEP in self._config) and (self._volume_level is not None)): self._volume_level -= self._volume_step<|docstring|>Volume down media player.<|endofte...
dad5b1c1011e541aa217418fdf7575f1538d32c82fc64233bea58cd89aa32a0d
async def async_mute_volume(self, mute): 'Send mute command.' async with self._lock: if (mute and (CONF_VOLUME_MUTE_ON in self._config)): (await self.send(self._config.get(CONF_VOLUME_MUTE_ON))) self._muted = True elif ((not mute) and (CONF_VOLUME_MUTE_OFF in self._config...
Send mute command.
media_player.py
async_mute_volume
elupus/hass_broadlink
0
python
async def async_mute_volume(self, mute): async with self._lock: if (mute and (CONF_VOLUME_MUTE_ON in self._config)): (await self.send(self._config.get(CONF_VOLUME_MUTE_ON))) self._muted = True elif ((not mute) and (CONF_VOLUME_MUTE_OFF in self._config)): (awa...
async def async_mute_volume(self, mute): async with self._lock: if (mute and (CONF_VOLUME_MUTE_ON in self._config)): (await self.send(self._config.get(CONF_VOLUME_MUTE_ON))) self._muted = True elif ((not mute) and (CONF_VOLUME_MUTE_OFF in self._config)): (awa...
d24cf9f818f312956f8c8e3c801b689d7e3acf00344adb7b6969f4fa3614d4ba
async def async_media_next_track(self): 'Send next track command.' async with self._lock: (await self.send(self._config.get(CONF_NEXT_TRACK)))
Send next track command.
media_player.py
async_media_next_track
elupus/hass_broadlink
0
python
async def async_media_next_track(self): async with self._lock: (await self.send(self._config.get(CONF_NEXT_TRACK)))
async def async_media_next_track(self): async with self._lock: (await self.send(self._config.get(CONF_NEXT_TRACK)))<|docstring|>Send next track command.<|endoftext|>
75a7f3ca24f1bdeb79d37c2b2bfdd3804c6efc9067739aee5574945538c67108
async def async_media_previous_track(self): 'Send the previous track command.' async with self._lock: (await self.send(self._config.get(CONF_PREVIOUS_TRACK)))
Send the previous track command.
media_player.py
async_media_previous_track
elupus/hass_broadlink
0
python
async def async_media_previous_track(self): async with self._lock: (await self.send(self._config.get(CONF_PREVIOUS_TRACK)))
async def async_media_previous_track(self): async with self._lock: (await self.send(self._config.get(CONF_PREVIOUS_TRACK)))<|docstring|>Send the previous track command.<|endoftext|>
2127dd2abd4b7ac6a0c99053ce7337c53f93ff2efda505a1c9fc898cad8aea66
async def async_select_source(self, source): 'Select a specific source.' async with self._lock: (await self.send(self._config.get(CONF_SOURCES)[source])) self._source = source self._sound_mode = None
Select a specific source.
media_player.py
async_select_source
elupus/hass_broadlink
0
python
async def async_select_source(self, source): async with self._lock: (await self.send(self._config.get(CONF_SOURCES)[source])) self._source = source self._sound_mode = None
async def async_select_source(self, source): async with self._lock: (await self.send(self._config.get(CONF_SOURCES)[source])) self._source = source self._sound_mode = None<|docstring|>Select a specific source.<|endoftext|>
ed7ac15dbcf070508e30c3fa4e8fc96b0b2e225a5df6fc197a873da4ab1c2ecf
async def async_select_sound_mode(self, sound_mode): 'Select a specific source.' async with self._lock: (await self.send(self._config.get(CONF_SOUND_MODES)[sound_mode])) self._sound_mode = sound_mode
Select a specific source.
media_player.py
async_select_sound_mode
elupus/hass_broadlink
0
python
async def async_select_sound_mode(self, sound_mode): async with self._lock: (await self.send(self._config.get(CONF_SOUND_MODES)[sound_mode])) self._sound_mode = sound_mode
async def async_select_sound_mode(self, sound_mode): async with self._lock: (await self.send(self._config.get(CONF_SOUND_MODES)[sound_mode])) self._sound_mode = sound_mode<|docstring|>Select a specific source.<|endoftext|>
1a69e07812bcebaed83c59c842ac34560cb5c08dd84bff4a5904e5c210a6b494
async def async_play_media(self, media_type, media_id, **kwargs): 'Switch to a specific channel.' if (media_type != MEDIA_TYPE_CHANNEL): _LOGGER.error('Unsupported media type %s', media_type) return cv.positive_int(media_id) async with self._lock: for digit in media_id: ...
Switch to a specific channel.
media_player.py
async_play_media
elupus/hass_broadlink
0
python
async def async_play_media(self, media_type, media_id, **kwargs): if (media_type != MEDIA_TYPE_CHANNEL): _LOGGER.error('Unsupported media type %s', media_type) return cv.positive_int(media_id) async with self._lock: for digit in media_id: (await self.send(self._confi...
async def async_play_media(self, media_type, media_id, **kwargs): if (media_type != MEDIA_TYPE_CHANNEL): _LOGGER.error('Unsupported media type %s', media_type) return cv.positive_int(media_id) async with self._lock: for digit in media_id: (await self.send(self._confi...
21d900946eaf4ec8940e5315e6b8299dad5aa33097ad0a079a7d313377c2c69c
async def async_set_volume_level(self, volume): 'Set volume level, range 0..1.' if (CONF_VOLUME_SET not in self._config): raise NotImplementedError() config = self._config[CONF_VOLUME_SET] self._volume_calls += 1 volume_calls = self._volume_calls async with self._lock: if (self._...
Set volume level, range 0..1.
media_player.py
async_set_volume_level
elupus/hass_broadlink
0
python
async def async_set_volume_level(self, volume): if (CONF_VOLUME_SET not in self._config): raise NotImplementedError() config = self._config[CONF_VOLUME_SET] self._volume_calls += 1 volume_calls = self._volume_calls async with self._lock: if (self._volume_calls != volume_calls): ...
async def async_set_volume_level(self, volume): if (CONF_VOLUME_SET not in self._config): raise NotImplementedError() config = self._config[CONF_VOLUME_SET] self._volume_calls += 1 volume_calls = self._volume_calls async with self._lock: if (self._volume_calls != volume_calls): ...
a230e9d37929382ac7c4d37d01e5841e8e5641258dad013cd8b749e93f5ac13d
@property def media_content_type(self): 'Return content type currently active.' return MEDIA_TYPE_CHANNEL
Return content type currently active.
media_player.py
media_content_type
elupus/hass_broadlink
0
python
@property def media_content_type(self): return MEDIA_TYPE_CHANNEL
@property def media_content_type(self): return MEDIA_TYPE_CHANNEL<|docstring|>Return content type currently active.<|endoftext|>
73802913736db41b8ee5af3301696c7e7e568f1c9b236660f69b57e94b3c22c2
@property def source(self): 'Return the current input source.' return self._source
Return the current input source.
media_player.py
source
elupus/hass_broadlink
0
python
@property def source(self): return self._source
@property def source(self): return self._source<|docstring|>Return the current input source.<|endoftext|>
37ccfb26ea141436ffaade14b8373d43acac7c4bcb7c60307d9833bf76348149
@property def source_list(self): 'List of available input sources.' return list(self._config.get(CONF_SOURCES).keys())
List of available input sources.
media_player.py
source_list
elupus/hass_broadlink
0
python
@property def source_list(self): return list(self._config.get(CONF_SOURCES).keys())
@property def source_list(self): return list(self._config.get(CONF_SOURCES).keys())<|docstring|>List of available input sources.<|endoftext|>
72b3fd855ee04d1e34b2e973d1a8c166010065d48765c620671bb4f985362813
@property def sound_mode(self): 'Name of the current sound mode.' return self._sound_mode
Name of the current sound mode.
media_player.py
sound_mode
elupus/hass_broadlink
0
python
@property def sound_mode(self): return self._sound_mode
@property def sound_mode(self): return self._sound_mode<|docstring|>Name of the current sound mode.<|endoftext|>
60cd8e1cf51e50065f88b67119a23984b99b074dd5a547fab4bf31869bfc220a
@property def sound_mode_list(self): 'List of available sound modes.' return list(self._config.get(CONF_SOUND_MODES).keys())
List of available sound modes.
media_player.py
sound_mode_list
elupus/hass_broadlink
0
python
@property def sound_mode_list(self): return list(self._config.get(CONF_SOUND_MODES).keys())
@property def sound_mode_list(self): return list(self._config.get(CONF_SOUND_MODES).keys())<|docstring|>List of available sound modes.<|endoftext|>
cd2875b5eefff83c0e36834a340cf81a3e9a9fd0e28e1d29d10b2b36d3ba2cd3
@property def is_volume_muted(self): 'Boolean if volume is currently muted.' return self._muted
Boolean if volume is currently muted.
media_player.py
is_volume_muted
elupus/hass_broadlink
0
python
@property def is_volume_muted(self): return self._muted
@property def is_volume_muted(self): return self._muted<|docstring|>Boolean if volume is currently muted.<|endoftext|>
8de5b137b1b0ed8dcf592165e20993b960a54c967501a802c882b79ec2c96994
@property def media_title(self): 'Title of current playing media.' return self._source
Title of current playing media.
media_player.py
media_title
elupus/hass_broadlink
0
python
@property def media_title(self): return self._source
@property def media_title(self): return self._source<|docstring|>Title of current playing media.<|endoftext|>
33dd8fb90d485960332a9e72f1de42ec8bc55d9637144cb5904e9ec5a3220dc0
def _init_layers(self): 'Initialize layers of the head.' self.relu = nn.ReLU(inplace=True) self.p_cls_convs = nn.ModuleList() self.n_cls_convs = nn.ModuleList() self.w_cls_convs = nn.ModuleList() self.p_reg_convs = nn.ModuleList() self.n_reg_convs = nn.ModuleList() self.w_reg_convs = nn....
Initialize layers of the head.
mmdet/models/dense_heads/wan_base_head.py
_init_layers
jms0923/new-header
0
python
def _init_layers(self): self.relu = nn.ReLU(inplace=True) self.p_cls_convs = nn.ModuleList() self.n_cls_convs = nn.ModuleList() self.w_cls_convs = nn.ModuleList() self.p_reg_convs = nn.ModuleList() self.n_reg_convs = nn.ModuleList() self.w_reg_convs = nn.ModuleList() for i in range(...
def _init_layers(self): self.relu = nn.ReLU(inplace=True) self.p_cls_convs = nn.ModuleList() self.n_cls_convs = nn.ModuleList() self.w_cls_convs = nn.ModuleList() self.p_reg_convs = nn.ModuleList() self.n_reg_convs = nn.ModuleList() self.w_reg_convs = nn.ModuleList() for i in range(...
3302c7204e973bff3039e0ae21527602523aa53129e4dc95ac5412e9879ca0e3
def init_weights(self): 'Initialize weights of the head.' for m in self.n_cls_convs: normal_init(m.conv, std=0.01) for m in self.p_cls_convs: normal_init(m.conv, std=0.01) for m in self.w_cls_convs: normal_init(m.conv, std=0.01) for m in self.n_reg_convs: normal_init(...
Initialize weights of the head.
mmdet/models/dense_heads/wan_base_head.py
init_weights
jms0923/new-header
0
python
def init_weights(self): for m in self.n_cls_convs: normal_init(m.conv, std=0.01) for m in self.p_cls_convs: normal_init(m.conv, std=0.01) for m in self.w_cls_convs: normal_init(m.conv, std=0.01) for m in self.n_reg_convs: normal_init(m.conv, std=0.01) for m in se...
def init_weights(self): for m in self.n_cls_convs: normal_init(m.conv, std=0.01) for m in self.p_cls_convs: normal_init(m.conv, std=0.01) for m in self.w_cls_convs: normal_init(m.conv, std=0.01) for m in self.n_reg_convs: normal_init(m.conv, std=0.01) for m in se...
554afb8e85f81fc4a63fcde5b43bcd35e66c2907019a61366bf807cd77ef66b0
def forward(self, feats): 'Forward features from the upstream network.\n\n Args:\n feats (tuple[Tensor]): Features from the upstream network, each is\n a 4D-tensor.\n\n Returns:\n tuple: A tuple of classification scores and bbox prediction.\n\n - cls...
Forward features from the upstream network. Args: feats (tuple[Tensor]): Features from the upstream network, each is a 4D-tensor. Returns: tuple: A tuple of classification scores and bbox prediction. - cls_scores (list[Tensor]): Classification scores for all scale levels, ...
mmdet/models/dense_heads/wan_base_head.py
forward
jms0923/new-header
0
python
def forward(self, feats): 'Forward features from the upstream network.\n\n Args:\n feats (tuple[Tensor]): Features from the upstream network, each is\n a 4D-tensor.\n\n Returns:\n tuple: A tuple of classification scores and bbox prediction.\n\n - cls...
def forward(self, feats): 'Forward features from the upstream network.\n\n Args:\n feats (tuple[Tensor]): Features from the upstream network, each is\n a 4D-tensor.\n\n Returns:\n tuple: A tuple of classification scores and bbox prediction.\n\n - cls...
fc602d2d716f1bce2569e56c94a50bc1bb993a39ce310bc0b7eaefba9367a77c
def forward_single(self, x): 'Forward feature of a single scale level.\n\n Args:\n x (Tensor): Features of a single scale level.\n\n Returns:\n tuple:\n cls_score (Tensor): Cls scores for a single scale level\n the channels number is num_anchors ...
Forward feature of a single scale level. Args: x (Tensor): Features of a single scale level. Returns: tuple: cls_score (Tensor): Cls scores for a single scale level the channels number is num_anchors * num_classes. bbox_pred (Tensor): Box energies / deltas for a single scale ...
mmdet/models/dense_heads/wan_base_head.py
forward_single
jms0923/new-header
0
python
def forward_single(self, x): 'Forward feature of a single scale level.\n\n Args:\n x (Tensor): Features of a single scale level.\n\n Returns:\n tuple:\n cls_score (Tensor): Cls scores for a single scale level\n the channels number is num_anchors ...
def forward_single(self, x): 'Forward feature of a single scale level.\n\n Args:\n x (Tensor): Features of a single scale level.\n\n Returns:\n tuple:\n cls_score (Tensor): Cls scores for a single scale level\n the channels number is num_anchors ...
dd0c2a39fe509c9d72b7a38f9a3fd47f5d0c0b857279780f6147e4059568bc04
def _build_btree(self, prediction): 'Generate a prediction distribution over all tokens, for each batch sample.' embedding = self._dataset.get_embedding() token_vectors = embedding.get_tokens_values() token_vectors_shape = token_vectors.shape token_vectors_3d_pl = self._dual.add(self.embedding, shap...
Generate a prediction distribution over all tokens, for each batch sample.
rsm/components/token_embedding_decoder.py
_build_btree
Cerenaut/rsm
0
python
def _build_btree(self, prediction): embedding = self._dataset.get_embedding() token_vectors = embedding.get_tokens_values() token_vectors_shape = token_vectors.shape token_vectors_3d_pl = self._dual.add(self.embedding, shape=token_vectors_shape, default_value=0.0).add_pl() self._dual.set_values...
def _build_btree(self, prediction): embedding = self._dataset.get_embedding() token_vectors = embedding.get_tokens_values() token_vectors_shape = token_vectors.shape token_vectors_3d_pl = self._dual.add(self.embedding, shape=token_vectors_shape, default_value=0.0).add_pl() self._dual.set_values...
bbe506b58827f88998d09b85a97f0235b2af46c1691f18f727c7f43adbd6a9c1
def recursive_global_max_soln(self, root: TreeNode) -> int: '\n Recursive solution by updating a global maximum variable\n ' self.res = (- float('inf')) def helper(node: TreeNode) -> int: if (node is None): return 0 left_res = helper(node.left) right_res = ...
Recursive solution by updating a global maximum variable
Python/124.binary-tree-maximum-path-sum.py
recursive_global_max_soln
Dxyk/LeetCode
0
python
def recursive_global_max_soln(self, root: TreeNode) -> int: '\n \n ' self.res = (- float('inf')) def helper(node: TreeNode) -> int: if (node is None): return 0 left_res = helper(node.left) right_res = helper(node.right) self.res = max(self.res, ((le...
def recursive_global_max_soln(self, root: TreeNode) -> int: '\n \n ' self.res = (- float('inf')) def helper(node: TreeNode) -> int: if (node is None): return 0 left_res = helper(node.left) right_res = helper(node.right) self.res = max(self.res, ((le...
81a8d511e5225b3705f34689f2e80bcdc4aa6898a749c9ac1b813a5122799848
def recursive_soln(self, root: TreeNode) -> int: '\n Recursive solution by returning two values every call.\n\n The helper returns two values:\n - the max value when root is in the path (can only be a linked list)\n - the max value when the path starts with the root (can be a tree)\n ...
Recursive solution by returning two values every call. The helper returns two values: - the max value when root is in the path (can only be a linked list) - the max value when the path starts with the root (can be a tree)
Python/124.binary-tree-maximum-path-sum.py
recursive_soln
Dxyk/LeetCode
0
python
def recursive_soln(self, root: TreeNode) -> int: '\n Recursive solution by returning two values every call.\n\n The helper returns two values:\n - the max value when root is in the path (can only be a linked list)\n - the max value when the path starts with the root (can be a tree)\n ...
def recursive_soln(self, root: TreeNode) -> int: '\n Recursive solution by returning two values every call.\n\n The helper returns two values:\n - the max value when root is in the path (can only be a linked list)\n - the max value when the path starts with the root (can be a tree)\n ...
a59b129c9255add5c8422640010700f3a2040d9f3335120246d1caf5b92eb83a
def p_program(p): 'program : block DOT' p[0] = s.Program('<program>', [p[1]])
program : block DOT
parser.py
p_program
FaruNL/compiler-2
0
python
def p_program(p): p[0] = s.Program('<program>', [p[1]])
def p_program(p): p[0] = s.Program('<program>', [p[1]])<|docstring|>program : block DOT<|endoftext|>
34bd5c7c1cd468a1f4ec9ac4868e4e74d8f7249c614308eea293cdeaab24ff08
def p_block(p): 'block : constDecl varDecl procDecl statement' p[0] = s.Block('<block>', [p[1], p[2], p[3], p[4]])
block : constDecl varDecl procDecl statement
parser.py
p_block
FaruNL/compiler-2
0
python
def p_block(p): p[0] = s.Block('<block>', [p[1], p[2], p[3], p[4]])
def p_block(p): p[0] = s.Block('<block>', [p[1], p[2], p[3], p[4]])<|docstring|>block : constDecl varDecl procDecl statement<|endoftext|>
124028b8ede809ab27934021cf362ff05d341b6d02b7c4b22995efd0dbb5eb5e
def p_constDecl(p): 'constDecl : CONST constAssignmentList SEMI\n | empty' if (len(p) == 4): p[0] = s.ConstDecl('<constDecl1>', [p[2]]) else: p[0] = s.ConstDecl('<constDecl2>', [], 'empty')
constDecl : CONST constAssignmentList SEMI | empty
parser.py
p_constDecl
FaruNL/compiler-2
0
python
def p_constDecl(p): 'constDecl : CONST constAssignmentList SEMI\n | empty' if (len(p) == 4): p[0] = s.ConstDecl('<constDecl1>', [p[2]]) else: p[0] = s.ConstDecl('<constDecl2>', [], 'empty')
def p_constDecl(p): 'constDecl : CONST constAssignmentList SEMI\n | empty' if (len(p) == 4): p[0] = s.ConstDecl('<constDecl1>', [p[2]]) else: p[0] = s.ConstDecl('<constDecl2>', [], 'empty')<|docstring|>constDecl : CONST constAssignmentList SEMI | empty<|endoftext|>
648c9b060394f7bf17435f4ce9e131b0cff5fa3bb8fe159441d42482512fbe1a
def p_constAssignmentList(p): 'constAssignmentList : ID ASSIGN NUMBER\n | constAssignmentList COMMA ID ASSIGN NUMBER' if (len(p) == 4): p[0] = s.ConstAssignmentList('<constAssignmentList1>', [], [p[1], p[3]]) else: p[0] = s.ConstAssignmentList('<constAssignmentList2...
constAssignmentList : ID ASSIGN NUMBER | constAssignmentList COMMA ID ASSIGN NUMBER
parser.py
p_constAssignmentList
FaruNL/compiler-2
0
python
def p_constAssignmentList(p): 'constAssignmentList : ID ASSIGN NUMBER\n | constAssignmentList COMMA ID ASSIGN NUMBER' if (len(p) == 4): p[0] = s.ConstAssignmentList('<constAssignmentList1>', [], [p[1], p[3]]) else: p[0] = s.ConstAssignmentList('<constAssignmentList2...
def p_constAssignmentList(p): 'constAssignmentList : ID ASSIGN NUMBER\n | constAssignmentList COMMA ID ASSIGN NUMBER' if (len(p) == 4): p[0] = s.ConstAssignmentList('<constAssignmentList1>', [], [p[1], p[3]]) else: p[0] = s.ConstAssignmentList('<constAssignmentList2...
af6ebf1f120f9e448a47e2a64cad8e60bfcb07e101a9cc4726d3128a1e07dc46
def p_varDecl(p): 'varDecl : VAR identList SEMI\n | empty' if (len(p) == 4): p[0] = s.VarDecl('<varDecl1>', [p[2]]) else: p[0] = s.VarDecl('<varDecl2>', [], 'empty')
varDecl : VAR identList SEMI | empty
parser.py
p_varDecl
FaruNL/compiler-2
0
python
def p_varDecl(p): 'varDecl : VAR identList SEMI\n | empty' if (len(p) == 4): p[0] = s.VarDecl('<varDecl1>', [p[2]]) else: p[0] = s.VarDecl('<varDecl2>', [], 'empty')
def p_varDecl(p): 'varDecl : VAR identList SEMI\n | empty' if (len(p) == 4): p[0] = s.VarDecl('<varDecl1>', [p[2]]) else: p[0] = s.VarDecl('<varDecl2>', [], 'empty')<|docstring|>varDecl : VAR identList SEMI | empty<|endoftext|>
71172b027d59221cf1abc905f2d0cdd6fe54819eb417c5e5ef1d13bb315ce0fb
def p_identList(p): 'identList : ID\n | identList COMMA ID' if (len(p) == 2): p[0] = s.IdentList('<identList1>', [], p[1]) else: p[0] = s.IdentList('<identList2>', [p[1]], p[3])
identList : ID | identList COMMA ID
parser.py
p_identList
FaruNL/compiler-2
0
python
def p_identList(p): 'identList : ID\n | identList COMMA ID' if (len(p) == 2): p[0] = s.IdentList('<identList1>', [], p[1]) else: p[0] = s.IdentList('<identList2>', [p[1]], p[3])
def p_identList(p): 'identList : ID\n | identList COMMA ID' if (len(p) == 2): p[0] = s.IdentList('<identList1>', [], p[1]) else: p[0] = s.IdentList('<identList2>', [p[1]], p[3])<|docstring|>identList : ID | identList COMMA ID<|endoftext|>
829b45357a3f7199f0283bf3fa516689aa3fec4874ca99bbe8c67b0038db4a56
def p_procDecl(p): 'procDecl : procDecl PROCEDURE ID SEMI block SEMI\n | empty' if (len(p) == 7): p[0] = s.ProcDecl('<procDecl1>', [p[1], p[5]], p[3]) else: p[0] = s.ProcDecl('<procDecl2>', [], 'empty')
procDecl : procDecl PROCEDURE ID SEMI block SEMI | empty
parser.py
p_procDecl
FaruNL/compiler-2
0
python
def p_procDecl(p): 'procDecl : procDecl PROCEDURE ID SEMI block SEMI\n | empty' if (len(p) == 7): p[0] = s.ProcDecl('<procDecl1>', [p[1], p[5]], p[3]) else: p[0] = s.ProcDecl('<procDecl2>', [], 'empty')
def p_procDecl(p): 'procDecl : procDecl PROCEDURE ID SEMI block SEMI\n | empty' if (len(p) == 7): p[0] = s.ProcDecl('<procDecl1>', [p[1], p[5]], p[3]) else: p[0] = s.ProcDecl('<procDecl2>', [], 'empty')<|docstring|>procDecl : procDecl PROCEDURE ID SEMI block SEMI | empty<|endo...
e0d0ca5bad1e7f647bd439ecd09aa00ed44675fde20f5cbd93c3efb642a73a54
def p_statement(p): 'statement : ID UPDATE expression\n | CALL ID\n | BEGIN statementList END\n | IF condition THEN statement\n | WHILE condition DO statement\n | empty' if (len(p) == 4): if (p[2] == ':='): p[0] ...
statement : ID UPDATE expression | CALL ID | BEGIN statementList END | IF condition THEN statement | WHILE condition DO statement | empty
parser.py
p_statement
FaruNL/compiler-2
0
python
def p_statement(p): 'statement : ID UPDATE expression\n | CALL ID\n | BEGIN statementList END\n | IF condition THEN statement\n | WHILE condition DO statement\n | empty' if (len(p) == 4): if (p[2] == ':='): p[0] ...
def p_statement(p): 'statement : ID UPDATE expression\n | CALL ID\n | BEGIN statementList END\n | IF condition THEN statement\n | WHILE condition DO statement\n | empty' if (len(p) == 4): if (p[2] == ':='): p[0] ...
d5c8839b5e007948cc9b124c49436bf4a3502336337cb6bbc776d32300852241
def p_statementList(p): 'statementList : statement\n | statementList SEMI statement' if (len(p) == 2): p[0] = s.StatementList('<statementList1>', [p[1]]) else: p[0] = s.StatementList('<statementList2>', [p[1], p[3]])
statementList : statement | statementList SEMI statement
parser.py
p_statementList
FaruNL/compiler-2
0
python
def p_statementList(p): 'statementList : statement\n | statementList SEMI statement' if (len(p) == 2): p[0] = s.StatementList('<statementList1>', [p[1]]) else: p[0] = s.StatementList('<statementList2>', [p[1], p[3]])
def p_statementList(p): 'statementList : statement\n | statementList SEMI statement' if (len(p) == 2): p[0] = s.StatementList('<statementList1>', [p[1]]) else: p[0] = s.StatementList('<statementList2>', [p[1], p[3]])<|docstring|>statementList : statement | statementList S...
dc82d3ebf71bea132cccd3d5e544266440bac5f8e5eca8fd90e108e8a898580c
def p_condition(p): 'condition : ODD expression\n | expression relation expression' if (len(p) == 3): p[0] = s.Condition('<condition1>', [p[2]]) else: p[0] = s.Condition('<condition2>', [p[1], p[2], p[3]])
condition : ODD expression | expression relation expression
parser.py
p_condition
FaruNL/compiler-2
0
python
def p_condition(p): 'condition : ODD expression\n | expression relation expression' if (len(p) == 3): p[0] = s.Condition('<condition1>', [p[2]]) else: p[0] = s.Condition('<condition2>', [p[1], p[2], p[3]])
def p_condition(p): 'condition : ODD expression\n | expression relation expression' if (len(p) == 3): p[0] = s.Condition('<condition1>', [p[2]]) else: p[0] = s.Condition('<condition2>', [p[1], p[2], p[3]])<|docstring|>condition : ODD expression | expression relation expressio...
0a31a6658ac37c72465d4f3d94335956f683efc582b806638832e9e34917dc5b
def p_relation(p): 'relation : ASSIGN\n | NE\n | LT\n | GT\n | LTE\n | GTE' if (p[1] == '='): p[0] = s.Relation('<relation>', [], p[1]) elif (p[1] == '<>'): p[0] = s.Relation('<relation>', [], p[1]) elif (p[1] == ...
relation : ASSIGN | NE | LT | GT | LTE | GTE
parser.py
p_relation
FaruNL/compiler-2
0
python
def p_relation(p): 'relation : ASSIGN\n | NE\n | LT\n | GT\n | LTE\n | GTE' if (p[1] == '='): p[0] = s.Relation('<relation>', [], p[1]) elif (p[1] == '<>'): p[0] = s.Relation('<relation>', [], p[1]) elif (p[1] == ...
def p_relation(p): 'relation : ASSIGN\n | NE\n | LT\n | GT\n | LTE\n | GTE' if (p[1] == '='): p[0] = s.Relation('<relation>', [], p[1]) elif (p[1] == '<>'): p[0] = s.Relation('<relation>', [], p[1]) elif (p[1] == ...
8bd65a342da62e2b7bc52fb1b8fc661db423cfd06b81a07ac6f1230f9f9312a7
def p_expression(p): 'expression : term\n | addingOperator term\n | expression addingOperator term' if (len(p) == 2): p[0] = s.Expression('<expression1>', [p[1]]) elif (len(p) == 3): p[0] = s.Expression('<expression2>', [p[1], p[2]]) else: p[0] =...
expression : term | addingOperator term | expression addingOperator term
parser.py
p_expression
FaruNL/compiler-2
0
python
def p_expression(p): 'expression : term\n | addingOperator term\n | expression addingOperator term' if (len(p) == 2): p[0] = s.Expression('<expression1>', [p[1]]) elif (len(p) == 3): p[0] = s.Expression('<expression2>', [p[1], p[2]]) else: p[0] =...
def p_expression(p): 'expression : term\n | addingOperator term\n | expression addingOperator term' if (len(p) == 2): p[0] = s.Expression('<expression1>', [p[1]]) elif (len(p) == 3): p[0] = s.Expression('<expression2>', [p[1], p[2]]) else: p[0] =...
7517bc10cfcc30fd7edfa758a25896b901e834c2d1c71abae62c3bd7fbbc4e4b
def p_addingOperator(p): 'addingOperator : PLUS\n | MINUS' if (p[1] == '+'): p[0] = s.AddingOperator('<adding_op>', [], p[1]) else: p[0] = s.AddingOperator('<adding_op>', [], p[1])
addingOperator : PLUS | MINUS
parser.py
p_addingOperator
FaruNL/compiler-2
0
python
def p_addingOperator(p): 'addingOperator : PLUS\n | MINUS' if (p[1] == '+'): p[0] = s.AddingOperator('<adding_op>', [], p[1]) else: p[0] = s.AddingOperator('<adding_op>', [], p[1])
def p_addingOperator(p): 'addingOperator : PLUS\n | MINUS' if (p[1] == '+'): p[0] = s.AddingOperator('<adding_op>', [], p[1]) else: p[0] = s.AddingOperator('<adding_op>', [], p[1])<|docstring|>addingOperator : PLUS | MINUS<|endoftext|>
c4317d4e28548946d5ceff818ba4d26d552be5c2ac1b7ec05014904a684f4526
def p_term(p): 'term : factor\n | term multiplyingOperator factor' if (len(p) == 2): p[0] = s.Term('<term1>', [p[1]]) else: p[0] = s.Term('<term2>', [p[1], p[2], p[3]])
term : factor | term multiplyingOperator factor
parser.py
p_term
FaruNL/compiler-2
0
python
def p_term(p): 'term : factor\n | term multiplyingOperator factor' if (len(p) == 2): p[0] = s.Term('<term1>', [p[1]]) else: p[0] = s.Term('<term2>', [p[1], p[2], p[3]])
def p_term(p): 'term : factor\n | term multiplyingOperator factor' if (len(p) == 2): p[0] = s.Term('<term1>', [p[1]]) else: p[0] = s.Term('<term2>', [p[1], p[2], p[3]])<|docstring|>term : factor | term multiplyingOperator factor<|endoftext|>
f57adadfb28672a3f71bfe40ae1bbcdd5208d11c12a5029c9cc958fba6548552
def p_multiplyingOperator(p): 'multiplyingOperator : TIMES\n | DIVIDE' if (p[1] == '*'): p[0] = s.MultiplyingOperator('<multiply_op>', [], p[1]) else: p[0] = s.MultiplyingOperator('<multiply_op>', [], p[1])
multiplyingOperator : TIMES | DIVIDE
parser.py
p_multiplyingOperator
FaruNL/compiler-2
0
python
def p_multiplyingOperator(p): 'multiplyingOperator : TIMES\n | DIVIDE' if (p[1] == '*'): p[0] = s.MultiplyingOperator('<multiply_op>', [], p[1]) else: p[0] = s.MultiplyingOperator('<multiply_op>', [], p[1])
def p_multiplyingOperator(p): 'multiplyingOperator : TIMES\n | DIVIDE' if (p[1] == '*'): p[0] = s.MultiplyingOperator('<multiply_op>', [], p[1]) else: p[0] = s.MultiplyingOperator('<multiply_op>', [], p[1])<|docstring|>multiplyingOperator : TIMES | DIVIDE<|endoftext...