query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
no exception on SELECT for numeric column name
def test_no_exception_on_select(self): try: self.session.execute('SELECT * FROM test1rf.table_num_col') except ValueError as e: self.fail("Unexpected ValueError exception: %s" % e.message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_numeric_column(name : float) -> float:\n if name > -1 and name < 1:\n name = 0\n return name", "def test_can_select_using_alias(self):\n if self._cass_version < (2, 0, 0):\n raise unittest.SkipTest(\"Alias in SELECT not supported before 2.0\")\n\n try:\n ...
[ "0.6626339", "0.64870787", "0.63578224", "0.6135154", "0.6119534", "0.6035022", "0.6033631", "0.6013772", "0.5946618", "0.5906085", "0.5871412", "0.58308166", "0.58293074", "0.57759345", "0.57723314", "0.5728022", "0.56890184", "0.5686087", "0.5676913", "0.566258", "0.5657317...
0.6164509
3
can SELECT "" AS aliases
def test_can_select_using_alias(self): if self._cass_version < (2, 0, 0): raise unittest.SkipTest("Alias in SELECT not supported before 2.0") try: self.session.execute('SELECT key, "626972746864617465" AS my_col from test1rf.table_num_col') except ValueError as e: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __alias(self, alias):\n col = copy.deepcopy(self)\n col.thisptr[\"as_\"] = alias\n return col", "def test_aliasing() -> None:\n processed = parse_and_process(\n {\n \"aggregations\": [],\n \"groupby\": [],\n \"selected_columns\": [\"tags_value\"],\n ...
[ "0.636288", "0.6311065", "0.629858", "0.6173639", "0.6164102", "0.6145213", "0.6002747", "0.59780675", "0.5969748", "0.5954351", "0.59196556", "0.5901071", "0.58318216", "0.58098507", "0.5716049", "0.5576109", "0.5519859", "0.54283607", "0.5419169", "0.54156923", "0.53961104"...
0.65787524
0
can SELECT numeric column using dict_factory
def test_can_select_with_dict_factory(self): self.session.row_factory = dict_factory try: self.session.execute('SELECT * FROM test1rf.table_num_col') except ValueError as e: self.fail("Unexpected ValueError exception: %s" % e.message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_cast_non_numeric_true():\n assert _currency_column_to_numeric(\"foo\", {\"foo\": 42}) == 42", "def test_dummydb_add_data_to_table_wrong_column_type(self):\n db = DummyDB()\n columns = {\n \"one\": int,\n \"two\": str,\n \"three\": bool,\n }\n ...
[ "0.5937552", "0.5865882", "0.58389556", "0.5803438", "0.57932466", "0.57872504", "0.5761668", "0.5696834", "0.5683577", "0.5645499", "0.5607317", "0.5541275", "0.55096924", "0.5468403", "0.5463897", "0.54299223", "0.54296225", "0.5422627", "0.5389001", "0.5386752", "0.5361337...
0.76515603
0
Create a pattern for dense op followed by activations.
def make_gemm_pattern(with_bias=True, with_act=None, out_dtype="float16"): data = wildcard() weight = wildcard() bias = wildcard() gemm = is_op("nn.dense")(data, weight) if with_bias: add_or_bias_add = is_op("add") | is_op("nn.bias_add") gemm_out = add_or_bias_add(gemm, bias) els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dense_pattern():\n pattern = is_op(\"nn.dense\")(wildcard(), is_constant())\n return pattern", "def build_dense(self): # Pass state_size and action_size\n model = Sequential()\n model.add(Dense(24, input_dim = grid_size*grid_size+2, activation = 'relu'))\n model.add(Dense(2...
[ "0.69449264", "0.62637776", "0.59782976", "0.57860476", "0.5729001", "0.5647342", "0.55941767", "0.55772847", "0.5576438", "0.5543127", "0.5528706", "0.5513469", "0.550603", "0.5490817", "0.5490472", "0.547368", "0.5409983", "0.5396722", "0.53857964", "0.53843766", "0.5366124...
0.5065252
52
Partition the input module into CUTLASSsupported subgraphs.
def partition_for_cutlass(mod): dense_pat = ("cutlass.dense", make_gemm_pattern(False, None)) dense_bias_pat = ("cutlass.dense_bias", make_gemm_pattern(True, None)) dense_bias_relu_pat = ("cutlass.dense_bias_relu", make_gemm_pattern(True, "relu")) dense_bias_gelu_fp16_pat = ("cutlass.dense_bias_gelu_fp1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partition_for_cutlass(mod):\n\n cutlass_patterns = get_patterns_with_prefix(\"cutlass\")\n return transform.FuseOpsByPattern(cutlass_patterns, annotate_codegen=True)(mod)", "def _split_block(block: PruningBlock, list_output_channels: List[int]) -> List[PruningBlock]:\n if len(list_output_channel...
[ "0.59069586", "0.53911424", "0.5344001", "0.53298855", "0.5212837", "0.5204213", "0.515992", "0.51125705", "0.51123255", "0.51100886", "0.5097291", "0.5090909", "0.5089643", "0.5088922", "0.50566685", "0.50541466", "0.5050671", "0.50423294", "0.50327724", "0.5027155", "0.5004...
0.61335194
0
The main function tests the Money class
def main(): account1 = Money(87, 15) account2 = Money(5, 5) account3 = Money(99, 99) # Display each account balance account1.display() account2.display() account3.display() # Now add 20 cents to each account1.add_cents(20) account2.add_cents(20) account3.add_cents(20) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n print(cash_money(44.333333))", "def main():\n user_input_of_coins() # can be used interactively just for fun, but use the test_suite to document your testing!\n i_steal_pennies_test_suite()", "def test_cash(currency, expected):\n cash = Cash(currency)\n\n assert cash.cash_like\n...
[ "0.72139496", "0.69076437", "0.67491144", "0.67438227", "0.6628634", "0.66153073", "0.6605556", "0.65554094", "0.65319616", "0.6529885", "0.6458304", "0.6453191", "0.6426575", "0.64249456", "0.63660604", "0.63612753", "0.6349598", "0.63436437", "0.6340613", "0.63082784", "0.6...
0.61805665
25
Sets the file status for the transformation.
def export_setFileStatusForTransformation( self, transName, dictOfNewFilesStatus, lfns = [], force = False ): # create dictionary in case newLFNsStatus is a string - for backward compatibility if type( dictOfNewFilesStatus ) == type( '' ): dictOfNewFilesStatus = dict( [( lfn, dictOfNewFilesStatus ) for l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_status(self, root, status='queued'):\n # Touch the status file\n Path(f'{root}.{status}').touch()", "def setStatus(self, status):\n self.__status = status", "def set_status(self, status):\n self.status = status", "def set_status(self, status):\n self.status = status...
[ "0.7175725", "0.65127814", "0.6433674", "0.6433674", "0.6433674", "0.6375382", "0.63637346", "0.63637346", "0.63637346", "0.63637346", "0.63637346", "0.63637346", "0.63637346", "0.6295676", "0.6295676", "0.6295676", "0.6295676", "0.6295676", "0.6295676", "0.6295676", "0.62956...
0.57085925
56
Get information necessary for submission for a given number of tasks for a given transformation
def export_getTasksToSubmit( self, transName, numTasks, site = '' ): res = database.getTransformation( transName ) if not res['OK']: return self._parseRes( res ) transDict = res['Value'] submitDict = {} res = database.getTasksForSubmission( transName, numTasks = numTasks, site = site, statusLi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_getTransformationSummary( self ):\n res = database.getTransformations()\n if not res['OK']:\n return self._parseRes( res )\n transList = res['Value']\n resultDict = {}\n for transDict in transList:\n transID = transDict['TransformationID']\n res = database.getTransformation...
[ "0.623155", "0.60763425", "0.5879088", "0.58649737", "0.5762035", "0.5725441", "0.572414", "0.5709796", "0.57081753", "0.5671693", "0.5655901", "0.56209475", "0.56138736", "0.5600613", "0.5560714", "0.5550168", "0.55358416", "0.5526346", "0.551553", "0.54855865", "0.54538816"...
0.686788
0
Interface provides [ LFN1, LFN2, ... ]
def export_removeFile( self, lfns ): res = database.removeFile( lfns ) return self._parseRes( res )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interfaces(self):", "def interfaces(self):", "def funcs(self) -> {str:TFunc}:\n raise NotImplementedError()", "def __init__(self, *args, **kwargs):\n super(LinlLis, self).__init__(\n ('linl', Bits(maxlen=4)),\n ('lis', Bits(maxlen=4)),\n *args, **kwargs\n ...
[ "0.5610785", "0.5610785", "0.5367572", "0.52866465", "0.52454317", "0.5221648", "0.51756907", "0.5152586", "0.5136532", "0.51314527", "0.5128591", "0.510768", "0.50772685", "0.50709623", "0.50140613", "0.50140613", "0.50059235", "0.49783444", "0.4958739", "0.49535495", "0.491...
0.0
-1
Interface provides [LFN1, LFN2, ...] Fake the FC behavior, as not used
def export_getReplicas( self, lfns ): resdict = {} for lfn in lfns: resdict[lfn] = True return S_OK( {'Successful':resdict, 'Failed':{}} )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, f: Callable[..., int]) -> BaseNLPLabelingFunction:\n if self._lf_cls is None:\n raise NotImplementedError(\"_lf_cls must be defined\")\n name = self.name or f.__name__\n return self._lf_cls(\n name=name,\n f=f,\n resources=self.res...
[ "0.5938588", "0.563795", "0.54958016", "0.5464952", "0.5458849", "0.54059863", "0.53839874", "0.53561264", "0.5292571", "0.5274054", "0.52460533", "0.5222165", "0.52072513", "0.5190229", "0.51866394", "0.5155751", "0.51555014", "0.5153614", "0.5137779", "0.51284117", "0.51246...
0.0
-1
Get the summary of the currently existing transformations
def export_getTransformationSummary( self ): res = database.getTransformations() if not res['OK']: return self._parseRes( res ) transList = res['Value'] resultDict = {} for transDict in transList: transID = transDict['TransformationID'] res = database.getTransformationTaskStats( tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def summary(self):\n raise NotImplementedError", "def get_summary(self):\n return self.model.summary()", "def summary(self):\r\n self.base.summary()\r\n self.extra_layers.summary()\r\n self.detector.summary()", "def get_transform(self):\n raise NotImplementedError", ...
[ "0.65079284", "0.6279362", "0.62648493", "0.62475646", "0.62274456", "0.62240434", "0.62154925", "0.6186748", "0.61818343", "0.61730766", "0.61704767", "0.614142", "0.612256", "0.612256", "0.6067224", "0.6067224", "0.6067224", "0.6067224", "0.6067224", "0.6067224", "0.6067224...
0.7311224
0
Get the summary of the transformation information for a given page in the generic format
def export_getTransformationSummaryWeb( self, selectDict, sortList, startItem, maxItems ): # Obtain the timing information from the selectDict last_update = selectDict.get( 'CreationDate', None ) if last_update: del selectDict['CreationDate'] fromDate = selectDict.get( 'FromDate', None ) if f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_getTransformationSummary( self ):\n res = database.getTransformations()\n if not res['OK']:\n return self._parseRes( res )\n transList = res['Value']\n resultDict = {}\n for transDict in transList:\n transID = transDict['TransformationID']\n res = database.getTransformation...
[ "0.61735827", "0.5969714", "0.5888698", "0.5731358", "0.55391246", "0.55020785", "0.53786826", "0.52597386", "0.5222127", "0.5156251", "0.5104135", "0.510379", "0.50881475", "0.5082886", "0.5061832", "0.5056207", "0.5036066", "0.5029998", "0.49984467", "0.4997101", "0.4994368...
0.54115206
6
Counts the number of each type of example in a dataset.
def class_counts(rows): counts = {} # a dictionary of label -> count. for row in rows: # in our dataset format, the label is always the last column label = row[-1] if label not in counts: counts[label] = 0 counts[label] += 1 return counts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_elements_in_dataset(dataset):\n return dataset.count()", "def count_target_class_data(data, target_class):\n count = 0\n for row in data:\n if row[0] == target_class:\n count += 1\n\n return count", "def trainCount(\n trainData, \n questionT...
[ "0.71253854", "0.65479636", "0.6473189", "0.6431713", "0.6407021", "0.63829803", "0.6357339", "0.62958163", "0.62783915", "0.62480533", "0.61769986", "0.6171853", "0.6163812", "0.61356765", "0.61179817", "0.6109011", "0.61071324", "0.60932845", "0.60897833", "0.6079065", "0.6...
0.5965424
30
World's most elegant tree printing function.
def print_tree(node, spacing=""): # Base case: we've reached a leaf if isinstance(node, Leaf): print (spacing + "Predict", node.predictions) return # Print the question at this node print(spacing + node.question.text()) # Call this function recursively on the true branch print...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_tree(self):\n\t\tprint(self.__print_tree('', True, ''))", "def print_tree(self):\n return \"\"", "def print_tree(node):\n print tree(node)", "def print_tree(t):\r\n if (t==None):\r\n return \r\n else:\r\n print_tree(left(t))\r\n print(value(t),end=\" \")\r\n ...
[ "0.8495652", "0.8245686", "0.81985503", "0.81278294", "0.8126809", "0.7931839", "0.78808343", "0.7869507", "0.7855223", "0.7850252", "0.7823209", "0.77908087", "0.77828753", "0.776468", "0.7756501", "0.7752859", "0.7728939", "0.7720494", "0.770831", "0.76983875", "0.76983875"...
0.73968357
41
This function takes a multibyte key and a multibyte message. It returns a string that is obtained by XORing each byte of the message with each byte of the key which keeps rotating.
def xorstr (key, msg): # join a list of chars into string where list is generated by # XORing each of msg bytes with each of the key bytes rotating. return ''.join([chr(ord(msg[i]) ^ ord(key[i % len(key)])) for i in range (0, len(msg))])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repeating_key_xor(msg_b, key_b):\n l = len(key_b)\n return bytes(key_b[n % l] ^ c_i for n, c_i in enumerate(msg_b))", "def repeating_key_xor(plaintext, key):\n ciphertext = ''\n i = 0\n\n for byte in plaintext:\n ciphertext += chr(byte ^ key[i])\n\n i = (i + 1) % len(key)\n re...
[ "0.77024674", "0.74073726", "0.7340499", "0.70112485", "0.69480264", "0.69072014", "0.68998545", "0.6897194", "0.68671113", "0.6866306", "0.6835984", "0.682718", "0.6777031", "0.67250794", "0.6684219", "0.6653365", "0.664022", "0.663142", "0.6613621", "0.6595081", "0.6535161"...
0.8094801
0
This function takes an XORencrypted string as argument and tries to guess which among the printable characters could be used as a key to XOR a plaintext string.
def guess_keychar (msg): maxkey = maxval = 0 for key in string.printable: value = string_rank (xorstr (key, msg)) if value > maxval: maxval = value maxkey = key return (maxkey,maxval)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decipher_single_char_xored(cipher_text):\n best_score = 0\n p = ''\n key = -1\n for i in range(0,256):\n c = xor_hex(cipher_text,(chr(i) * (len(cipher_text) / 2)).encode('hex'))\n if score(c.decode('hex')) > best_score:\n best_score = score(c.decode('hex'))\n p =...
[ "0.66788334", "0.6657041", "0.64325774", "0.6413153", "0.6324839", "0.6310117", "0.6294812", "0.62839866", "0.6270165", "0.62504333", "0.61942893", "0.6182015", "0.6177589", "0.6154512", "0.6113878", "0.6096742", "0.6086327", "0.6076872", "0.6054841", "0.6046115", "0.6034629"...
0.57404876
39
This function returns a rank to a string depending on occurrance frequencies of each of the characters in it.
def string_rank (text): freq_set = { ' ':13.00, 'e':12.70, 't':9.056, 'a':8.167, 'o':7.507, 'i':6.966, 'n':6.749, 's':6.327, 'h':6.094, 'r':5.987, 'd':4.253, 'l':4.025, 'u':2.758, 'b':1.492, 'c':2.782, 'f':2.228, 'g':2.015, 'j':0.153, 'k':0.772, 'm':2.406, 'p':1.929, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frequencyLetterDic(s):\n pass", "def score(str_bytes):\n freq_score = sum([character_frequencies.get(chr(letter).lower(), -100) for letter in str_bytes])\n return math.ceil(freq_score * 100) / 100", "def tally_letters(string):\n output = dict()\n for char in list(string):\n freq = out...
[ "0.67854005", "0.6674452", "0.65107816", "0.6388476", "0.63569343", "0.6356804", "0.6259678", "0.62542886", "0.62187475", "0.61911213", "0.6176556", "0.61291283", "0.6125808", "0.6125808", "0.61180437", "0.60744417", "0.60263556", "0.6003472", "0.5980236", "0.59661067", "0.59...
0.79308665
0
This function calculates the binary Hamming distance of 2 strings by converting
def edit_distance (str1, str2): str1.strip() str2.strip() if len(str1) != len(str2): raise ValueError("Strings have to be of equal lengths: " + str1 + " and " + str2) return sum(bit=='1' for bit in bin(int(binascii.hexlify(xorstr(str1, str2)), 16)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def HammingDist(str1, str2):\n\tHdist = 0\n\tfor i, base in enumerate(str1):\n\t\tif base != str2[i]:\n\t\t\tHdist += 1\n\n\treturn Hdist", "def hamming_dist(bytes1, bytes2):\n if type(bytes1) == str:\n bytes1 = [ord(c) for c in str1]\n if type(bytes2) == str:\n bytes2 = [ord(c) for c in str2...
[ "0.84647644", "0.84023887", "0.83347034", "0.8326972", "0.8308358", "0.8137487", "0.8136767", "0.8125086", "0.81187636", "0.79529357", "0.7932111", "0.7905424", "0.78473914", "0.77683306", "0.7704884", "0.76946086", "0.7677987", "0.7667733", "0.76575166", "0.76161945", "0.755...
0.7592945
20
Returns a dictionary of SIZEs and their normalized edit distance calculated using the first and the next SIZE bytes
def get_key_distances (encr_text, smallest, biggest): return [(i, float(edit_distance (encr_text[0:i], encr_text[i:2*i])) / i) for i in range (smallest, biggest)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_size_distribution(self) -> Dict[int, int]:\n size_dist = dict()\n for complex_expression, complex_abundance in self.get_all_complexes_and_abundances():\n current_size = complex_expression.get_size_of_complex()\n if current_size in size_dist:\n size_dist[cu...
[ "0.5661745", "0.5561663", "0.5538229", "0.5436049", "0.5388824", "0.5320221", "0.5254308", "0.525339", "0.52521443", "0.5248006", "0.5232125", "0.52064806", "0.517017", "0.514497", "0.51310617", "0.51250356", "0.5100988", "0.50871766", "0.5086391", "0.50780386", "0.50711966",...
0.52251655
11
This function returns a keyphrase guessed from the given cryptotext and keysize
def guess_keyphrase (encr_text, keysize): # First calculate the number of blocks of keysize length block_size = (len(encr_text) / keysize) + 1 # Pad the string with appropriate number of NULs to form a blocksize multiple length string encr_text = encr_text.ljust(block_size * keysize, '\0') keyphras...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_random_key(self, size=16):\n key = ''.join([random.choice(Characters.get_characters()) for i in range(size)])\n return self.__strengthen_key(key)", "def crypt(text, passphrase, which):\n text = scrub_string(text)\n passphrase = scrub_string(passphrase)\n letters = (\n shift_...
[ "0.59493685", "0.58640945", "0.5855858", "0.5819205", "0.57508624", "0.56276083", "0.5525338", "0.549947", "0.54791176", "0.5433029", "0.5421609", "0.5369842", "0.53502756", "0.5331022", "0.53000695", "0.5294777", "0.5280605", "0.525854", "0.5245192", "0.5236226", "0.52084154...
0.82391196
0
takes a dictionary and returns the key with maximum value
def keymaxval (dictionary): values = list (dictionary.values()) return list(dictionary.keys())[values.index(max(values))]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keywithmaxval(dictionary): # from https://stackoverflow.com/questions/268272/getting-key-with-maximum-value-in-dictionary/12343826#12343826 \n\tv=list(dictionary.values())\n\tk=list(dictionary.keys())\n\treturn k[v.index(max(v))]", "def keywithmaxval(d): \n v=list(d.values())\n k=list(d.keys())\n ...
[ "0.9108784", "0.8779468", "0.8779468", "0.8779468", "0.8764752", "0.8715707", "0.8689147", "0.8686016", "0.86419255", "0.84441763", "0.8294891", "0.80829793", "0.7813753", "0.7770808", "0.7702682", "0.766578", "0.7500965", "0.7486488", "0.7438958", "0.7401954", "0.7347957", ...
0.86094373
9
Configura o novo BER
def setBER(self, ber: float) -> float: self.BER = ber
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setBER(self, BER):\n \n self.BER = BER", "def __init__(self):\n # self.baud = baud\n # self.protocol = protocol\n pass", "def calculateBER(self):\n pass", "def __init__(self, random_pad, checksum, seq_num):\n self.version = b\"\\x01\\x00\\x00\\x00\"\n ...
[ "0.6076538", "0.5964742", "0.5922357", "0.55803216", "0.5533285", "0.55167687", "0.55090714", "0.5382166", "0.5379802", "0.5312984", "0.52766585", "0.524864", "0.5225844", "0.5225715", "0.51963586", "0.5188477", "0.5177202", "0.5167317", "0.51601887", "0.51491755", "0.5143741...
0.570669
3
Reset the robot degrees of freedom (qpos and qvel). Implement this in each subclass.
def reset_model(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n self._position = TwoDV(0.0, 0.0)\n self._orient = TNavigator.START_ORIENTATION[self._mode]", "def specific_reset(self) -> None:\n self.agent.specific_reset() # reset joints\n new_pos = self.agent.init_xyz\n new_pos[:2] = np.random.uniform(-0.01, 0.01, 2)\n ...
[ "0.65381956", "0.6534427", "0.64601964", "0.64152855", "0.638593", "0.63808763", "0.6350867", "0.6243421", "0.6237416", "0.6203032", "0.616383", "0.6139647", "0.61214375", "0.6117211", "0.6117044", "0.6100162", "0.60862786", "0.60666794", "0.6064779", "0.6036483", "0.6029228"...
0.0
-1
This method is called when the viewer is initialized and after every reset Optionally implement this method, if you need to tinker with camera position and so forth.
def viewer_setup(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setupCamera(self) :\n\t\tbase.disableMouse()\n\t\tbase.camera.setPos(self.avatarNP.getPos())\n\t\tbase.camera.setZ(self.avatarNP.getZ()+1.5)\n\t\tbase.camera.setHpr(self.avatarNP.getHpr()[0],0,0)\t\t\n\t\tself.fieldAngle = 46.8\t# similar to human eye;\n\t\t\t\t\t# change this to zoom in/out\n\t\tbase.camLens....
[ "0.7194849", "0.7097453", "0.70574164", "0.70280343", "0.6994152", "0.6966335", "0.6889367", "0.6878479", "0.68556595", "0.67483926", "0.674773", "0.6744065", "0.6693449", "0.66212785", "0.65537935", "0.6540604", "0.65329903", "0.65329903", "0.65329903", "0.6499754", "0.64453...
0.7616594
1
Extend result as a context manager.
def _tarfile_open_ex(*args, **kwargs): return contextlib.closing(tarfile.open(*args, **kwargs))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def with_iter(contextmanager):\n with contextmanager as iterable:\n for item in iterable:\n yield item", "def context_local(context=None):\n class manager(object):\n def __init__(self, ctx):\n \"\"\"\n :type ctx: Context\n \"\"\"\n self.c...
[ "0.6251016", "0.56514174", "0.55863106", "0.5580472", "0.5546422", "0.54589224", "0.5433394", "0.5433394", "0.5422261", "0.5418563", "0.5418563", "0.5418563", "0.5418563", "0.5418563", "0.5418563", "0.5418563", "0.5418563", "0.5418563", "0.5418563", "0.5418563", "0.5418563", ...
0.0
-1
Get the unitary vector of direction.
def dir(self): return unit_vector(normalize_angle(self.angle))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def direction(self):\n len = self.length()\n if len == 0.0:\n uvec = pos.Pos(np.transpose(np.array([0, 0, 0])))\n else:\n uvec = pos.Pos(np.transpose(np.array([(self.end.x - self.start.x) / len,\n (self.end.y - self.start.y...
[ "0.80650926", "0.7714104", "0.7688202", "0.74529743", "0.736431", "0.73323345", "0.72756165", "0.721212", "0.7031685", "0.7012481", "0.70107687", "0.6999042", "0.6971306", "0.69533485", "0.6934928", "0.6934928", "0.6934928", "0.6921606", "0.69211054", "0.69203055", "0.688539"...
0.69447875
14
Movement from the given angular speed.
def turn_by(self, dangle, dt): # Don't turn too fast self.angle += np.clip(dangle, -dt * self.turning_rate, dt * self.turning_rate) # Keep angle in range [-pi, pi) self.angle = normalize_angle(self.angle)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(self, linear_speed, angular_speed):\n twist = Twist()\n twist.linear.x = linear_speed\n twist.angular.z = angular_speed\n self.pub.publish(twist)", "def move(self):\n self.position += self.speed", "def move(self, speed=1):\n self.set_motor(self.left_motor, 'le...
[ "0.73538953", "0.695612", "0.69384027", "0.6894109", "0.6876818", "0.68159175", "0.6781335", "0.6676837", "0.66648084", "0.6656808", "0.66502255", "0.6633955", "0.66134596", "0.6606245", "0.65922445", "0.656003", "0.6532115", "0.6517737", "0.64940953", "0.64723676", "0.645253...
0.0
-1
Turn to the desired angle.
def turn_to(self, angle, dt): a = normalize_angle(angle - self.angle) self.turn_by(a, dt)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn(self, angle):\n self.logger.debug(\"turn \" + str(angle))", "def set_angle(self, angle):\n return self.bot_client.send_command(_Command.SetAngle, angle)", "def change_angle(self, up_or_down):\n self.angle += up_or_down * math.pi / 180", "def setAngle(self, angle):\n self....
[ "0.77043355", "0.7598602", "0.74979085", "0.74784386", "0.7460302", "0.7353835", "0.7312387", "0.7296793", "0.7275919", "0.7238547", "0.719179", "0.71872526", "0.7177033", "0.71599954", "0.7158461", "0.7134644", "0.70963377", "0.70953256", "0.7082544", "0.7052482", "0.7042528...
0.7777582
0
Update function. Update the position wrt. the velocity.
def tick(self, dt): self.pos += self.vel * dt
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_position(self):\n self.position[0] += self.velocity[0]\n self.position[1] += self.velocity[1]", "def update(self):\r\n # change in position -> velocity\r\n self.position += self.velocity\r\n # change in celocity -> acceleration\r\n self.velocity += self.accele...
[ "0.8155465", "0.8089625", "0.7726094", "0.7668022", "0.7663889", "0.76060313", "0.7553992", "0.7548946", "0.7523088", "0.7409136", "0.73975575", "0.7390505", "0.73824096", "0.73722446", "0.7294449", "0.7272482", "0.7212195", "0.7199869", "0.7156353", "0.71375567", "0.7113067"...
0.687131
34
Taking into account the current base, base, return a mutation.
def generate_mutation(base): if base in ['A', 'C', 'G', 'T']: bases = ['A', 'C', 'G', 'T'] bases.remove(base) return np.random.choice(bases) else: raise Exception('base is not a proper DNA nucleotide (ACGT).')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_mutation_amount(self):\n return self._get_sign() * self._get_number()", "def mutation(parent):\n rand = random.uniform(0, 1)\n if rand > PROB_MUTATION or (not parent.left and not parent.right):\n if parent.body in operators:\n parent_copy = parent.copy()\n new =...
[ "0.63845646", "0.631789", "0.62291384", "0.61089087", "0.59438735", "0.58411044", "0.5720121", "0.5624327", "0.56232435", "0.5515776", "0.5510638", "0.5506283", "0.5501744", "0.5467826", "0.54525656", "0.54444957", "0.5393325", "0.5388541", "0.5383628", "0.5358986", "0.535138...
0.62554383
2
Generate a VNTR sequence with random mutations. The mutations will be the same across different copies. Params vntr, the DNA copy sequence which is copied. m, the number of SNP mutations that will be randomly introduced. Returns A single copy of the VNTR sequence with m mutations. \
def introduce_random_mutations(vntr, m): mutation_sites = np.random.choice(range(len(vntr)), m, replace=False) m_vntr = [] for site, nucleotide in enumerate(vntr): if site in mutation_sites: m_vntr.append(generate_mutation(nucleotide)) else: m_vntr.append(nucleotide) return ''.join(m_vntr)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mutation(chrom, p_m=0.05):\n\n for i in range(len(chrom)):\n # generate number between 0 and 1, responsible for deciding\n # whether to appply mutation\n r = random.uniform(0, 1)\n\n # if r is smaller/equal the mutation probability, mutate!\n if r <= p_m:\n # g...
[ "0.5307359", "0.5192155", "0.5192155", "0.51785797", "0.5164674", "0.5141542", "0.5133362", "0.51316625", "0.5131553", "0.51003075", "0.50637877", "0.5054586", "0.50219107", "0.50108", "0.4967241", "0.4951432", "0.4938373", "0.48834544", "0.48707694", "0.4847384", "0.48199373...
0.76476663
0
Generate a VNTR sequence with the specified mutations at the specified sites. Params vntr, the DNA copy sequence which is copied. sites, locus where the SNP mutation will be introduced. mutations, a list of mutations. Returns A single copy of the VNTR sequence with mutations at the specified sites.
def introduce_specific_mutations(vntr, sites, mutations): if len(sites) != len(mutations): raise Exception('The number of sites and mutations do not correspond.') m_vntr = list(vntr) for site, nucleotide in enumerate(m_vntr): if site in sites: mut_idx = sites.index(site) if nucleotide == mutations[mut_id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def introduce_random_mutations(vntr, m):\n\t\n\tmutation_sites = np.random.choice(range(len(vntr)), m, replace=False)\n\tm_vntr = []\n\tfor site, nucleotide in enumerate(vntr):\n\t\tif site in mutation_sites:\n\t\t\tm_vntr.append(generate_mutation(nucleotide))\n\t\telse:\n\t\t\tm_vntr.append(nucleotide)\n\treturn ...
[ "0.5626054", "0.47177437", "0.42131987", "0.41583866", "0.41273472", "0.41054517", "0.40894073", "0.40883607", "0.4083983", "0.4083983", "0.4070218", "0.40296546", "0.39688498", "0.39539516", "0.3937648", "0.38799438", "0.38753176", "0.38158587", "0.38153952", "0.38036197", "...
0.65976316
0
Determines the minimum number of VNTR copies needed so a read can be completely mapped inside of a VNTR.
def critical_copy_number(rlen, clen): if rlen < clen: raise Exception('clen is larger than rlen.') elif rlen % clen > 0: return int(math.ceil(float(rlen) / clen)) else: return 1 + (rlen/clen)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minsize(self):# -> int:\r\n return 0", "def minimum_size(self):\n # TODO: Allow `Source` to understand when this returns None?\n return 3.", "def min_node_count(self) -> int:\n return pulumi.get(self, \"min_node_count\")", "def min_counts(self) -> int:\n return self._mi...
[ "0.63337505", "0.6248248", "0.6034463", "0.57980484", "0.57980484", "0.57977515", "0.57492816", "0.57466155", "0.5742616", "0.567114", "0.567114", "0.56688416", "0.5654659", "0.5622424", "0.5612963", "0.5594182", "0.5588874", "0.5578029", "0.555987", "0.5538948", "0.55332977"...
0.0
-1
Cachebacked exists method. Cache only hits for Locations we know exist.
def exists(ccp_id): exists = cache.get("location_exists_%s" % ccp_id) if exists is not None: return True else: exists_db = Location.objects.filter(pk=ccp_id).exists() if exists_db: cache.set("location_exists_%s" % ccp_id, True, timeout=3600) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exist(self):", "def testExists(self):\n ref = cache.CacheReference(self.cache, 'key')\n self.cache._KeyExists.return_value = False\n self.assertFalse(ref.Exists())", "def testExistsMissing(self):\n ref = cache.CacheReference(self.cache, 'key')\n self.cache._KeyExists.return_value = True\n ...
[ "0.6532097", "0.64277136", "0.6395002", "0.63523626", "0.63297445", "0.63152087", "0.63152087", "0.61763453", "0.6130861", "0.6088515", "0.6041803", "0.5984796", "0.59783524", "0.59638375", "0.5956604", "0.5921877", "0.5835254", "0.5794493", "0.5794173", "0.5791136", "0.57742...
0.6949977
0
Get one valid line from the serial port, ignoring any erroneous data
def get_valid_line(port): while True: try: # note in the case of serial port overflow some characters left in # it decode will then throw an exception return port.readline().decode(encoding='ASCII').strip() except: pass # ignore the e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readNonDebugLine(self):\n line = \"D\"\n linesRead = 0\n try:\n while line == None or line == \"\" or line[0] == 'D':\n linesRead += 1\n if linesRead == 100:\n return None\n\n try:\n line = self.serial.readline()\n sys.stdout.write(\".\")\n ...
[ "0.7590753", "0.6769086", "0.67336154", "0.67246145", "0.6694287", "0.6616035", "0.6583669", "0.64781165", "0.64222157", "0.6294857", "0.62915415", "0.6278962", "0.6247034", "0.62445486", "0.622831", "0.62108123", "0.6171921", "0.6171921", "0.61167514", "0.6073635", "0.607351...
0.84977233
0
Recieves a fixed number of data samples from the serial port. Converts timestamp to seconds and expresses the raw input value as a percentage of its maximum value (1023). Returns the time and percentage values as arrays t[] and percent[] respectively.
def get_data(N,port_name,port_speed): t = np.zeros(N) # array for timestamps percent = np.zeros(N) # array for percentage values # get data from serial port with serial.Serial(port=port_name,baudrate=port_speed,timeout=2) as myport: sleep(2) # allow arduino to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_datapoints(self, rid, t0, t1, nmax = 300):\n self.read_curs.execute(\"SELECT COUNT(*) FROM readings WHERE readout_id = ? AND time >= ? AND time <= ?\", (int(rid), t0, t1))\n if self.read_curs.fetchone()[0] > nmax:\n self.read_curs.execute(\"SELECT avg(time),avg(value) FROM readings...
[ "0.6064227", "0.6021816", "0.5860702", "0.58265907", "0.58107245", "0.5694001", "0.56659734", "0.559805", "0.5555691", "0.5536991", "0.5519742", "0.547903", "0.54070944", "0.53832203", "0.53828126", "0.5376914", "0.5328985", "0.53166157", "0.53156304", "0.5289635", "0.5288996...
0.75997883
0
Writes the data to a .txt file
def file_write(t,percent): file_name = "EP305data56.txt" # Open a file for writing out_file = open(file_name, 'w') # print headers print('{0:<10}'.format('Time(s)'),\ '{0:<10}'.format('Output (%)'), file = out_file) # Write the values to the file #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_txt(data, out_path, type=\"w\"):\n with open(out_path, type) as f:\n f.write(data.encode(\"utf-8\"))", "def write_data_to_file(data1, data2, data3, data4, data5):\n with data_file as open('data_file.txt','w'):\n data_file.write(data1 +'\\n')\n data_file.write(data2 +'\\n')\n ...
[ "0.7667594", "0.75028074", "0.74911404", "0.74611", "0.7410926", "0.7387055", "0.7348957", "0.734851", "0.7322061", "0.72910273", "0.7271419", "0.7256517", "0.72381645", "0.723456", "0.72312224", "0.72205055", "0.71731836", "0.7171228", "0.7167753", "0.7147209", "0.71238625",...
0.0
-1
Main function. Holds serial port settings and calls on get_data() and file_write().
def main(): N = 200 # number of samples port_name = 'COM4' # serial port name port_speed = 19200 # serial port speed/ baudrate (bits per second) t,percent = get_data(N,port_name,port_speed) # get data file_write(t,percent) # write data to file
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(self) :\n\n # Close the serial port in case the previous run didn't closed it properly\n self.serialPortDWM1001_1.close()\n self.serialPortDWM1001_2.close()\n \n # Sleep for one sec\n time.sleep(1)\n \n # Open serial port\n self.serialPortDWM1...
[ "0.66673714", "0.6348471", "0.63438296", "0.6250894", "0.62133306", "0.6160983", "0.615156", "0.61369705", "0.6128722", "0.6102775", "0.6096401", "0.6067427", "0.60530365", "0.6042071", "0.60399944", "0.60398006", "0.6038704", "0.6035512", "0.59890354", "0.59833527", "0.59560...
0.7212588
0
Set the parameters of this estimator. Returns self
def set_params(self, **params): if not params: # Simple optimization to gain speed (inspect is slow) return self else: self.kwargs.update(params) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_params(self):\n raise NotImplementedError", "def set_params(self, **params):\n super()._set_params('estimators', **params)\n return self", "def _set_parameters(self, parameters):\n self.parameters = parameters\n self._set_points_and_weights()", "def set_params(self,...
[ "0.7405658", "0.740245", "0.73740757", "0.7330757", "0.7286825", "0.71475196", "0.71159136", "0.7114654", "0.7106828", "0.7037238", "0.70266736", "0.70122766", "0.69915694", "0.6972955", "0.6956284", "0.69473", "0.68900704", "0.6825812", "0.6763804", "0.67339617", "0.6688855"...
0.67018473
20
Perform numerical differentiation by calling the ``dxdt`` method. Paramters
def __call__(self, x, t): x = validate_input(x, t=t) if isinstance(t, (int, float)): if t < 0: raise ValueError("t must be a positive constant or an array") t = arange(x.shape[0]) * t return dxdt(x, t, axis=0, **self.kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compODEdydt(self, t, y, args=None):\r\n return comp.Comp.compODEdydt_diffu(self, t, y, args)", "def test_dg_dt(self):\n dfn = lambda x: self.model.g(self.s, self.e, x, self.T)\n nderiv = differentiate(dfn, self.t)\n cderiv = self.model.dg_dt(self.s, self.e, self.t, self.T)\n self.assertTru...
[ "0.7016248", "0.69361097", "0.6804383", "0.67951113", "0.66794807", "0.65300804", "0.64966476", "0.64858246", "0.64858246", "0.64737797", "0.6373898", "0.6372892", "0.6352266", "0.63382345", "0.6321146", "0.630121", "0.6283227", "0.62816906", "0.6236406", "0.61797225", "0.617...
0.7255509
0
Creates a square of rectangles from a bounding box, Feature or FeatureCollection.
def square_grid( bbox: List[float], n_cells: Union[int, float], options: Dict = {}, ) -> FeatureCollection: return rectangle_grid(bbox, n_cells, n_cells, options)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rectangle(xcenter, ycenter, width, height):\n x1, x2 = xcenter - width, xcenter + width\n y1, y2 = ycenter - height, ycenter + height\n return Shape([Point(x1, y1), Point(x1, y2), Point(x2, y2), Point(x2, y1)])", "def rect(x: float, y: float, width: float, height: float) -> LineCollection:\n retu...
[ "0.66413796", "0.64010334", "0.63548267", "0.6310541", "0.63054466", "0.6284592", "0.6282141", "0.6275525", "0.62733954", "0.62666655", "0.62408054", "0.61883223", "0.6173386", "0.61582655", "0.6151233", "0.61442584", "0.6142375", "0.6133205", "0.6114281", "0.60825324", "0.60...
0.68952215
0
Extracts information from a datetime object
def deconstruct_datetime(self, date: datetime) -> List[int]: year, month, day, hour, _, _, _, _, _ = date.timetuple() return [year, month, day, hour]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_date_time_pacific(object_key):\n return extract_date_info(object_key)", "def datetime_object(__date):\n if isinstance(__date, datetime.datetime):\n return datetime.datetime(__date.year, __date.month, __date.day, __date.hour, __date.minute, __date.second)\n return None", "def _get_date...
[ "0.69675183", "0.6501738", "0.6404647", "0.6284662", "0.6193795", "0.6187086", "0.61561066", "0.6152871", "0.61079943", "0.60963464", "0.60944545", "0.60625637", "0.6058645", "0.5986955", "0.58931506", "0.58589345", "0.5852132", "0.5815646", "0.57739455", "0.5771062", "0.5745...
0.6440473
2
Sorts file name by their looking at their dayofyear and hour block code
def __file_sorter(self, filename: str) -> int: filename = filename.split('/')[-1] year = int(filename[-3:-1]) # extracts YY from ssssdddh.YYo day_info = filename[4:8] # extracts dddh from ssssdddh.YYo day_of_year = int(day_info[:3]) # ddd hour_block = day_info[-1] # h ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def paths_sort(path):\n base_name = os.path.basename(path)\n \n stat_name = base_name.split('.')[0] \n\n date = base_name.split('.')[1]\n \n try:\n date = datetime.datetime.strptime(date, '%Y-%m-%d')\n \n return date, stat_name\n except Exception as e:\n print(e)...
[ "0.65522987", "0.6036532", "0.5924664", "0.5856054", "0.58341306", "0.58302736", "0.5825444", "0.57813066", "0.5737469", "0.5684189", "0.56800306", "0.5619507", "0.5610713", "0.55951077", "0.5585952", "0.5574447", "0.55037266", "0.54867095", "0.5466267", "0.54434353", "0.5432...
0.7976214
0
Decompresses all downloaded Rinex files inside a specified directory.
def decompress_files(self): crx2rnx_path = os.path.join(ROOT_DIR, 'CRX2RNX') if not os.path.isfile(crx2rnx_path): raise OSError('Cannot find CRX2RNX binary in project directory!') if glob('{}/*'.format(self.__directory)): subprocess.run(["gunzip", "-dr", self.__directory...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _uncompress(fname, outdir, msg=msg):\n import os\n assert os.access(fname, os.R_OK), \"could not access [%s]\" % fname\n fname = os.path.abspath(os.path.realpath(fname))\n if not os.path.exists(outdir):\n os.makedirs(outdir)\n orig_dir = os.getcwd()\n try:\n os.chdir(outdir)\n ...
[ "0.6734366", "0.6269583", "0.6158027", "0.61422616", "0.60502845", "0.60480267", "0.60106426", "0.5998983", "0.59943736", "0.5992895", "0.594012", "0.5927805", "0.590243", "0.5832953", "0.58247906", "0.580835", "0.57950175", "0.57742256", "0.57636404", "0.5752565", "0.5750407...
0.7247172
0
Merges RINEX files and extracts required time window from merged file.
def merge(self): self.decompress_files() teqc_path = os.path.join(ROOT_DIR, 'teqc') if not os.path.isfile(teqc_path): raise OSError('Cannot find TEQC binary in project directory!') # currently cannot tell if there are daily logs or not daily_logs = glob('{}/*0.??o'.f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_delta_time(\n username: str | None = None,\n password: str | None = None,\n verbose: bool = False,\n mode: oct = 0o775\n ):\n # retrieve history delta time files\n pull_deltat_file('historic_deltat.data',\n username=username, password=password,\n verbose...
[ "0.55087197", "0.54753095", "0.5362552", "0.52895766", "0.52009743", "0.51340944", "0.5126637", "0.5122447", "0.5083839", "0.4956485", "0.49437204", "0.49434453", "0.4934271", "0.49225575", "0.4921824", "0.49144492", "0.49025676", "0.4867515", "0.48418102", "0.4840948", "0.48...
0.6410398
0
Ask for a number within a range.
def ask_number(question, low, high): response = None while response not in range(low, high): response = int(input(question)) return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _ask_user_range(question, first, last, default):\n\n while True:\n answer = input(question)\n if answer == \"\":\n answer = default\n break\n if re.findall(r\"[0-9+]\", answer):\n if int(answer) in range(first, last + 1):\n ...
[ "0.7841275", "0.7828361", "0.78230804", "0.77285206", "0.74295723", "0.7367835", "0.72900355", "0.7220681", "0.71590334", "0.7132747", "0.70865697", "0.7029022", "0.69903183", "0.686251", "0.6826732", "0.6756153", "0.6675132", "0.6604543", "0.6598367", "0.65773624", "0.657574...
0.78229994
4
This class is used to handle interaction towards coffee interface.
def __init__(self): super(Handler, self).__init__() logging.warning('Initializing coffeeHandler....') # get an active token and get prepared for sending request self.coffee_session = requests.session()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def responder():\n pass", "def interact(self):\r\n pass", "def handle(self):", "def handle(self) -> None:", "def _do_action(self):\n pass", "def _do_action(self):\n pass", "def call(self):", "def connect(self, *args, **kwargs):", "def cingRun(self): \n \n pass",...
[ "0.6325427", "0.62958306", "0.6142583", "0.59677786", "0.5949507", "0.5949507", "0.59184813", "0.58850074", "0.58409196", "0.5825992", "0.5825992", "0.5811086", "0.58100563", "0.5774686", "0.5774686", "0.57083404", "0.5695639", "0.5692586", "0.5692586", "0.56795084", "0.56737...
0.0
-1
Return an ordered list for compare.
def _order_json(self, json_string): if isinstance(json_string, dict): return sorted((k, self._order_json(v)) for k, v in json_string.items()) if isinstance(json_string, list): return sorted(self._order_json(x) for x in json_string) else: return json_string
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getList(self):\n\treturn self.sorted_list.getList()", "def as_ordered_list(self) -> List[T]:\n result = []\n while self._heap:\n result.append(heapq.heappop(self._heap).val)\n return result[::-1]", "def get_list(self):\n return sorted(self.__entries.keys())", "def g...
[ "0.70494705", "0.68187606", "0.6699472", "0.6662763", "0.6563649", "0.65575236", "0.6489065", "0.64512795", "0.64389855", "0.6433717", "0.6429823", "0.6428731", "0.6411766", "0.6406017", "0.6362744", "0.6223412", "0.61769503", "0.6150498", "0.6118322", "0.6094638", "0.6093823...
0.0
-1
Check partial rsp but not the while rsp.
def _check_partial_rsp(self, exp, ori): logging.warning('Start to check if expected_rsp: {} is part of origin_rsp: {}'.format(exp, ori)) # so far, leaf node could be string or list which must be exactly the same if isinstance(exp, dict): for k, v in exp.iteritems(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def condition_forward_checking(csp, var) :\n return False", "def condition_forward_checking(csp, var) :\n return False", "def _is_in_outmost_while_loop(self, op):\n ctxt = self._get_op_control_flow_context(op)\n outer_while_context = control_flow_util.GetContainingWhileContext(ctxt)\n return out...
[ "0.540051", "0.540051", "0.5356466", "0.52993804", "0.51802635", "0.5112568", "0.50418687", "0.49996877", "0.49401474", "0.4930193", "0.49258524", "0.492424", "0.49188444", "0.49112532", "0.4911028", "0.4888663", "0.4888482", "0.4887423", "0.48641187", "0.48544022", "0.484821...
0.59235585
0
Query intraday time series given date
def get_heart_rate(auth2_client, date, granularity='1sec'): heart_rate_raw = auth2_client.intraday_time_series('activities/heart', base_date=date, detail_level=granularity) time_list = [] val_list = [] date_list = [] for i in heart_rate_raw['activities-heart-intraday']['dataset']: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_time_series_intraday_date_indexing(self, mock_request):\n ts = TimeSeries(key=TestAlphaVantage._API_KEY_TEST,\n output_format='pandas', indexing_type='date')\n url = \"http://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=1min&outputsize=f...
[ "0.6492028", "0.62617564", "0.62370425", "0.62359935", "0.61809593", "0.59598213", "0.5957042", "0.59361583", "0.5931888", "0.5837719", "0.5832956", "0.577505", "0.57673204", "0.57561266", "0.5742295", "0.56955504", "0.5679183", "0.5633228", "0.5589691", "0.55892736", "0.5554...
0.0
-1
get the butch from the DB, send it to the cmd and run it
def action(self): batch_name = super().find_batch(self.__arguments, '') butch = self.__batch_data.get_batch(batch_name) cmd = CMDfromArray(butch) cmd.run()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cmd(self):", "def execute():", "def command():\n pass", "def execute():\n pass", "def execute(self):", "def execute(self):", "def execute(self):", "def execute(self):", "def get_command(pid):", "def do_command(self, args):\n pass", "def runCommand(self):\n\n\n co...
[ "0.6551642", "0.6432579", "0.6030385", "0.6028052", "0.59471583", "0.59471583", "0.59471583", "0.59471583", "0.59263164", "0.59236777", "0.5892151", "0.5857082", "0.5785422", "0.57575816", "0.5746633", "0.57398444", "0.57268196", "0.5716943", "0.57147485", "0.5710493", "0.571...
0.0
-1
Transform pervoxel metrics to pertarget. This will lead to meaningless true negatives
def per_target_transform(y_pred, y_true): # - `y_pred` must be in the following shape (batch_size, num_categories, ...), float32 possibility # - `y_true` must be in the following shape (batch_size, ...) or (batch_size, num_categories, ...), int64. assert y_pred.ndim - y_true.ndim in [0, 1] assert y_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _transform(self, X: Tensor) -> Tensor:\n pass # pragma: no cover", "def _transform(self, data):\r\n mean, variance = self._input_statistics.overall_feature_moments\r\n return (data - mean) / variance", "def transform(self, X):\n X *= self.scale_\n X += self.min_\n return ...
[ "0.5633586", "0.55836684", "0.5519925", "0.55098003", "0.5468423", "0.5406816", "0.54042906", "0.5397559", "0.539138", "0.5383554", "0.534039", "0.534039", "0.534039", "0.534039", "0.534039", "0.534039", "0.534039", "0.5313315", "0.530968", "0.53005517", "0.5285445", "0.526...
0.0
-1
Returns the evaluation metric function based on provided configuration The first of precision, recall... and first of auc, pr can update the inner confusion matrix, make sure to update in order
def get_evaluation_metric(config, logger, device): metrics = config['eval']['metrics'] if not isinstance(metrics, list): metrics = [metrics] curves = config['eval'].get('curves', list()) threshold = config['eval'].get('probability_threshold', 0.5) num_classes = config['model']['num_cla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_evaluation_metric(config):\n assert 'eval_metric' in config, 'Could not find evalvalutation metric configuration'\n eval_config = config['eval_metric']\n name = eval_config.pop('name')\n\n if name == 'BCEWithLogitsLoss':\n return nn.BCEWithLogitsLoss()\n elif name == 'CrossEntropyLoss...
[ "0.66313076", "0.6551158", "0.64049035", "0.6361392", "0.6347494", "0.63319176", "0.63283426", "0.6311559", "0.62876123", "0.6281167", "0.6250762", "0.62177956", "0.6117379", "0.6110526", "0.6107746", "0.61036915", "0.6102665", "0.6100325", "0.60988206", "0.6098097", "0.60924...
0.6997882
0
Checks that the NBA API returns a list All Stars that match our expected data.
def test_nba_api_match(nba_api, expected_data): nba_api.call_all_stars() api_star_names = nba_api.return_all_star_names() api_star_names.sort() expected_stars = expected_data['all_stars'] expected_stars.sort() assert (api_star_names == expected_stars)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_feature_starrers__no_stars(self):\n feature_1_id = self.feature_1.key.integer_id()\n actual = notifier.FeatureStar.get_feature_starrers(feature_1_id)\n self.assertEqual([], actual)", "def test_award_list(self):\n resp = self.client.get('/api/v1/awards/')\n self.assertEqual(res...
[ "0.60631937", "0.57672024", "0.56862336", "0.55025303", "0.5404626", "0.54018503", "0.5379259", "0.53650606", "0.5360184", "0.5352282", "0.5346155", "0.53406584", "0.533393", "0.5325785", "0.53107846", "0.5307978", "0.53071874", "0.52903676", "0.5289974", "0.5278253", "0.5252...
0.66825455
0
Test case for delete_sms_message
def test_delete_sms_message(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_sms_messages(self):\n pass", "def test_delete_message(self):\n\n with self.client as c:\n with c.session_transaction() as sess:\n sess[CURR_USER_KEY] = self.test_user_id\n\n resp = c.post(f\"/messages/{self.test_msg_id}/delete\")\n\n s...
[ "0.91773945", "0.7514752", "0.7502158", "0.7438375", "0.7380026", "0.725539", "0.7136757", "0.71223706", "0.71200097", "0.711685", "0.70407176", "0.6999508", "0.69591075", "0.6927136", "0.6854388", "0.68229896", "0.681961", "0.67976457", "0.6754506", "0.67475814", "0.67141104...
0.9463168
0
Test case for delete_sms_messages
def test_delete_sms_messages(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_sms_message(self):\n pass", "def test_delete_multiple_messages_returns_200(self):\n response = self.client.delete(\n self.url,\n headers={\"Authorization\": self.test_user_token},\n json={\"messageIds\": [self.test_message_one.id, self.test_message_t...
[ "0.9338108", "0.74968404", "0.74629694", "0.74303377", "0.73786664", "0.73388475", "0.7280652", "0.72503656", "0.7085368", "0.703786", "0.69507295", "0.6942626", "0.69220436", "0.68962616", "0.6864538", "0.6848225", "0.6777019", "0.67506343", "0.6736874", "0.67276883", "0.671...
0.9434885
0
Test case for get_sms_message
def test_get_sms_message(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_smsmessage_user():", "def _msim_message_test(\n self,\n ad_mo,\n ad_mt,\n mo_sub_id,\n mt_sub_id, msg=\"SMS\",\n max_wait_time=MAX_WAIT_TIME_SMS_RECEIVE,\n expected_result=True):\n\n if msg == \"SMS\":\n for length in self.message_length...
[ "0.79881704", "0.7352672", "0.7063218", "0.6995457", "0.69243234", "0.6893073", "0.6737283", "0.6715984", "0.6682555", "0.66740185", "0.6670877", "0.65920496", "0.65826803", "0.65732574", "0.6565553", "0.6558283", "0.6541745", "0.6531631", "0.6477239", "0.6433856", "0.6430533...
0.9297351
0
Test case for get_sms_messages_paginated
def test_get_sms_messages_paginated(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_admin_smsmessage_view_list(self):\n response = self.client.get('/admin/sms_module/smsmessage/')\n self.failUnlessEqual(response.status_code, 200)", "def messages(self, request, *args, **kwargs):\n conversation = self.get_object()\n related = ['user__profile']\n related...
[ "0.6724562", "0.65855765", "0.65105736", "0.64182", "0.6381551", "0.63679737", "0.6311335", "0.62858313", "0.62317616", "0.6117425", "0.61094904", "0.61003464", "0.60537875", "0.6015613", "0.59781903", "0.5955255", "0.5948406", "0.59329796", "0.5931566", "0.5921035", "0.58792...
0.94580793
0
Test case for get_unread_sms_count
def test_get_unread_sms_count(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unread_count(self):\n self.assertEqual(1, self.alice_inbox.unread_count)\n self.assertEqual(2, self.bob_inbox.unread_count)\n self.assertEqual(0, self.carol_inbox.unread_count)", "def test_get_unread_status_count(self):\n request = self.factory.get(\"\")\n request.user...
[ "0.7428484", "0.70662117", "0.70209134", "0.69250965", "0.6768606", "0.67276937", "0.6712709", "0.6593151", "0.6553094", "0.6544224", "0.6512887", "0.65081185", "0.64389706", "0.63705754", "0.6348602", "0.6341913", "0.62964576", "0.62113786", "0.6197132", "0.6195831", "0.6146...
0.9400318
0
Create a node and insert it before the cursor node, or append it at the end of the list when requested.
def addNode(self, appendIt=False, nodeId=None, childId=None, sublist=None, label=''): node = DoubleLinkList.Node(nodeId=nodeId, childId=childId, sublist=sublist, label=label) if not self.head: # Empty list, add as the first entity self.head = self.tail = self.cursor = node ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __insert(self, node, value):\n #if DEBUG: print('\\t__insert({})'.format(value))\n\n new = Node(value, node.next)\n node.next = new\n return new", "def addNodeBefore(self, new_value, before_node): # Class O(n)\r\n if not isinstance(new_value, Node):\r\n if new_va...
[ "0.67543", "0.6564458", "0.64920795", "0.64346874", "0.6416351", "0.64099836", "0.63914764", "0.63571", "0.6286496", "0.62763464", "0.62672216", "0.62555116", "0.62417495", "0.6241269", "0.623173", "0.6223885", "0.621857", "0.6205191", "0.6186421", "0.61769724", "0.6157975", ...
0.5913261
47
Check if this node is the first in the list.
def atHead(self): return self.cursor == self.head
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isFirst(self):\n index = self.parentNode.idevices.index(self)\n return index == 0", "def isEmpty(self):\n return self.head == None", "def isEmpty(self):\n if self.head.next == None:\n return True\n return False", "def one_head_test(self, item):\n v = [...
[ "0.71667427", "0.650526", "0.6455801", "0.64311355", "0.64266396", "0.6422181", "0.64166355", "0.63851947", "0.63851947", "0.63537127", "0.63382107", "0.6333233", "0.6329699", "0.6321072", "0.63196737", "0.6282597", "0.62537366", "0.6250489", "0.62364244", "0.61793923", "0.61...
0.63815254
9
Check if this node is the first in the list.
def atTail(self): return self.cursor == self.tail
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isFirst(self):\n index = self.parentNode.idevices.index(self)\n return index == 0", "def isEmpty(self):\n return self.head == None", "def isEmpty(self):\n if self.head.next == None:\n return True\n return False", "def one_head_test(self, item):\n v = [...
[ "0.7165272", "0.65051687", "0.64562225", "0.6430051", "0.64293927", "0.6418734", "0.6416351", "0.63850486", "0.63850486", "0.63803065", "0.63500327", "0.6341123", "0.6333642", "0.6329443", "0.631973", "0.6316378", "0.62825376", "0.6250567", "0.62500334", "0.6237916", "0.61792...
0.0
-1
Delete this node (or the current node) from the list.
def delete(self, atNode=None): # Todo: Check for childId not None, and either recursively delete or abort. if not atNode: atNode = self.cursor if atNode == self.head: self.head = atNode.nref if self.head: self.head.pref = None self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _delete(self, current_node):\n pass", "def delete(self, node):\n # TODO: Catch errors if empty or node not in list\n self.length -= 1 # Update length\n # If head and tail, both get set to None\n if self.head is self.tail:\n self.head = None\n self.tai...
[ "0.78521186", "0.7659661", "0.763149", "0.75395554", "0.7457185", "0.7446548", "0.73363906", "0.72414476", "0.71538883", "0.71299875", "0.70430034", "0.7022891", "0.70226413", "0.7020434", "0.70176643", "0.70074606", "0.69990015", "0.69574124", "0.69558024", "0.69426554", "0....
0.65351903
62
Set the cursor position to this node.
def find(self, node): saveCursor = self.cursor if self.first() and self.cursor.nodeId == node.nodeId: return self.cursor while self.next(): if self.cursor.nodeId == node.nodeId: return self.cursor self.cursor = saveCursor return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_cursor(self, cursor):\n self._cursor = cursor", "def set_cursor_position(self, x: int, y: int) -> None:\n self.screen.move(y, x)", "def change_cursor(self, cursor):\n self.setCursor(cursor)", "def set_cursor(self, cursor):\n for step in self.steps:\n step[1].se...
[ "0.7603275", "0.7578349", "0.726849", "0.7226495", "0.7216234", "0.71786314", "0.71432775", "0.6882515", "0.6787804", "0.678301", "0.674585", "0.6704296", "0.66887784", "0.6678478", "0.6638497", "0.66186863", "0.6617602", "0.65903944", "0.65476424", "0.6488181", "0.64749277",...
0.0
-1
Given a zerobased index position, find the item at that position.
def findAt(self, index): saveCursor = self.cursor i = 0 if self.first(): if index == i: return self.cursor else: while self.next(): i += 1 if index == i: return self.cursor ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(self,item):\n sig = str(item)\n try:\n return self.index[sig]\n except:\n return None", "def __getitem__(self, index):\n return self.position[index]", "def index(self, pos):\n for i, n in enumerate(self):\n if i == pos: return n\n ...
[ "0.6888329", "0.6841699", "0.68324804", "0.67426705", "0.6529609", "0.6486999", "0.6486999", "0.6436997", "0.64190733", "0.6390486", "0.63536584", "0.6327518", "0.6239445", "0.623381", "0.6231831", "0.6218228", "0.61918646", "0.61753184", "0.61679786", "0.61623234", "0.615987...
0.6706437
4
Set cursor to head and return value.
def first(self): if self.head: self.cursor = self.head return self.cursor return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_cursor(self, cursor):\n self._cursor = cursor", "def head(self, head):\n\n self._head = head", "def before_cursor_next(self, cursor):\n pass", "def set_cursor(self, cursor):\n for step in self.steps:\n step[1].set_cursor(cursor)\n return self", "def cu...
[ "0.6844051", "0.6388312", "0.6382036", "0.63685083", "0.63387054", "0.62865436", "0.61413705", "0.611203", "0.6081945", "0.60263824", "0.60263824", "0.60263824", "0.5977552", "0.59563315", "0.59563315", "0.5937925", "0.59013456", "0.5896128", "0.5873023", "0.58664757", "0.585...
0.7369045
0
Return the data at the current node.
def getChildId(self): if self.cursor: return self.cursor.childId return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_data(self):\n return self.node_data_", "def data(self):\n return self.first_node.data", "def get_data(node):\n return node['data']", "def data(self):\n return self._data", "def get_data(self):\n return self.data", "def get_data(self):\n return self.data", "def...
[ "0.82849395", "0.82577264", "0.8239028", "0.7334759", "0.7314835", "0.7314835", "0.7314835", "0.71930677", "0.71930677", "0.71875644", "0.71875644", "0.71875644", "0.71875644", "0.7185159", "0.7185159", "0.7185159", "0.7175589", "0.71604574", "0.71604574", "0.71604574", "0.71...
0.0
-1
Return the data at the current node.
def getNodeId(self): if self.cursor: return self.cursor.nodeId return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_data(self):\n return self.node_data_", "def data(self):\n return self.first_node.data", "def get_data(node):\n return node['data']", "def data(self):\n return self._data", "def get_data(self):\n return self.data", "def get_data(self):\n return self.data", "def...
[ "0.82849395", "0.82577264", "0.8239028", "0.7334759", "0.7314835", "0.7314835", "0.7314835", "0.71930677", "0.71930677", "0.71875644", "0.71875644", "0.71875644", "0.71875644", "0.7185159", "0.7185159", "0.7185159", "0.7175589", "0.71604574", "0.71604574", "0.71604574", "0.71...
0.0
-1
Return child list for the current node, if it has one.
def getSublist(self): if self.cursor: return self.cursor.sublist return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_children(self):\n return []", "def get_child_nodes(node):\r\n return list(iter_child_nodes(node))", "def get_children(self):\n return self.children", "def get_children(self):\r\n return self.children", "def _get_children(self, x):\n try:\n return x._pfp__childr...
[ "0.72904855", "0.70950705", "0.7078335", "0.7052911", "0.70326304", "0.69022644", "0.69022644", "0.69022644", "0.6871856", "0.6866595", "0.68590724", "0.6858841", "0.6770233", "0.6750935", "0.67226076", "0.6701902", "0.6674672", "0.6653933", "0.66369146", "0.65957004", "0.659...
0.0
-1
Set cursor to head and return value.
def last(self): if self.tail: self.cursor = self.tail return self.cursor return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first(self):\n if self.head:\n self.cursor = self.head\n return self.cursor\n return None", "def _set_cursor(self, cursor):\n self._cursor = cursor", "def head(self, head):\n\n self._head = head", "def before_cursor_next(self, cursor):\n pass", "...
[ "0.7369045", "0.6844051", "0.6388312", "0.6382036", "0.63685083", "0.63387054", "0.62865436", "0.61413705", "0.611203", "0.6081945", "0.60263824", "0.60263824", "0.60263824", "0.5977552", "0.59563315", "0.59563315", "0.5937925", "0.59013456", "0.5896128", "0.5873023", "0.5866...
0.58586484
21
Set cursor to next node and return value.
def next(self): if self.cursor.nref: self.cursor = self.cursor.nref return self.cursor return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __next__(self) -> object:\n if not self.current_node:\n raise StopIteration\n\n current_node_value = self.current_node.value()\n self.current_node = self.current_node.next()\n return current_node_value", "def get_next(self):\n return self.cur_node.next.data", "...
[ "0.7194746", "0.68990916", "0.6886612", "0.68468225", "0.68432724", "0.6704389", "0.6704389", "0.6704389", "0.66177464", "0.65851474", "0.6583519", "0.655754", "0.65512866", "0.6538686", "0.6535491", "0.65344507", "0.6525343", "0.65207446", "0.64936644", "0.64655405", "0.6465...
0.7529478
0
Set cursor to previous node and return value.
def previous(self): if self.cursor.pref: self.cursor = self.cursor.pref return self.cursor return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _prev(self, _):\n self.notebook.SetSelection(self.idx-1)", "def previous(self):\n if len(self.stack) == 1:\n return None\n self.stack.pop()\n return self.get_node()", "def _PrevExpression(self):\r\n self.RestoreExpression()\r\n self.expressionindex-=1\r\n ret...
[ "0.66671693", "0.6628972", "0.6619934", "0.6541928", "0.65124005", "0.64847946", "0.64836437", "0.647833", "0.6466722", "0.6382392", "0.6338151", "0.6337901", "0.63246906", "0.63216805", "0.62919265", "0.6273135", "0.6273111", "0.6258625", "0.623803", "0.6217362", "0.62012714...
0.79355323
0
Update the child pointer ID for the current node.
def setChildId(self, childId): if self.cursor: self.cursor.childId = childId
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def child_id(self, child_id):\n\n self._child_id = child_id", "def set_child_id(self, child_key: str, child_run_id: str) -> None:\n self._child_key = child_key\n self._child_run_id = child_run_id", "def setChild(self, p_int, *__args): # real signature unknown; restored from __doc__ with mu...
[ "0.689228", "0.6211195", "0.61113375", "0.60806096", "0.6055202", "0.58166665", "0.5816543", "0.5780103", "0.57617867", "0.57554656", "0.5747848", "0.56829566", "0.56609714", "0.5657746", "0.5638708", "0.54964876", "0.54699564", "0.5466096", "0.5446065", "0.54458743", "0.5434...
0.7269834
0
Update the label for the current node.
def setLabel(self, label): if self.cursor: self.cursor.label = label
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UpdateLabel(self) -> _n_6_t_0:", "def _update_label(self, outer_pos, inner_pos, new_label):\n r, c = outer_pos\n ir, ic = inner_pos\n self.inner_boards[r][c][ir][ic][\"text\"] = new_label", "def _update_label(self, change: Dict[str, Any]):\n dim = change['owner'].description\n ...
[ "0.8332666", "0.74227476", "0.7144611", "0.7114967", "0.69695455", "0.68212885", "0.68019253", "0.68019253", "0.68019253", "0.68019253", "0.68019253", "0.68019253", "0.68019253", "0.68019253", "0.68019253", "0.68019253", "0.68019253", "0.6792774", "0.6792774", "0.6792774", "0...
0.62202203
44
Update the node Id for the current node.
def setNodeId(self, recId): if self.cursor: self.cursor.nodeId = recId
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_id(self, node_id: int):\r\n self._node_id = node_id", "def update_node_id(node: Element) -> None:\n new_ids: list[str] = []\n for node_id in node['ids']:\n new_id = self.fix_fragment('', node_id)\n if new_id not in new_ids:\n ...
[ "0.7829752", "0.7489203", "0.74335957", "0.7393328", "0.6981593", "0.68572396", "0.67971003", "0.6588425", "0.6580804", "0.65778935", "0.6553216", "0.65527683", "0.6539076", "0.6539076", "0.6514303", "0.6485789", "0.6476102", "0.6347575", "0.63162756", "0.6252726", "0.6208319...
0.69661885
5
Update the sublist for the current node.
def setSublist(self, sublist): if self.cursor: self.cursor.sublist = sublist
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_subfiles(self) -> None:\n\t\t# Clear list of subfiles\n\t\tself.subfiles.clear()\n\t\t# Iterate over Nodes\n\t\tfor node in self.nodes:\n\t\t\tfor file in node.get_subfiles():\n\t\t\t\tself.subfiles.add(\"{}/{}\".format(self.xml_dir, file))\n\t\t# Iterate over SubNodes\n\t\tfor subnode in self.subnodes...
[ "0.61103445", "0.6081414", "0.60720336", "0.6036406", "0.6031752", "0.5968815", "0.59568065", "0.59119153", "0.5843359", "0.58083177", "0.5755129", "0.5719032", "0.5716412", "0.56964624", "0.56887376", "0.56816745", "0.56636894", "0.56284004", "0.5576053", "0.5550335", "0.554...
0.6661264
0
Adds a node at the current location of the current sublist, which means
def addNode(self, appendIt=False, nodeId=None, childId=None, sublist=None, label=''): currentList = self.getSublist() node = currentList.addNode(appendIt=appendIt, nodeId=nodeId, childId=childId, label=label) # Update head for this sublist if head node added ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_node(self, node):", "def add(self, item):\r\n self.root = self.recurse_add(self.root, item)", "def append(self, item):\n \n n = Node(item)\n current = self.head\n \n # Special case - empty list\n if current is None:\n self.head = n\n el...
[ "0.72314936", "0.6858633", "0.66922915", "0.6581025", "0.6559547", "0.65215975", "0.64902025", "0.64757645", "0.6471482", "0.6471172", "0.6465993", "0.646568", "0.6456608", "0.6429106", "0.64222723", "0.6419367", "0.6399883", "0.63941973", "0.63874197", "0.63766307", "0.63766...
0.64220464
15
Create a new list and a new node to store it in (as a sublist). Adds it in the list of lists before the cursor node, or appends it at the end of the list when requested. Returns the node containing the sublist and makes it the new cursor.
def addList(self, appendIt=False, nodeId=None, childId=None, label=''): sublist = DoubleLinkList() return super().addNode(appendIt=appendIt, nodeId=nodeId, childId=childId, sublist=sublist, label=label)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addChildList(self, cur):\n if cur is None: cur__o = None\n else: cur__o = cur._o\n ret = libxml2mod.xmlAddChildList(self._o, cur__o)\n if ret is None:raise treeError('xmlAddChildList() failed')\n __tmp = xmlNode(_obj=ret)\n return __tmp", "def setSublist(self, sublis...
[ "0.6262236", "0.5715792", "0.5703821", "0.5696898", "0.5605056", "0.55852944", "0.5570079", "0.5526558", "0.5485031", "0.53303295", "0.5300412", "0.52345085", "0.5225645", "0.51266986", "0.51257265", "0.5121477", "0.5119464", "0.50727797", "0.5070094", "0.5056297", "0.5055901...
0.51630515
13
Returns the current list's head node ID, which is the ID of the first node in the sublist. Stored as the child ID in the cursor sublist node.
def getHeadId(self): if self.cursor: return self.cursor.childId return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadHeadId(self):\n rec = self.db.selectById(self.tableName, 1)\n if rec:\n self.headId = rec['childId']\n return self.headId\n print('Error! No first sublist record found.')\n return None", "def getChildId(self):\n if self.cursor:\n return ...
[ "0.7650758", "0.62124133", "0.6189284", "0.5923709", "0.58960605", "0.5894876", "0.5894876", "0.5833733", "0.5759456", "0.57556945", "0.57405174", "0.5699721", "0.5668968", "0.5661681", "0.563879", "0.55798924", "0.55545825", "0.555003", "0.5548141", "0.551549", "0.5510951", ...
0.75668454
1
Create the table, if it doesn't already exist in the current database. It also reserves the very first record to store the 'head' record ID, since this is mutable (the user can shift data around), thus we need a solid starting point, pointing to the head, wherever it may be in the table at the moment.
def initTable(self): sql = """ ( nodeId integer PRIMARY KEY, nextId integer, childId integer, label text); """ self.db.createTable(self.tableName + sql) # Reserve the first record as the head pointer, if it's not there ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_table(self):\n logging.debug('Creating new table')\n if not self._dbconnect or not self._cursor:\n raise Exception('Invalid call to Context Manager method!')\n\n self._cursor.execute(\"create table {} (date text, time text, location text, nodeID text)\".format(self._name)...
[ "0.69965774", "0.69594985", "0.6885262", "0.68815774", "0.68663996", "0.67848057", "0.67747885", "0.6768667", "0.67670316", "0.6716009", "0.6699258", "0.6688352", "0.6677764", "0.6676013", "0.66524184", "0.6649117", "0.66155744", "0.66094506", "0.6579713", "0.65762913", "0.65...
0.8027389
0
Load all connected nodes beginning with the Head ID from the first record into the provided DoubleLinkList (1dimensional).
def load(self, theList: DoubleLinkList): nextId = self.loadHeadId() while nextId: rec = self.db.selectById(self.tableName, nextId) theList.addNode(appendIt=True, nodeId=rec['nodeId'], childId=rec['childId'], label=rec['label']) nextId = rec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_first(self, data):\n # define the head as the new Node\n self.head = Node(data, next=self.head)\n # if list was empty define th tail as the head\n if self.tail is None:\n self.tail = self.head\n # set the skip back pointer if needed\n if self.head.next i...
[ "0.55087054", "0.54595256", "0.54401547", "0.5433761", "0.53921384", "0.5325638", "0.5285543", "0.52591926", "0.52464294", "0.5234643", "0.52337515", "0.52164835", "0.5213779", "0.51908237", "0.5188615", "0.5157376", "0.51544315", "0.5126514", "0.512166", "0.51161116", "0.508...
0.764213
0
Load all connected nodes beginning with the Head ID from the first record into the provided ListOfLists (2dimensional), as sublists. Then load each sublist.
def loadListOfLists(self, theList: ListOfLists): nextListId = self.loadHeadId() while nextListId: rec = self.db.selectById(self.tableName, nextListId) childId = rec['childId'] theList.addList(appendIt=True, nodeId=rec['nodeId'], childId=childId, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(self, theList: DoubleLinkList):\n nextId = self.loadHeadId()\n while nextId:\n rec = self.db.selectById(self.tableName, nextId)\n theList.addNode(appendIt=True, nodeId=rec['nodeId'], childId=rec['childId'],\n label=rec['label'])\n n...
[ "0.6216345", "0.5365256", "0.5259983", "0.5259861", "0.5232257", "0.51548785", "0.5095261", "0.5067658", "0.4927808", "0.48954186", "0.4870286", "0.48575258", "0.4831813", "0.48301443", "0.48194122", "0.4812096", "0.48102123", "0.47762698", "0.47586632", "0.47257864", "0.4722...
0.7120819
0
Loads the first record of the table, which holds the record ID of the head node in the saved link list. This node ID can change whenever a new head node or sublist node is added or deleted.
def loadHeadId(self): rec = self.db.selectById(self.tableName, 1) if rec: self.headId = rec['childId'] return self.headId print('Error! No first sublist record found.') return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initTable(self):\n sql = \"\"\" ( nodeId integer PRIMARY KEY,\n nextId integer,\n childId integer,\n label text);\n \"\"\"\n self.db.createTable(self.tableName + sql)\n # Reserve the first record as the head pointer, if it...
[ "0.68827915", "0.63930523", "0.6216851", "0.6096954", "0.6087707", "0.5796925", "0.577951", "0.57302713", "0.5709124", "0.56802595", "0.567101", "0.56219554", "0.5578597", "0.55124503", "0.5504878", "0.5469639", "0.5436854", "0.5436854", "0.5382569", "0.53682774", "0.53498465...
0.7815468
0
Update node data to the database, filtering out passed siblings which are None. Inserts if there's no node ID, to acquire one from the new record ID, which also updates the previous nodes next ID. Otherwise it updates the old record.
def save(self, node): if node: nextId = node.nref.nodeId if node.nref else None record = dict(nextId=nextId, childId=node.childId, label=node.label) if not node.nodeId: node.nodeId = self.db.insert(self.tableName, record) self.save(node.pref) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, key, node, local_edges, foreign_edges, transaction_id):\n assert self.row_exists(key, transaction_id), \"Key does not exist\"\n\n last_node = self.rows[key][-1]\n node = last_node.copy(node, local_edges, foreign_edges, transaction_id)\n self._create_or_update_row(key, n...
[ "0.61769617", "0.5661638", "0.56557274", "0.5580418", "0.55544555", "0.55355906", "0.550472", "0.548036", "0.54486036", "0.54473084", "0.54024106", "0.5401183", "0.5357976", "0.53533226", "0.53431994", "0.53304696", "0.52921146", "0.5160133", "0.5153682", "0.5151113", "0.5146...
0.6035623
1
Updates the record id of the head sublist record.
def saveHeadId(self, headId): self.headId = headId record = dict(nextId=None, childId=headId, label='head pointer') self.db.update(1, self.tableName, record)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadHeadId(self):\n rec = self.db.selectById(self.tableName, 1)\n if rec:\n self.headId = rec['childId']\n return self.headId\n print('Error! No first sublist record found.')\n return None", "def _update_head(self, course_key, index_entry, branch, new_id):\n ...
[ "0.71913046", "0.5909919", "0.58707434", "0.5700044", "0.55987924", "0.54624844", "0.5406612", "0.53759485", "0.53540254", "0.52908164", "0.52557015", "0.52411836", "0.52329826", "0.52329826", "0.52329826", "0.52329826", "0.52329826", "0.52329826", "0.52329826", "0.52329826", ...
0.5978991
1
Saves this node, plus its sibling nodes that also changed due to an add or move operation. The save() method automatically ignores sibling nodes that are None.
def saveNodeAndSiblings(self, node): self.save(node) self.save(node.pref) self.save(node.nref)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_node(self, node: Node):", "def save_node(self):\n # save node in path2node\n if self.full_path in self.file.path2node:\n print \"** Error, created node with path twice:\\n%s\" % self.full_path\n traceback.print_stack()\n sys.exit(1)\n self.file.path2...
[ "0.6932422", "0.65741545", "0.6546616", "0.60618746", "0.5862957", "0.58346206", "0.58055556", "0.57477266", "0.5745581", "0.5704365", "0.5703175", "0.56833416", "0.5679084", "0.5679084", "0.5679084", "0.56673646", "0.56533295", "0.56447184", "0.5611983", "0.5579673", "0.5579...
0.7666098
0
A wrapper for DoubleLinkList.addNode(), which calls the base class, then updates the database for this node and its immediate siblings. If the new node replaced the head node, also update the head pointer record (record 1).
def addNode(self, appendIt=False, nodeId=None, childId=None, sublist=None, label=''): node = super().addNode(appendIt=appendIt, nodeId=nodeId, childId=childId, sublist=sublist, label=label) self.save(node) if self.atHead(): self.saveHeadId(node.nodeId) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_node(self, node):\n temp = self.head.post\n self.head.post = node\n node.pre = self.head\n node.post = temp\n temp.pre = node", "def _add_node(self, node):\n node.prev = self.head\n node.next = self.head.next\n\n self.head.next.prev = node\n ...
[ "0.69011426", "0.6614623", "0.6431803", "0.6389228", "0.62975025", "0.6284442", "0.6276705", "0.6234133", "0.6226523", "0.6164524", "0.61362493", "0.6088254", "0.60727185", "0.6040691", "0.60271996", "0.60010886", "0.5980084", "0.59650093", "0.59487927", "0.5943812", "0.59404...
0.0
-1
Adds a node at the current location of the current sublist, which means
def addNode(self, appendIt=False, nodeId=None, childId=None, sublist=None, label=''): node = super().addNode(appendIt=appendIt, nodeId=nodeId, childId=childId, label=label) self.save(node) if self.getSublist().atHead(): # Update childID (sublist head) i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_node(self, node):", "def add(self, item):\r\n self.root = self.recurse_add(self.root, item)", "def append(self, item):\n \n n = Node(item)\n current = self.head\n \n # Special case - empty list\n if current is None:\n self.head = n\n el...
[ "0.7229853", "0.6857644", "0.6690344", "0.657958", "0.6557733", "0.6520972", "0.6488563", "0.6474604", "0.64697033", "0.6464185", "0.64634657", "0.64558965", "0.6429173", "0.64219517", "0.642067", "0.64189494", "0.63989407", "0.6392806", "0.6386343", "0.6376201", "0.63745207"...
0.6470836
8
Create a new list and a new node to store it in (as a sublist). Adds it in the list of lists before the cursor node, or appends it at the end of the list when requested. Returns the node containing the sublist and makes it the new cursor.
def addList(self, appendIt=False, nodeId=None, childId=None, label=''): node = super().addList(appendIt=appendIt, nodeId=nodeId, childId=childId, label=label) self.save(node) if self.atHead(): self.saveHeadId(node.nodeId) return node
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addChildList(self, cur):\n if cur is None: cur__o = None\n else: cur__o = cur._o\n ret = libxml2mod.xmlAddChildList(self._o, cur__o)\n if ret is None:raise treeError('xmlAddChildList() failed')\n __tmp = xmlNode(_obj=ret)\n return __tmp", "def setSublist(self, sublis...
[ "0.626028", "0.5715408", "0.57027864", "0.5696027", "0.5604444", "0.5585412", "0.55699396", "0.5526332", "0.5483998", "0.53001475", "0.5233666", "0.522496", "0.5161661", "0.51258874", "0.51255196", "0.51216054", "0.51185554", "0.5071398", "0.50684375", "0.5055256", "0.5054682...
0.53288776
9
Fits/trains the model using the provided list of features time series and the target time series.
def fit( self, series: Union[TimeSeries, Sequence[TimeSeries]], past_covariates: Optional[Union[TimeSeries, Sequence[TimeSeries]]] = None, future_covariates: Optional[Union[TimeSeries, Sequence[TimeSeries]]] = None, val_series: Optional[Union[TimeSeries, Sequence[TimeSeries]]] = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit(self, features, targets):\n self.model_features = features\n self.model_targets= targets", "def train(self, features, labels):\n pass", "def fit(self, features, target):\n self.target = np.array(target)\n self.features = np.array(features)\n self.length = len(s...
[ "0.6810252", "0.6283404", "0.6201668", "0.6114169", "0.60568976", "0.5967529", "0.59662396", "0.59107286", "0.59107286", "0.5910347", "0.586052", "0.58569634", "0.5783119", "0.57782227", "0.5747552", "0.5738467", "0.56476545", "0.5619847", "0.561763", "0.56028664", "0.5600873...
0.5197672
99
Override of RegressionModel's method to allow for the probabilistic case
def _predict_and_sample( self, x: np.ndarray, num_samples: int, predict_likelihood_parameters: bool, **kwargs, ) -> np.ndarray: if self.likelihood in ["gaussian", "RMSEWithUncertainty"]: return self._predict_and_sample_likelihood( x, num_sa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nnRegression(data):", "def predict_proba(self):\n ...", "def predict_proba(self, X):\n return super(SGDLogistic, self).predict(X)", "def __call__(self, y, pred, sample_weight=None):", "def predict_only(self):", "def predict_proba(self, X):\n raise NotImplementedError()", "def d...
[ "0.6868882", "0.6802963", "0.6426207", "0.6328386", "0.6312024", "0.63011485", "0.6289839", "0.62867427", "0.6202168", "0.61867195", "0.61814594", "0.6135735", "0.61344266", "0.60693586", "0.6023841", "0.6023841", "0.600846", "0.6007494", "0.5995477", "0.5992707", "0.5990644"...
0.0
-1
Override of RegressionModel's method to support the gaussian/normal likelihood
def _likelihood_components_names( self, input_series: TimeSeries ) -> Optional[List[str]]: if self.likelihood == "quantile": return self._quantiles_generate_components_names(input_series) elif self.likelihood == "poisson": return self._likelihood_generate_components_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nnRegression(data):", "def likelihood(self):\n \n raise NotImplementedError()", "def __init__(self, X, Y, kern, mean_function=None, **kwargs):\n likelihood = likelihoods.Gaussian(dtype=X.dtype)\n super(GPR,self).__init__(X, Y, kern, likelihood, mean_function, **kwargs)\n self...
[ "0.6414432", "0.6385878", "0.6164701", "0.608293", "0.60581446", "0.6056556", "0.6015315", "0.5989418", "0.59731114", "0.59506255", "0.59076005", "0.5897653", "0.5894764", "0.5892858", "0.5869251", "0.5869251", "0.5833817", "0.5832904", "0.58289766", "0.58260715", "0.5819943"...
0.0
-1
Get this party started
def __main__(): parser = argparse.ArgumentParser(description='AWS/Tenable Update Script of Doom') parser.add_argument('--configuration-file', '-c', dest='configfile', default='configuration.json', help='Configuration file to use') parser.add_argument('--version', '-v', action='version', version='%(prog)s 0....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self):\n\t\treturn self._start", "def start(self):\n return self.start_", "def cal_start(self):\n return self.setup_start", "def start(self):\n return self._get('start')", "def start(self):\n return self.__start", "def start(self):\n return self._start", "de...
[ "0.6538373", "0.6509889", "0.6459087", "0.6352963", "0.6330757", "0.6315528", "0.6315528", "0.6315528", "0.6315528", "0.6315528", "0.62978864", "0.6271584", "0.6259001", "0.61846805", "0.6172863", "0.61187994", "0.6072802", "0.603072", "0.600901", "0.59887123", "0.59815687", ...
0.0
-1
performs grid search on first classifier
def grid_search(self, params): train_X, train_y, dev_X, dev_y = self.extract_train_dev_data() clf = self.classifiers[0] pred_y = clf.grid_search(params, train_X, train_y, dev_X) logger.info(classification_report(dev_y, pred_y))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_gridsearch():\n df = read_df()\n X = df['review']\n y = df['sentiment']\n X_train, X_holdout, y_train, y_holdout = train_test_split(X, y, test_size=0.3, shuffle=True, stratify=y, random_state=222 )\n tfidf = TfidfVectorizer(stop_words='english', max_df=0.8)\n\n stem_pipeline = make_pipelin...
[ "0.69974726", "0.6735402", "0.67324466", "0.6695556", "0.6673057", "0.6650854", "0.6649412", "0.65965617", "0.6524784", "0.65171087", "0.6510658", "0.6468258", "0.6468258", "0.64501977", "0.6439914", "0.64393884", "0.641694", "0.63735074", "0.63232934", "0.6322927", "0.631559...
0.8047581
0
main function currently tailored to either perform a grid search or, compare classifiers
def run_offenseval_task_a(training_data, test_data): #grid_search_svm(training_data, test_data) compare_classifiers(classifiers(), training_data, test_data, dev_stage=True) #compare_classifiers(classifiers(), training_data, test_data, dev_stage=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grid_search(self, params):\n train_X, train_y, dev_X, dev_y = self.extract_train_dev_data()\n clf = self.classifiers[0]\n pred_y = clf.grid_search(params, train_X, train_y, dev_X)\n logger.info(classification_report(dev_y, pred_y))", "def main(args):\r\n # Parse inputs\r\n p...
[ "0.7256124", "0.71399283", "0.70877135", "0.70582306", "0.6783047", "0.6753734", "0.6703767", "0.66787785", "0.66577494", "0.66564626", "0.66486806", "0.6607803", "0.66002226", "0.65965384", "0.65645474", "0.65541595", "0.6522788", "0.6516795", "0.6516333", "0.6505667", "0.64...
0.0
-1
Generate CPABE public and master secret key and store them in the given files.
def setup(pk_outfile=const.ABE_PK_FILE, msk_outfile=const.ABE_MSK_FILE, pairing_group_curve=const.PAIRING_GROUP_CURVE, debug=0): # Instantiate a bilinear pairing map with the given curve pairing_group = PairingGroup(pairing_group_curve) # CP-ABE cpabe = CPabe_BSW07(pairing_group) # Crea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_keys():\n if os.path.isfile(\"key.txt\"):\n message = \"Key already generated\"\n else:\n secret = secrets.token_urlsafe(64)\n message = \"Secret generated and saved in key.txt\"\n with open(\"key.txt\", \"w\") as fd:\n fd.write(secret)\n return json.dumps({'mes...
[ "0.6466154", "0.62899786", "0.6258687", "0.6202768", "0.619326", "0.60750604", "0.6040009", "0.60250723", "0.5998315", "0.59418607", "0.5902854", "0.5875616", "0.5860685", "0.5856271", "0.585434", "0.58342403", "0.5815232", "0.57986635", "0.57940686", "0.57940257", "0.579174"...
0.63104564
1
Encrypt data using ABE scheme with the given public key and policy
def encrypt(data=None, pairing_group=None, pk=None, policy=None, debug=0): # Check if data is set if data is None: logging.error('encrypt_seed_key_len data exception') if debug: # ONLY USE FOR DEBUG print('EXCEPTION in encrypt_seed_key_len data') raise Exception # Chec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encrypt(cls, plaintext, aad, key, iv):", "def dh_encrypt(pub, message):\n \n Group, private, public = dh_get_key()#generate new DH pair for Alice\n #private key is an integer/scalar and public key is a point on the curve \n \n #check whether public key of Bob is valid and on curve \n assert...
[ "0.6215366", "0.62131697", "0.6203424", "0.6078133", "0.60329175", "0.60142803", "0.5990758", "0.5970462", "0.5960776", "0.5888879", "0.5764996", "0.572243", "0.5712284", "0.5691664", "0.5686507", "0.5678793", "0.5670466", "0.56587017", "0.56128335", "0.5599599", "0.5592536",...
0.63199055
0
Decrypt encrypted data with CPABE using the given public and secret key.
def decrypt(enc_data=None, pk=None, sk=None, pairing_group=None, debug=0): # Check if enc_data is set if enc_data is None: logging.error('decrypt_seed_key ciphertext exception') if debug: # ONLY USE FOR DEBUG print('EXCEPTION in decrypt_seed_key ciphertext') raise Exception...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decrypt(priv_key, ciphertext):\n pk_encrypted_secret_key = ciphertext['pk_encrypted_secret_key']\n sym_encrypted_data = ciphertext['sym_encrypted_data']\n # TODO: secure delete\n secret_key = decrypt_pk(priv_key, pk_encrypted_secret_key)\n encoded_string = decrypt_symmetric(secret_key, sym_encry...
[ "0.68123144", "0.6738852", "0.6684096", "0.6684096", "0.659502", "0.659502", "0.6571847", "0.6550422", "0.6485992", "0.6466149", "0.6452466", "0.6417155", "0.6412938", "0.6410837", "0.64047724", "0.63998777", "0.6373764", "0.63694525", "0.6359532", "0.63510954", "0.634563", ...
0.606147
45
Loads the millenium falcon model
def InitEnvironment(self): # Turn antialiasing on render.setAntialias(AntialiasAttrib.MMultisample,1) # load the falcon model falcon = loader.loadModel("Content/falcon/falcon.bam") falcon.setScale(30) falcon.setPos(0, 0, 28.5) falcon.reparentTo(render)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model(self) -> Any:", "def load_model(self):\n pass", "def load_model():\r\n model = MobileNetV2(weights=\"imagenet\")\r\n print(\"Model loaded\")\r\n return model", "def load_model(self, filename):\r\n pass", "def __load_model(self):\n loaded = load(self.__file_name)\n ...
[ "0.74449444", "0.7333244", "0.6767741", "0.6670429", "0.663162", "0.6616015", "0.6561069", "0.6559613", "0.648518", "0.6479561", "0.6469626", "0.6411189", "0.6408691", "0.64034504", "0.6363623", "0.6355563", "0.63218725", "0.62882626", "0.6281014", "0.62733346", "0.6237182", ...
0.0
-1
Default lighting if video card does not support shaders
def InitLightBasic(self): aLight = AmbientLight("AmbientLight") aLight.setColor(Vec4(0.3, 0.3, 0.3, 1)) render.setLight(render.attachNewNode(aLight)) dLight1 = DirectionalLight("DirectionalLight1") dLight1.setColor(Vec4(0.65, 0.6, 0.6, 1)) dLight1NP = render.attachNewNode(dLight1) dLight1N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enableLighting(self):\r\n\t\t\r\n\t\tglEnable(GL_LIGHTING)", "def turnLightingSystemOn():\n dislin.light('ON')", "def flicker_lights(self):\n print 'Lights Set'", "def _create_example_light():\n return Light({\"warning\": False, \"off\": True})", "def gl_lighting():\n for viewer in ...
[ "0.64125586", "0.6349172", "0.62899184", "0.6236183", "0.6194129", "0.6082328", "0.605431", "0.59205383", "0.58874553", "0.5863877", "0.5863877", "0.5827693", "0.58129865", "0.58039427", "0.57839996", "0.57760036", "0.5767857", "0.575595", "0.57330686", "0.5710341", "0.570970...
0.5785542
14