query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Helper function for removing element from the beginning of a list and add it to the end.
def mutate_list_2(lst): elem = lst[0] lst.remove(elem) lst.append(elem) return lst
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_first(lst, elem):\n \"*** YOUR CODE HERE ***\"\n if len(lst) <= 0:\n return []\n if lst[0] == elem:\n return lst[1:]\n return lst[:1] + remove_first(lst[1:], elem)", "def partial_reverse(lst, start):\n for x in lst[start:]:\n lst.insert(start,x)\n lst.pop()",...
[ "0.6933325", "0.6887407", "0.6626962", "0.6485822", "0.6436971", "0.6421842", "0.6366201", "0.6250551", "0.623727", "0.61662465", "0.61343277", "0.6100332", "0.6045288", "0.60283977", "0.58940977", "0.5827561", "0.582698", "0.5819287", "0.5806169", "0.5794157", "0.5776001", ...
0.69930166
0
Takes a path to a .txt file and outputs basic statistics on the contents of the file. Then writes the top 30 tokens to file
def get_basic_stats(txt_path: str) -> dict[str, int]: with open('Data/books/' + txt_path, 'r', encoding=' utf-8') as f: s = f.read() sen = sent_tokenize(s) tok = word_tokenize(s) u_tok = set(tok) # Adapt the trigger word for chapter given the file if txt_path == 'HuckFinn.txt': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top_50():\r\n file_read = read_file()\r\n vacabulary_list = []\r\n for key in file_read:\r\n vacabulary_list.extend(file_read[key])\r\n top_50 = Counter(vacabulary_list).most_common(50)\r\n return (top_50)", "def output_question1_token():\r\n document = open('Task1.txt', 'w')\r\n ...
[ "0.64211583", "0.6132323", "0.6008258", "0.5941141", "0.5924796", "0.58971703", "0.58508605", "0.5840367", "0.5819097", "0.5807307", "0.5759693", "0.57118833", "0.5708827", "0.56841797", "0.5679453", "0.5672701", "0.5665144", "0.5652259", "0.5636546", "0.563144", "0.56000894"...
0.658299
0
Removes unicode strings like "\u002c" and "x96"
def removeUnicode(text): text = re.sub(r'(\\u[0-9A-Fa-f]+)',r'', text) text = re.sub(r'[^\x00-\x7f]',r'',text) return text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sanitize_unicode(value):\n return re.sub(\"[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\uD800-\\uDFFF\\uFFFE\\uFFFF]\", \"\", value)", "def remove_unicode(text):\n regex = r\"(\\\\u....)\"\n text = re.sub(regex, ' ', text)\n return text", "def strip_non_unicode(value):\n UNICODE_PATTERN = r'[^\\x00-\\...
[ "0.8185505", "0.8106757", "0.7863075", "0.77977157", "0.7594576", "0.7502238", "0.749284", "0.74724543", "0.7427334", "0.7399782", "0.73754185", "0.7245354", "0.7245354", "0.7241379", "0.7238428", "0.72338843", "0.7168977", "0.7167158", "0.7052344", "0.70404035", "0.6991735",...
0.8464159
0
Removes hastag in front of a word
def removeHashtagInFrontOfWord(text): text = re.sub(r'#([^\s]+)', r'\1', text) return text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_article(str_):\n return str_.replace('the ', '').title()", "def undeline_word(word, text):\n def func(match):\n g = match.group()\n if g.islower():\n return replacement.lower()\n if g.istitle():\n return replacement.title()\n if g.isupper():\n ...
[ "0.7011256", "0.6961936", "0.6814651", "0.67458504", "0.647822", "0.6462017", "0.6453604", "0.6436451", "0.6428297", "0.64222085", "0.6421752", "0.6365696", "0.6324338", "0.63208836", "0.6319029", "0.6294322", "0.628796", "0.62859076", "0.62766117", "0.6275821", "0.62630695",...
0.7482319
0
Replaces repetitions of exlamation marks
def replaceMultiExclamationMark(text): text = re.sub(r"(\!)\1+", ' multiExclamation ', text) return text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def texify(value):\n for k, v in REPLACEMENTS.items():\n value = value.replace(k, v)\n return mark_safe(value)", "def replaceMultiQuestionMark(text):\n text = re.sub(r\"(\\?)\\1+\", ' multiQuestion ', text)\n return text", "def escape_tex(value):\n newval = value\n for pattern, replace...
[ "0.64574647", "0.6394901", "0.6383484", "0.63166946", "0.63001126", "0.62358004", "0.6210252", "0.61423486", "0.61209077", "0.6111433", "0.60876817", "0.60648936", "0.6062251", "0.6032236", "0.5956714", "0.59468025", "0.59362745", "0.5928374", "0.59043044", "0.588303", "0.587...
0.69873303
0
Replaces repetitions of question marks
def replaceMultiQuestionMark(text): text = re.sub(r"(\?)\1+", ' multiQuestion ', text) return text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pre_process_question(keyword):\n for char, repl in [(\"“\", \"\"), (\"”\", \"\"), (\"?\", \"\")]:\n keyword = keyword.replace(char, repl)\n\n keyword = keyword.split(r\".\")[-1]\n keywords = keyword.split(\" \")\n keyword = \"\".join([e.strip(\"\\r\\n\") for e in keywords if e])\n return ...
[ "0.58429354", "0.58105946", "0.5780965", "0.57687527", "0.5748923", "0.5710223", "0.54585886", "0.5412362", "0.5392941", "0.53926617", "0.53748006", "0.5342521", "0.5279869", "0.52596986", "0.52515507", "0.5223915", "0.51996", "0.5197179", "0.51577353", "0.51391906", "0.51373...
0.7035537
0
Replaces repetitions of stop marks
def replaceMultiStopMark(text): text = re.sub(r"(\.)\1+", ' multiStop ', text) return text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_stops(loop_data):\n\n # Set the text that contains stops\n loop_data[u'stop'] = 0\n loop_data.ix[loop_data.text.str.contains(u'stop_'),u'stop'] = 1\n \n return loop_data", "def scratch(line):\n if line.count('~~') >= 2:\n for i in range(0, line.count('~~') - line.count('~~') % 2...
[ "0.5802344", "0.5642553", "0.54428303", "0.5390744", "0.5382802", "0.5331588", "0.52232265", "0.5201092", "0.5178621", "0.5173385", "0.5144732", "0.5121283", "0.5062224", "0.50579005", "0.501753", "0.5004911", "0.49880782", "0.4961773", "0.49445122", "0.49255988", "0.49249682...
0.71604335
0
replace emoticons from text
def replaceEmoticons(text): text = re.sub(':-\)|:\)|:D|;\)|\(-:|:-D|\^\.\^|\^\-\^|\^\_\^', 'smile_positive', text) text = re.sub(':\(|;\(|:<|:[|]|>:/', 'smile_negative', text) text = re.sub('smile_positive',' smile_positive ', text) text = re.sub('smile_negative',' smile_negative ', text) return tex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_emoticon(text):\n for emoji in emojis.keys():\n text = text.replace(emoji, \" EMOJI\" + emojis[emoji] + \" \") \n return text", "def removeEmoticons(text):\n text = re.sub(':\\)|;\\)|:-\\)|\\(-:|:-D|=D|:P|xD|X-p|\\^\\^|:-*|\\^\\.\\^|\\^\\-\\^|\\^\\_\\^|\\,-\\)|\\)-:|:\\'\\(|:\\(|:-\\(...
[ "0.7863902", "0.7500862", "0.7255967", "0.72282124", "0.71540445", "0.67796993", "0.6694611", "0.6663092", "0.66564214", "0.6620283", "0.65893644", "0.6552014", "0.65414906", "0.6517684", "0.64407843", "0.6429354", "0.6412769", "0.6291319", "0.62871593", "0.62739855", "0.6195...
0.7609571
1
Removes emoticons from text
def removeEmoticons(text): text = re.sub(':\)|;\)|:-\)|\(-:|:-D|=D|:P|xD|X-p|\^\^|:-*|\^\.\^|\^\-\^|\^\_\^|\,-\)|\)-:|:\'\(|:\(|:-\(|:\S|T\.T|\.\_\.|:<|:-\S|:-<|\*\-\*|:O|=O|=\-O|O\.o|XO|O\_O|:-\@|=/|:/|X\-\(|>\.<|>=\(|D:', '', text) return text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_up_text(text):\n text = html.unescape(text)\n return remove_emoji(text)", "def remove_emoji(text):\n return emoji.get_emoji_regexp().sub(u'', text)", "def remove_emoji(txt):\n pattern = (\"[\\U0001F600-\\U0001F64F\"\n + \"\\U0001F300-\\U0001F5FF\"\n + \"\\U0001...
[ "0.8156369", "0.7794035", "0.7760983", "0.76629144", "0.75173044", "0.74889475", "0.74878985", "0.73619986", "0.72771835", "0.69765824", "0.6858631", "0.6803484", "0.676924", "0.67645085", "0.67210406", "0.67143935", "0.66782683", "0.66509145", "0.6638227", "0.6597864", "0.65...
0.82404536
0
Returns the WS connection URL for the given ExposedThing.
def build_websocket_url(exposed_thing, ws_server, server_port): base_url = ws_server.build_base_url(hostname="localhost", thing=exposed_thing.thing) parsed_url = urlparse(base_url) test_netloc = re.sub(r':(\d+)$', ':{}'.format(server_port), parsed_url.netloc) test_url_parts = list(parsed_url) test...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_websocket_url(self):\n\n r = requests.get(constants.WS_HOST, headers=constants.HTTP_HEADERS)\n ws_info = r.json()\n ws_info[\"securePort\"] = str(ws_info[\"securePort\"])\n ws_uri = constants.WS_URI + ws_info[\"token\"]\n ws_url = f\"wss://{ws_info['ip']}:{ws_info['secu...
[ "0.73752433", "0.65062183", "0.64756405", "0.62652117", "0.6258762", "0.6236367", "0.62089074", "0.61815333", "0.61604106", "0.61372143", "0.60228825", "0.60103476", "0.6008978", "0.5968201", "0.59430104", "0.5939121", "0.5932593", "0.587574", "0.5870186", "0.58119905", "0.57...
0.6714664
1
Test that an OTU is properly joined when only a ``otu_id`` is provided.
async def test_join( in_db, pass_document, mocker, mongo, snapshot, test_otu, test_sequence, ): await mongo.otus.insert_one(test_otu) await mongo.sequences.insert_one(test_sequence) m_find_one = mocker.patch.object( mongo.otus, "find_one", make_mocked_coro(test_otu if in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_call_otu_id_prefix(self):\r\n # adapted from test_app.test_cd_hit.test_cdhit_clusters_from_seqs\r\n\r\n exp_otu_ids = ['my_otu_%d' % i for i in range(9)]\r\n exp_clusters = [['uclust_test_seqs_0'],\r\n ['uclust_test_seqs_1'],\r\n ['uclust_...
[ "0.61006117", "0.55044836", "0.5486488", "0.5445196", "0.5390606", "0.5327949", "0.53148866", "0.5261913", "0.5228423", "0.5224687", "0.52187693", "0.52044135", "0.5193821", "0.5174221", "0.5158242", "0.51115435", "0.51046693", "0.5104464", "0.5080316", "0.5075121", "0.502684...
0.5956914
1
Test that issues with `segment` or `target` fields in sequence editing requests are detected.
async def test_check_segment_or_target( data_type, defined, missing, used, sequence_id, mongo ): await asyncio.gather( mongo.otus.insert_one({"_id": "foo", "schema": [{"name": "RNA1"}]}), mongo.references.insert_one( {"_id": "bar", "data_type": data_type, "targets": [{"name": "CPN60"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_updating_a_segment(self):\n pass", "def test_updating_segment_criteria(self):\n pass", "def test_getting_segment_details(self):\n pass", "def test_deleting_a_segment(self):\n pass", "def test_creating_a_new_segment(self):\n pass", "def test_validate_begin_equal...
[ "0.6262996", "0.59501374", "0.57434654", "0.56216013", "0.55915666", "0.5554119", "0.5543361", "0.54668707", "0.54164654", "0.53939116", "0.53219086", "0.5320059", "0.5316561", "0.5314924", "0.53051645", "0.5303947", "0.52911204", "0.52841514", "0.5275179", "0.52724284", "0.5...
0.6242463
1
The setter for a variable, which checks whether the value is in the domain.
def set_value(self, value): if value not in self.domain and value is not None: raise ValueError self.value = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Sets(self, variable):\n return variable and variable.upper().strip() in self.variables", "def set_value ( var , value , ok = lambda a , b : True ) :\n\n ## must be roofit variable! \n assert isinstance ( var , ROOT.RooAbsReal ) , 'Invalid type of ``var'' %s' % type ( var )\n \n ...
[ "0.6667536", "0.6224191", "0.61388046", "0.6094955", "0.60356253", "0.59495616", "0.5875405", "0.57912314", "0.5787644", "0.5784698", "0.57800746", "0.5759687", "0.57231396", "0.57031566", "0.5686037", "0.5664037", "0.5644304", "0.55978316", "0.55446786", "0.5528919", "0.5509...
0.66898584
0
Test whether the values of the two variables are consistent with this constraint. I.e. they are either unequal or one of them is None.
def consistent(self): if self.var1.get_value() is None or self.var2.get_value() is None: return True return self.var1.value != self.var2.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def satisfied(self):\n\n if self.var1.get_value() is None or self.var2.get_value() is None:\n return False\n\n return self.var1.get_value() != self.var2.get_value()", "def different_values_constraint(A, a, B, b):\r\n return a != b", "def are_equal(value1, value2):\n if value1...
[ "0.79900765", "0.7226912", "0.6819081", "0.6585653", "0.64775044", "0.641294", "0.6338727", "0.633012", "0.6307775", "0.62648845", "0.622943", "0.6138118", "0.6135344", "0.6127171", "0.60890937", "0.6065181", "0.6054044", "0.6050852", "0.6049933", "0.6046131", "0.6044484", ...
0.8410988
0
Test whether the values of the two variables satisfy this constraint. I.e. they are unequal and none of them is None.
def satisfied(self): if self.var1.get_value() is None or self.var2.get_value() is None: return False return self.var1.get_value() != self.var2.get_value()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def consistent(self):\n if self.var1.get_value() is None or self.var2.get_value() is None:\n return True\n\n return self.var1.value != self.var2.value", "def different_values_constraint(A, a, B, b):\r\n return a != b", "def are_equal(value1, value2):\n if value1 == None or va...
[ "0.7522352", "0.6936751", "0.64573216", "0.63982296", "0.6393524", "0.6193469", "0.61556596", "0.6091048", "0.60448384", "0.60233563", "0.6018725", "0.6015719", "0.60001034", "0.5994941", "0.5994036", "0.5992229", "0.59880143", "0.59744596", "0.59511423", "0.59370166", "0.592...
0.7880472
0
The constructor of a CSP. It automatically generates the peers member for each variable, i.e. the list of other variables that have a common constraint with a variable.
def __init__(self, variables, constraints): self.variables = variables self.constraints = constraints for c in constraints: c.var1.peers.append(c.var2) c.var2.peers.append(c.var1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, variables, domains, neighbors, constraints, C):\r\n super().__init__(())\r\n variables = variables or list(domains.keys())\r\n self.variables = variables\r\n self.domains = domains\r\n self.neighbors = neighbors\r\n self.constraints = constraints\r\n ...
[ "0.670011", "0.63723314", "0.57538784", "0.573081", "0.566242", "0.5611176", "0.5606765", "0.55449706", "0.5539884", "0.5508106", "0.54934746", "0.5487646", "0.5466293", "0.54425263", "0.544243", "0.5438726", "0.54207134", "0.5417267", "0.541665", "0.5393733", "0.5393733", ...
0.7936331
0
Test whether all constraints in this CSP are satisfied.
def complete(self): return all((constraint.satisfied() for constraint in self.constraints))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allConstraintsSatisfied(self):\n # loop through all of the constraints\n for constraint in self.constraints:\n # if any of the constraints are not satisfied, then return False\n if (not constraint.satisfied(constraint.tail.value, constraint.head.value)):\n ret...
[ "0.8425124", "0.78202105", "0.76350987", "0.76118994", "0.7609353", "0.7591021", "0.7423768", "0.73390603", "0.7213784", "0.7033176", "0.70193297", "0.69185644", "0.6864476", "0.6862492", "0.6781713", "0.6750116", "0.6719286", "0.6616929", "0.6599198", "0.6583173", "0.6535872...
0.8159369
1
Returns a list of all constraints that concern a variable.
def get_constraints_for_variable(self, var): return (constraint for constraint in self.constraints if var.name in [constraint.var1.name, constraint.var2.name])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_constraints_with(self, var):\n return [c for c in self.constraints if var.name in c.var_names]", "def get_constraint_list(self):\n constraints = []\n for i in xrange(self.num_repeats):\n # Using start_index, start each domain at the correct index when flattening out points...
[ "0.87678427", "0.7016446", "0.68499446", "0.67859584", "0.67414725", "0.6597264", "0.65933126", "0.6545793", "0.6545793", "0.65417385", "0.65273005", "0.6469376", "0.6450721", "0.64348024", "0.64323497", "0.63793", "0.6333015", "0.62992847", "0.6244081", "0.62378985", "0.6111...
0.8201241
1
Return homogeneous rotation matrix from quaternion. >>> M = quaternion_matrix([0.99810947, 0.06146124, 0, 0]) >>> numpy.allclose(M, rotation_matrix(0.123, [1, 0, 0])) True >>> M = quaternion_matrix([1, 0, 0, 0]) >>> numpy.allclose(M, numpy.identity(4)) True >>> M = quaternion_matrix([0, 1, 0, 0]) >>> numpy.allclose(M, ...
def quaternion_matrix(quaternion): q = np.array(quaternion, dtype=np.float64, copy=True) n = np.dot(q, q) if n < _EPS: return np.identity(4) q *= math.sqrt(2.0 / n) q = np.outer(q, q) return np.array([ [1.0-q[2, 2]-q[3, 3], q[1, 2]-q[3, 0], q[1, 3]+q[2, 0], 0.0], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quaternion_matrix(quaternion):\r\n q = numpy.array(quaternion, dtype=numpy.float64, copy=True)\r\n n = numpy.dot(q, q)\r\n if n < _EPS:\r\n return numpy.identity(4)\r\n q *= math.sqrt(2.0 / n)\r\n q = numpy.outer(q, q)\r\n return numpy.array([\r\n [1.0-q[2, 2]-q[3, 3], q[1, ...
[ "0.8176703", "0.77508014", "0.77371943", "0.76750696", "0.7629185", "0.7474152", "0.7352647", "0.7350256", "0.73472387", "0.7302246", "0.7297654", "0.72916245", "0.72045976", "0.71670586", "0.7166169", "0.7158307", "0.71241397", "0.69924235", "0.69899726", "0.6885203", "0.681...
0.81266844
1
Return length, i.e. Euclidean norm, of ndarray along axis. >>> v = numpy.random.random(3) >>> n = vector_norm(v) >>> numpy.allclose(n, numpy.linalg.norm(v)) True >>> v = numpy.random.rand(6, 5, 3) >>> n = vector_norm(v, axis=1) >>> numpy.allclose(n, numpy.sqrt(numpy.sum(vv, axis=2))) True >>> n = vector_norm(v, axis=1)...
def vector_norm(data, axis=None, out=None): data = np.array(data, dtype=np.float64, copy=True) if out is None: if data.ndim == 1: return math.sqrt(np.dot(data, data)) data *= data out = np.atleast_1d(np.sum(data, axis=axis)) np.sqrt(out, out) return out el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vector_norm(data, axis=None, out=None):\r\n data = numpy.array(data, dtype=numpy.float64, copy=True)\r\n if out is None:\r\n if data.ndim == 1:\r\n return math.sqrt(numpy.dot(data, data))\r\n data *= data\r\n out = numpy.atleast_1d(numpy.sum(data, axis=axis))\r\n nu...
[ "0.79793745", "0.7288616", "0.7269871", "0.71663034", "0.71113575", "0.7094755", "0.6995967", "0.6913142", "0.6863742", "0.68612564", "0.68588036", "0.682363", "0.67256266", "0.6710361", "0.66799146", "0.6657548", "0.66141975", "0.6602791", "0.65936124", "0.6591469", "0.65738...
0.7952215
1
Return affine transform matrix to register two point sets. v0 and v1 are shape (ndims, \) arrays of at least ndims nonhomogeneous coordinates, where ndims is the dimensionality of the coordinate space. If shear is False, a similarity transformation matrix is returned. If also scale is False, a rigid/Euclidean transform...
def affine_matrix_from_points(v0, v1, shear=True, scale=True, usesvd=True): v0 = np.array(v0, dtype=np.float64, copy=True) v1 = np.array(v1, dtype=np.float64, copy=True) ndims = v0.shape[0] if ndims < 2 or v0.shape[1] < ndims or v0.shape != v1.shape: print(ndims < 2) print(v0.shape[1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transformation_from_points(points1, points2):\n points1 = points1.astype(np.float64)\n points2 = points2.astype(np.float64)\n\n c1 = np.mean(points1, axis=0)\n c2 = np.mean(points2, axis=0)\n points1 -= c1\n points2 -= c2\n\n s1 = np.std(points1)\n s2 = np.std(points2)\n points1 /= s...
[ "0.58748734", "0.57680136", "0.57508314", "0.57427466", "0.57427466", "0.5576698", "0.54703057", "0.5382156", "0.53789926", "0.53118587", "0.5311098", "0.5294673", "0.525816", "0.52496916", "0.52406126", "0.52177244", "0.52116126", "0.519907", "0.51961964", "0.515494", "0.509...
0.8078746
0
List dataset contents, supports slicing.
def get_contents(self, limit: int, offset: int = 0) -> "RowSliceView": contents = petl.fromcsv(self.download_path) return petl.rowslice(contents, offset, offset + limit)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataset_list(self):\n\n response = self.send(root_url=self.session.dm_url + self.root_url,\n verb=GenericClient.VERB.GET,\n template=TEMPLATES['get_data_set_list'])\n\n results = []\n\n try:\n # Keep only the necessary fiel...
[ "0.64922196", "0.62891", "0.62651014", "0.62102336", "0.60749507", "0.60664505", "0.6049217", "0.6027724", "0.5911992", "0.5838323", "0.5827897", "0.58228266", "0.5786427", "0.5773816", "0.5744283", "0.5722698", "0.5710511", "0.5686753", "0.56671256", "0.5647635", "0.5631146"...
0.6435298
1
Calculate the BoltzmannGibbs state and save it in self.wignerfunction
def get_gibbs_state(self): # Set the initial state and propagate self.set_wignerfunction(lambda _, x, p: 0*x + 0*p + 1.) return self.propagate(self.num_beta_steps)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getBoltzmann(self):\n\n all_state = [0 for i in range(2 ** self.Nm)]\n for cc in range(2 ** self.Nm):\n b = [int(x) for x in bin(cc)[2:]]\n state = [0] * (self.Nm - len(b))\n state.extend(b)\n state = np.array(state) # convert to nd.array\n ...
[ "0.6824447", "0.64659977", "0.6454038", "0.6309461", "0.6123969", "0.6101333", "0.59595394", "0.59501404", "0.5912595", "0.58355844", "0.5818544", "0.5816663", "0.5777434", "0.57748353", "0.5765949", "0.5757659", "0.5756331", "0.5751454", "0.57334566", "0.57211417", "0.570453...
0.7735893
0
Load files from a folder and sort them according to a regex pattern
def load_files_from_folder(folder, pattern, sort=False, return_keys=False): if return_keys: assert sort, 'sort must be True when return_keys is True' files = os.listdir(folder) regex = re.compile(pattern) output = [] for f in files: match = regex.match(f) if match: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sortLoadFiles(self):\n self.loadFiles.sort()\n self.loadFiles.sort(lambda a,b: cmp(a[-3:].lower(), b[-3:].lower()))", "def load_file_list(path=None, regx='\\.npz'):\n if path == False:\n path = os.getcwd()\n file_list = os.listdir(path)\n return_list = []\n for idx, f in enum...
[ "0.7098715", "0.6966612", "0.6936388", "0.69111305", "0.6740416", "0.67271906", "0.66741616", "0.6626787", "0.659203", "0.6549667", "0.64925706", "0.6418365", "0.63608366", "0.629945", "0.6189374", "0.6182116", "0.61593395", "0.6158686", "0.61550564", "0.6154448", "0.61493087...
0.73261774
0
Request the measures to the UPS.
def request_measures(self): question = jbus.jbus_generator_read(self.node, 0x1060, 48) answer = self.send_request(question) #print("Question: [", question, "]") #print("Answer: [",answer,"] LEN: ",len(answer)) result = self.verify_response(question, answer) if (result == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMeasures():", "async def update_measures(self):\n\n def function():\n return self._api.get_measures()\n\n self._measures = await self.call(function, throttle_domain=\"update_measures\")\n\n return self._measures", "def _request_and_measure(self, count):\n for i in ...
[ "0.6346948", "0.6236698", "0.61295396", "0.59947526", "0.5964978", "0.5816508", "0.5737961", "0.5727169", "0.569128", "0.56384706", "0.56140137", "0.54955417", "0.54955417", "0.54217845", "0.54135853", "0.5385033", "0.53747624", "0.530674", "0.5298216", "0.52920574", "0.52776...
0.7064821
0
Ask the identifies to the UPS.
def request_identifier(self): question = jbus.jbus_generator_read(self.node, 0x1000, 12) answer = self.send_request(question) #print("Question: [", question, "]") print("Answer: [",answer,"] LEN: ",len(answer)) result = self.verify_response(question, answer) if (result ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def askSymplecticForUsersID(researcher_list):\r\n #description\r\n #Retrieved SymplecticIDs\r\n IDs = []\r\n #For each researcher, ask symplectic for their Symplectic-id\r\n for researcher in researcher_list:\r\n SymplecticID = SymplecticXMLRetrieveUser.__getUsersFromSymplecti...
[ "0.53339905", "0.52971935", "0.5258085", "0.5002747", "0.4999943", "0.49853602", "0.49713975", "0.49290058", "0.49188533", "0.49156177", "0.4863291", "0.4836699", "0.48360336", "0.48225376", "0.481027", "0.47940627", "0.47468022", "0.47427136", "0.4738878", "0.47377875", "0.4...
0.5885693
0
standard format to print players current HP
def showHP(self): return "{} HP: {}/{} AP:{}/100".format(self.name, self.chp, self.hp, self.ap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printPlayerStats(self):\n\t\tplayerStats = ['Name = ' + self.name, \n\t\t\t\t\t 'Agility = ' + str(self.agility), \n\t\t\t\t\t 'Personality = ' + str(self.personality), \n\t\t\t\t\t 'Sanity = ' + str(self.sanity), \n\t\t\t\t\t 'Strength = ' + str(self.strength), \n\t\t\t\t\t 'Progress = ' + str(self....
[ "0.72607183", "0.69834626", "0.68974566", "0.68226224", "0.6820858", "0.66949296", "0.66844046", "0.66482633", "0.66343457", "0.64951915", "0.64900917", "0.648172", "0.6469482", "0.6466076", "0.6457252", "0.6398156", "0.639038", "0.6363216", "0.6318347", "0.62985736", "0.6286...
0.8166822
0
Diminui o raio usando exponential decay baseado em uma constante time constant
def decay_radius(initial_radius, i, time_constant): return initial_radius * np.exp(-i / time_constant)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _decay_rate_pow(i: int, exponent: float = 0.8) -> float:\n t = jnp.array(i, jnp.float32) + 1.0\n return 1.0 - t**(-exponent)", "def next(self, dt):\n self.x = self.x + \\\n (self.rate-0.5*self.vola*self.vola)*dt + \\\n sqrt(dt)*self.vola*np.random.normal()\n ...
[ "0.6519673", "0.64766455", "0.642657", "0.6409568", "0.639775", "0.63146204", "0.62521064", "0.6083591", "0.60623896", "0.60358816", "0.5973566", "0.5938102", "0.5918009", "0.5907727", "0.5898956", "0.58846945", "0.5859161", "0.58521694", "0.58499795", "0.58231384", "0.58189"...
0.6482985
1
add max_or_zero(assignmentpoll_id) to every motion poll. The same for votes and options.
def modify_motion_poll_ids(self): # poll self.motion_poll_id_offset = max_or_zero( [x["id"] for x in self.get_collection("assignments/assignment-poll")] ) self.motion_option_id_offset = max_or_zero( [x["id"] for x in self.get_collection("assignments/assignment-opt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _calc_autoid(self):\n maxid = 0\n for i in self.items:\n maxid = max(maxid, i['id'])\n self._autoid = maxid + 1", "def add_max_resources(idle_res, hwinfo):\n hwinfo_idle = hwinfo.filter_idle()\n idle_partitions = [r.partition() for r in idle_res]\n max_resources = res...
[ "0.5194741", "0.49641976", "0.4909561", "0.47711077", "0.4758058", "0.4753284", "0.4725115", "0.4700767", "0.4651978", "0.45523795", "0.45430803", "0.44628465", "0.445782", "0.44416028", "0.44257998", "0.43848947", "0.4384195", "0.43779415", "0.43779415", "0.43417272", "0.434...
0.71346253
0
Returns the tuple (filename, filesize, blob) with blob being base64 encoded in a string. If there is an error or no mediafile, None is returned.
def get_mediafile_blob_data(self, old): if old["is_directory"]: return None try: db_mediafile = Mediafile.objects.get(pk=old["id"]) except Mediafile.DoesNotExist: return None filename = db_mediafile.original_filename if use_mediafile_database...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_get_media_image(self) -> tuple[bytes | None, str | None]:\n if self._client.current_track:\n image = bytes(self._client.current_track[\"art\"])\n return (image, \"image/png\")\n\n return None, None", "def get_mimetype(\n media_filepath: Path, buffer_size: Op...
[ "0.5828045", "0.5661106", "0.5574536", "0.55106246", "0.55091655", "0.5355817", "0.52982605", "0.5267376", "0.5251278", "0.52396077", "0.52211756", "0.52066743", "0.51902354", "0.5145332", "0.514312", "0.5138677", "0.5120337", "0.509675", "0.5067475", "0.5044907", "0.50110465...
0.70377284
0
Create CWB .info file.
def info(out: Export = Export("cwb.encoded/data/.info"), sentences: AnnotationCommonData = AnnotationCommonData("misc.<sentence>_count"), firstdate: AnnotationCommonData = AnnotationCommonData("cwb.datefirst"), lastdate: AnnotationCommonData = AnnotationCommonData("cwb.datelast"), re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def crw_model_info(filename, metadata_url, output):\n r2dt.write_crw(filename, metadata_url, output)", "def infogen(options, outfile):\n t = time.time()\n tt = time.gmtime(t)\n params = \\\n { \"bzrcmd\": options.bzr_name,\n \"datestamp\": time.strftime(\"%Y-%m-%d\",tt),\n ...
[ "0.6514385", "0.63610846", "0.62646765", "0.6226", "0.5969098", "0.5816531", "0.5700798", "0.5653925", "0.5643089", "0.5623151", "0.5587014", "0.5487361", "0.5466829", "0.5465994", "0.54210806", "0.54181486", "0.5395809", "0.5355255", "0.5340579", "0.53357124", "0.5324658", ...
0.6780244
0
Create CWB .info file for scrambled corpus.
def info_scrambled(out: Export = Export("cwb.encoded_scrambled/data/.info"), sentences: AnnotationCommonData = AnnotationCommonData("misc.<sentence>_count"), firstdate: AnnotationCommonData = AnnotationCommonData("cwb.datefirst"), lastdate: AnnotationCommonData =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info(out: Export = Export(\"cwb.encoded/data/.info\"),\n sentences: AnnotationCommonData = AnnotationCommonData(\"misc.<sentence>_count\"),\n firstdate: AnnotationCommonData = AnnotationCommonData(\"cwb.datefirst\"),\n lastdate: AnnotationCommonData = AnnotationCommonData(\"cwb.datelast...
[ "0.6483726", "0.5982675", "0.59724057", "0.5962416", "0.5794493", "0.5575736", "0.5362013", "0.5349733", "0.5319617", "0.5208498", "0.5200102", "0.5196038", "0.5193508", "0.5186082", "0.5168729", "0.51662767", "0.51634127", "0.5153024", "0.5118796", "0.51135904", "0.50926566"...
0.7193923
0
Create datefirst and datelast file (needed for .info file).
def info_date(source_files: AllSourceFilenames = AllSourceFilenames(), out_datefirst: OutputCommonData = OutputCommonData("cwb.datefirst"), out_datelast: OutputCommonData = OutputCommonData("cwb.datelast"), datefrom: AnnotationAllSourceFiles = AnnotationAllSourceFiles("[datefor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info_date_unknown(out_datefirst: OutputCommonData = OutputCommonData(\"cwb.datefirst\"),\n out_datelast: OutputCommonData = OutputCommonData(\"cwb.datelast\")):\n logger.info(\"No date information found in corpus\")\n\n # Write datefirst and datelast files\n out_datefirst.write(\"...
[ "0.6265089", "0.6126379", "0.6052833", "0.6003912", "0.59857875", "0.59309566", "0.58235383", "0.56916124", "0.56884956", "0.5685658", "0.5637418", "0.559802", "0.5593527", "0.55867267", "0.5583598", "0.5549217", "0.5534226", "0.55039984", "0.54964906", "0.54964906", "0.54879...
0.6633399
0
Create empty datefirst and datelast file (needed for .info file) if corpus has no date information.
def info_date_unknown(out_datefirst: OutputCommonData = OutputCommonData("cwb.datefirst"), out_datelast: OutputCommonData = OutputCommonData("cwb.datelast")): logger.info("No date information found in corpus") # Write datefirst and datelast files out_datefirst.write("") out_datela...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info_date(source_files: AllSourceFilenames = AllSourceFilenames(),\n out_datefirst: OutputCommonData = OutputCommonData(\"cwb.datefirst\"),\n out_datelast: OutputCommonData = OutputCommonData(\"cwb.datelast\"),\n datefrom: AnnotationAllSourceFiles = AnnotationAllSourceFil...
[ "0.6223804", "0.5669801", "0.5600193", "0.55933744", "0.5537566", "0.5440995", "0.5319922", "0.5307989", "0.52732396", "0.52351236", "0.51941484", "0.5093874", "0.50749147", "0.5062029", "0.50392145", "0.50304234", "0.5027908", "0.5026815", "0.49904943", "0.49566376", "0.4951...
0.76349753
0
Render the partner statement report and return the result as PDF.
def _get_partner_statement_report(self): if self._context.get("lang") == "tr_TR": report_name = "altinkaya_reports.partner_statement_altinkaya" else: report_name = "altinkaya_reports.partner_statement_altinkaya_en" statement_report = self.env.ref(report_name) retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_report_pdf(self):\n self.ensure_one()\n return self.env.ref('eliterp_sale_reports.action_report_product_catalogue').report_action(self)", "def print_report_pdf(self):\n self.ensure_one()\n return self.env.ref('eliterp_sale_reports.action_report_product_sold').report_action(s...
[ "0.6656804", "0.6323958", "0.6072855", "0.6000655", "0.5960693", "0.591781", "0.5910793", "0.57916397", "0.5770098", "0.57573485", "0.57560515", "0.5724676", "0.5694052", "0.56516063", "0.5644789", "0.56432587", "0.56428075", "0.563257", "0.55783653", "0.5567895", "0.55497617...
0.74629676
0
Set the state of the communication to "done"
def action_set_done(self): self.ensure_one() self.write({"state": "done"}) self.credit_control_line_ids.write({"state": "done"}) return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mark_as_done(self):\n self.status = \"DONE\"", "def done(self):\n self._ready.clear()\n self._done.set()", "def done_sending(self):\r\n self._flush(True)", "def _done(self):\n self._doneFlag = True\n self._executionCompletedNotifier.notify(self)", "def task_don...
[ "0.7793674", "0.6908893", "0.68882924", "0.6873213", "0.684455", "0.6840906", "0.67947996", "0.6727009", "0.6727009", "0.6713372", "0.6709218", "0.66742754", "0.66594326", "0.66422737", "0.6630585", "0.6605222", "0.65980095", "0.6578735", "0.6488626", "0.64798695", "0.6479869...
0.7148242
1
Execute SELECT query to subset the SQL data by path.
def get_data_in_region(table_name, cur, path, fetch=False): if len(path)==1: cur.execute("SELECT * FROM " + table_name + " WHERE " + path[0] + ";") else: cur.execute("SELECT * FROM " + table_name + " WHERE " + " AND ".join(path) + ";") if fetch is True: return cur.fetchall() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_user_paths(query=SELECT_QUERY):\n\n if query[:6] != 'SELECT':\n print(\"The query specified is not a SELECT query. Aborting!\")\n return\n\n cnx = create_connection()\n cursor = cnx.cursor()\n\n try:\n cursor.execute(query)\n except mysql.connector.errors.ProgrammingError as e:\...
[ "0.6297044", "0.5754483", "0.5736843", "0.5647014", "0.5637227", "0.5621168", "0.56098115", "0.5578753", "0.55591685", "0.54990685", "0.54791284", "0.54400206", "0.5438868", "0.5435375", "0.5428591", "0.5415127", "0.5393202", "0.5389726", "0.5348336", "0.53436977", "0.5319615...
0.67050165
0
Return potential splits to be used to find the optimal splits for pruning
def potential_splits(self, potential_xj): self.cur.execute("SELECT DISTINCT " + potential_xj + " FROM " + self.table_name + ";") potential_splits = [ii[0] for ii in self.cur.fetchall()] return potential_splits
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def best_split(self):\r\n best_splits = [[0, None, None]]\r\n impurity, best_S, best_xj = 0, None, None\r\n \r\n for xj in self.x_names:\r\n for S in self.potential_splits(xj):\r\n ir = float(self.impurity_reduction(xj, S))\r\n if ir > impurity:\...
[ "0.7316882", "0.6679733", "0.6640548", "0.66303855", "0.65783376", "0.6469337", "0.6359308", "0.632557", "0.62821424", "0.6267645", "0.6172958", "0.61528397", "0.61392885", "0.6067014", "0.60117084", "0.5976529", "0.59584475", "0.5940701", "0.5874045", "0.58702505", "0.585697...
0.67146856
1
Return best split by iterating through all potential splits and X columns Chooses largest change in impurity (ir) if it exists.
def best_split(self): best_splits = [[0, None, None]] impurity, best_S, best_xj = 0, None, None for xj in self.x_names: for S in self.potential_splits(xj): ir = float(self.impurity_reduction(xj, S)) if ir > impurity: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def determine_best_split(data, potential_splits, mltask):\n\n first_iteration = True\n for column_index in potential_splits:\n for value in potential_splits[column_index]:\n data_below,data_above = split_data(data, column_index, value)\n \n if mltask == 'regression':\n...
[ "0.73441404", "0.710136", "0.7075567", "0.6680574", "0.6575944", "0.65698457", "0.6396913", "0.6369772", "0.626233", "0.6241115", "0.6184565", "0.614212", "0.613512", "0.6121652", "0.608699", "0.60559237", "0.6015842", "0.59774745", "0.59569323", "0.58703876", "0.5793841", ...
0.8033652
0
Calculate parent and children misclassification cost and then determine their difference
def diff_misclass_cost(self): if len(self.path) == 0: # Determine correct y self.cur.execute("SELECT ROUND(AVG(" + self.y_name + ")) FROM " + self.table_name + ";") correct_y = int(self.cur.fetchone()[0]) # Determine length of y self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_dlt(_parent, _children):\n dlt_cost = 0\n for child in _children:\n # Determine the span length between the child and parent node\n left = min(_parent.i, child.i)\n right = max(_parent.i, child.i)\n for j in range(left + 1, right):\n ...
[ "0.6619944", "0.65869224", "0.6493281", "0.61725295", "0.6132164", "0.61226493", "0.60817736", "0.5978537", "0.59234685", "0.5892549", "0.5762512", "0.57531583", "0.57285196", "0.57202137", "0.5692465", "0.5661247", "0.56428534", "0.56417465", "0.56130445", "0.56052274", "0.5...
0.7679475
0
Gets the migrant with a specified id
def get_migrant(self, migrant_id:str): migrant = self.matcher.get_mentor(migrant_id) if migrant is not None: return migrant.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_migration(self, _id: int) -> Optional[Migration]:\n for migration in self.migrations:\n if migration.id == _id:\n return migration\n return None", "def select_migrant(self, mentor_id, migrant_id):\n\n\t\tmigrant = self.matcher.get_migrant(mentor_id)\n\t\tmentor = s...
[ "0.72444737", "0.64753354", "0.57945997", "0.5781923", "0.573822", "0.5737821", "0.571938", "0.5695233", "0.5695233", "0.5693313", "0.5634463", "0.5632871", "0.5592265", "0.5576285", "0.5571252", "0.55611974", "0.55115056", "0.55115056", "0.54284245", "0.5428095", "0.5397289"...
0.7512105
0
Gets the mentor with a specified id
def get_mentor(self, mentor_id): mentor = self.matcher.get_mentor(mentor_id) if mentor is not None: return mentor.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self,id):\r\n person = get_one_by_persons_id(id=id)\r\n if not person:\r\n api.abort(404)\r\n else:\r\n return person", "def get_mentor(user_id, with_partners=1):\n # Get db object and users table\n db = get_db()\n users = db.users\n \n # Check if...
[ "0.64452845", "0.64311844", "0.64267206", "0.6302962", "0.62469167", "0.62356436", "0.61520326", "0.6146168", "0.6053088", "0.6049519", "0.6008519", "0.6004248", "0.6001442", "0.59975976", "0.59341997", "0.59100205", "0.59071815", "0.58680457", "0.58519346", "0.58453614", "0....
0.73019284
0
Finds the given migrants for a specified mentor
def find_migrants(self, mentor_id:str): mentor = self.matcher.get_mentor(mentor_id) if mentor is None: return [] self.matcher.find_matches(mentor) migrants = [] for migrant in mentor.get_matches(): migrants.append(migrant.to_dict()) return migrants
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_mentor(self, mentor_id:str, migrant_id: str):\n\t\tmentor = self.matcher.get_mentor(mentor_id)\n\t\tmentor.set_match(migrant_id)\n\n\t\tself.mentors.replace_one(Database.id_query(mentor_id), {\"match\": migrant_id})", "def select_migrant(self, mentor_id, migrant_id):\n\n\t\tmigrant = self.matcher.get_...
[ "0.6476304", "0.63629913", "0.5643828", "0.5580001", "0.53442895", "0.5238006", "0.5178843", "0.49572435", "0.48162293", "0.47953507", "0.47714722", "0.46391717", "0.4638518", "0.45841062", "0.45690066", "0.4563139", "0.45463505", "0.4518289", "0.447352", "0.44638625", "0.445...
0.80149007
0
Adds a migrant to mongo db and matcher system
def add_new_migrant(self, migrant_dict:dict): _id = self.migrants.insert_one(migrant_dict) self.matcher.add_migrant(migrant_dict) return str(_id.inserted_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def migrate(self):\n\tpass", "def migration():", "def migrate(ctx):\n connecter = ScalingoInterface(ctx.obj)\n connecter.manage_py(\"migrate\")", "def migrate(cls)->None:\n pass", "def migrate(migrator, database, fake=False, **kwargs):\n\n tables = database.get_tables()\n\n if 'tea_vendo...
[ "0.6315596", "0.6263166", "0.58108044", "0.5797217", "0.5542815", "0.553052", "0.55085164", "0.53455174", "0.53113365", "0.52721447", "0.5223097", "0.5212903", "0.5196864", "0.51725674", "0.5166101", "0.51521176", "0.51408714", "0.5120767", "0.51071167", "0.5100428", "0.50946...
0.6706453
0
Adds a new mentor to the mongo db and matcher system.
def add_new_mentor(self, mentor_dict:dict): _id = self.mentors.insert_one(mentor_dict) self.matcher.add_mentor(mentor_dict) return str(_id.inserted_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mentions(self, mentions):\n\n self._mentions = mentions", "def add_answering_person(message):\n uid = message.chat.id\n username = message.chat.username\n\n answering_users = db.answering_users\n user_data = {\n 'uid': uid,\n 'username': username,\n }\n result = answeri...
[ "0.5597216", "0.5500295", "0.54681736", "0.5333393", "0.53069097", "0.5305909", "0.52906334", "0.5277775", "0.52753156", "0.5242415", "0.5216427", "0.52082574", "0.5203078", "0.5197035", "0.51697785", "0.51604104", "0.51294464", "0.5118452", "0.51146597", "0.510868", "0.50676...
0.7206864
0
Select a mentor for a specified user
def select_mentor(self, mentor_id:str, migrant_id: str): mentor = self.matcher.get_mentor(mentor_id) mentor.set_match(migrant_id) self.mentors.replace_one(Database.id_query(mentor_id), {"match": migrant_id})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _dm(self, ctx, user: str, *, message: str = None):\n if user is None:\n await ctx.send(\"Provided no user to search for.\")\n return\n else:\n try:\n user = ctx.guild.get_member_named(user)\n ...
[ "0.5986137", "0.59718657", "0.58529013", "0.5733456", "0.5715917", "0.5708726", "0.5697871", "0.5697356", "0.567444", "0.56364137", "0.56279194", "0.5627459", "0.5592418", "0.5588075", "0.55753523", "0.5572315", "0.5556327", "0.5555887", "0.5524461", "0.54997104", "0.54769486...
0.6418105
0
Select a migrant for a specified user
def select_migrant(self, mentor_id, migrant_id): migrant = self.matcher.get_migrant(mentor_id) mentor = self.matcher.get_mentor(migrant_id) room = Database.random_char(10) if migrant is None: migrant.set_match(mentor_id) migrant.set_room(room) mentor.set_room(room) self.migrants.replace_one(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_migrant(self, migrant_id:str):\n\t\tmigrant = self.matcher.get_mentor(migrant_id)\n\t\tif migrant is not None:\n\t\t\treturn migrant.to_dict()", "def load_user(admin_id):\n #sql_query=\"\"\"SELECT * FROM Administrador WHERE id=?\"\"\"\n admin=Administrador(\"mail\",\"name\")\n \n return admin...
[ "0.60269964", "0.5977454", "0.581635", "0.5690023", "0.54875773", "0.5483271", "0.5454219", "0.5445893", "0.53974503", "0.52387184", "0.51874876", "0.5148799", "0.5137574", "0.50241673", "0.5015613", "0.5012868", "0.50080293", "0.4925197", "0.4916394", "0.49064612", "0.489880...
0.6688047
0
Convert from Labels to Ranges
def label_to_range(label): C = int(label.max()) arange = np.zeros((C+1,), dtype=np.int) cumsum = 0 for i in xrange(C): cumsum += np.where(label == (i+1))[0].size arange[i+1] = cumsum return arange
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def range_to_label(arange):\r\n # pass\r\n C = arange.size - 1\r\n label = np.ones((arange[-1], ), dtype=np.int)\r\n for i in xrange(1, C):\r\n label[arange[i]: arange[i+1]] *= (i+1)\r\n return label", "def expand_range(txt, range_operator='~'):\n if range_operator not in txt:\n ret...
[ "0.6561459", "0.6251339", "0.61453164", "0.6110565", "0.6078837", "0.59772223", "0.5973819", "0.5931062", "0.59018856", "0.5893079", "0.5855436", "0.5785486", "0.5762292", "0.57530665", "0.57318765", "0.5695392", "0.56573445", "0.565254", "0.5593975", "0.5585469", "0.5576648"...
0.69999105
0
Convert from Ranges to Labels
def range_to_label(arange): # pass C = arange.size - 1 label = np.ones((arange[-1], ), dtype=np.int) for i in xrange(1, C): label[arange[i]: arange[i+1]] *= (i+1) return label
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def labels(self, start, end, numlabels=None, char_width=None):\n ticks = self.ticks(start, end, numlabels)\n labels = self.formatter.format(ticks, numlabels, char_width)\n return zip(ticks, labels)", "def getLabels(self):\n return self.numToLabel", "def _get_excel_column_labels(start: s...
[ "0.6889429", "0.64018095", "0.6256419", "0.625137", "0.6222409", "0.61240584", "0.6085998", "0.6072657", "0.6024972", "0.6009581", "0.600957", "0.59896815", "0.5982179", "0.5979167", "0.5976452", "0.5884645", "0.5876695", "0.5867243", "0.58608294", "0.58559334", "0.58478755",...
0.75237596
0
Extract a block of rows from a matrix.
def get_block_row(M, C, row_range): if isinstance(C, int): return M[row_range[C]: row_range[C+1], :].copy() if isinstance(C, list) or isinstance(C, (np.ndarray, np.generic)): ids = [] for c in C: ids = ids + range(row_range[c], row_range[c+1]) return M[ids, :]....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_block(M, i, j, row_range, col_range):\r\n # pass\r\n return M[row_range[i]:row_range[i+1], col_range[j]: col_range[j+1]].copy()", "def matrix_chunker(blocksize, matrix, axis=0, offset=0):\r\n length=matrix.shape[axis]\r\n index=np.arange(0+offset, length+offset, blocksize)\r\n index=np.app...
[ "0.6337678", "0.6118749", "0.60818696", "0.5988707", "0.598776", "0.5940113", "0.58169013", "0.5811685", "0.57534105", "0.57466304", "0.57347953", "0.5730745", "0.5726664", "0.571414", "0.5701801", "0.5669308", "0.56535393", "0.56395805", "0.56125385", "0.55581707", "0.553869...
0.645749
0
Return norm 1 of a matrix, which is sum of absolute value of all element of that matrix.
def norm1(X): # pass if X.shape[0]*X.shape[1] == 0: return 0 return abs(X).sum() # return LA.norm(X, 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def norm1(x):\n n, p = x.shape\n if p == 1 or n == 1:\n return np.sum(np.abs(x))\n else:\n return np.max(np.sum(np.abs(x), axis=0))", "def norm_matrix(A):\n\tX = np.abs(A)\n\treturn np.sum([np.sum(X[i]) for i in range(np.shape(X)[0])])", "def norm_abs(a):\r\n\r\n n = np.sum(abs(a))\r\...
[ "0.8051304", "0.75895333", "0.7502515", "0.72662246", "0.72009325", "0.70398474", "0.6893464", "0.68842816", "0.6883202", "0.68456286", "0.68347704", "0.68205696", "0.6808674", "0.67982745", "0.6785506", "0.6761492", "0.67597914", "0.6740656", "0.672828", "0.6709115", "0.6698...
0.7952448
1
check if a numpy.ndarray variable x is a vector
def is_vector(x): return len(x.shape) == 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_vec(x):\n return x.ndim == 1 or (x.ndim == 2 and \n (x.shape[0] == 1 or x.shape[1] == 1))", "def is_vector(self):\n return len(self.coeffs.shape[self.sdim:]) == 1", "def has_vector_type(obj: _std_typing.Any) -> bool:\n return obj.dtype == sc.DType.vector3", "def is_vectorvox(self):...
[ "0.81017125", "0.78788", "0.74047595", "0.7301339", "0.7246725", "0.7190032", "0.7161028", "0.68338597", "0.6767244", "0.67665195", "0.67467844", "0.6703265", "0.668487", "0.66721344", "0.66504556", "0.6598823", "0.6585503", "0.6490688", "0.6469927", "0.64631265", "0.6375711"...
0.8893805
0
Return nuclear norm of a matrix. Syntax `res = nuclearnorm(X)`
def nuclearnorm(X): if X.size == 0: return 0 return LA.norm(X) if is_vector(X) else LA.norm(X, 'nuc') pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def norm(x):\r\n return sqrt(np.numerical.sum(x**2))", "def norm(x):\n return np.sqrt(np.sum(x ** 2))", "def frobeniusNorm(X):\n accum = 0\n V = np.reshape(X,X.size)\n for i in xrange(V.size):\n accum += abs(V[i] ** 2)\n return np.sqrt(accum)", "def get_norm(x):\n return np.sqrt(n...
[ "0.70225745", "0.6813482", "0.6691843", "0.66854954", "0.6675148", "0.6603719", "0.6559702", "0.65498716", "0.65400887", "0.65323013", "0.6497086", "0.64964044", "0.6477022", "0.64534307", "0.6414042", "0.6412628", "0.639925", "0.6363292", "0.6353708", "0.63386357", "0.631121...
0.8570154
0
Multiplication with other MyForm matrix
def mult(self, other): A = np.dot(self.M, other.M) B = np.dot(self.M, other.N) + np.dot(self.N, other.M) + \ self.k*np.dot(self.N, other.N) return MyForm(A, B, self.k)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __mul__(self, other):\n # \n # TODO - your code here\n #\n \n result = [];\n row_result = [];\n product = 0;\n \n if(self.w != other.h):\n raise(ValueError, \"Matrices can not multiply for their dimesion doesn't match\"); \n ...
[ "0.7018962", "0.69792277", "0.69266516", "0.6752045", "0.67324686", "0.6685984", "0.6636479", "0.6530708", "0.64483154", "0.64421654", "0.6403959", "0.6368062", "0.6358586", "0.63431484", "0.63371235", "0.6331938", "0.6328524", "0.6325307", "0.62924916", "0.6285656", "0.62214...
0.7324277
0
M = build_mean_vector(X, Y_range) suppose X = [X_1 X_2 ... X_C] return M = [m1, m2, ..., M_C] where mi = mean(X_i)
def build_mean_vector(X, Y_range): C = Y_range.size -1 M = np.zeros((X.shape[0], C)) for c in xrange(C): Xc = get_block_col(X, c, Y_range) M[:, c] = np.mean(Xc, axis=1) return M
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mean(self, X):\n raise NotImplementedError", "def generate_avg_vector(self, data):\r\n doc=nlp(data)\r\n data_vector = [token.vector for token in doc]\r\n mean_vector = np.mean(data_vector, axis=0)\r\n return mean_vector", "def get_mean(numlist):\n return np.mean(n...
[ "0.6180233", "0.61117053", "0.59907126", "0.5944424", "0.5795134", "0.57945734", "0.57642287", "0.5722829", "0.5708983", "0.570537", "0.56909525", "0.5620703", "0.5617984", "0.5591461", "0.55701697", "0.5558366", "0.5544441", "0.55368346", "0.55281603", "0.5525448", "0.552433...
0.85617435
0
repeat np.mean(X, axis = 1) cols times.
def build_mean_matrix(X, cols = None): if len(X.shape) < 2 or X.shape[1] == 0: return X m = np.mean(X, axis = 1) if cols == None: return repmat(m, 1, X.shape[1]) else: return np.tile(m, 1, cols)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_mean(self, width):\n import math\n\n for i in range(len(self.data)):\n for j in range(len(self.chans)):\n self.data[i,:,j,:] = self.data[i - width[j]/2 : i + int(math.ceil(width[j]/2.)), :, j, :].mean(axis=0)", "def expanding_mean(arr):\n total_len = arr.shape[...
[ "0.6440738", "0.6411225", "0.626111", "0.62149805", "0.6209564", "0.61476517", "0.6005486", "0.59634185", "0.59464157", "0.5845452", "0.5791357", "0.578567", "0.57753587", "0.5761501", "0.57288474", "0.5679341", "0.56710595", "0.5670305", "0.5669338", "0.5668395", "0.56472784...
0.71458197
0
% function new_range = range_delete_ids(a_range, ids) % given a range `a_range` of an array. Suppose we want to delete some % element of that array indexed by `ids`, `new_range` is the new range
def range_delete_ids(a_range, ids): ids = np.sort(ids) n = a_range.size # m = ids.size a = np.zeros_like(a_range) j = 1 while j < n-1: for i in xrange(n): while a_range[j] < ids[i]: j += 1 for k in range(j, n): a[k] += 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deleteAddressRange(self, start: ghidra.program.model.address.Address, end: ghidra.program.model.address.Address, monitor: ghidra.util.task.TaskMonitor) -> None:\n ...", "def DeleteRange(self, r):\n self.__context.builder.DocumentDelete(self._blip_data.wave_id,\n ...
[ "0.59897554", "0.5973227", "0.5736378", "0.5725726", "0.5706873", "0.5411256", "0.5362253", "0.535811", "0.53313136", "0.5290644", "0.52667576", "0.52648824", "0.5240243", "0.5217289", "0.5206472", "0.5193933", "0.51499987", "0.5129673", "0.5125648", "0.5122137", "0.5076111",...
0.869615
0
check x is 3dlist([[[1], []]]) or 2d empty list([[], []]) or 1d empty list([]).
def is_3dlist(x): if not isinstance(x, list): return False if len(x) == 0: return True for sub_x in x: if not is_2dlist(sub_x): return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_2dlist(x):\n if not isinstance(x, list):\n return False\n if len(x) == 0:\n return True\n\n return all(isinstance(item, list) for item in x)", "def _is_ragged_in_1st_dim_only(value: Union[np.ndarray, list]) -> bool:\n if isinstance(value, np.ndarray) and value.dtype != np.dtype(\...
[ "0.7362723", "0.617094", "0.61675197", "0.61438113", "0.6074036", "0.58569556", "0.58543783", "0.58528244", "0.5845413", "0.57743174", "0.5768154", "0.5654776", "0.5634541", "0.5631094", "0.5625256", "0.5615522", "0.56082004", "0.56069666", "0.5593049", "0.55906504", "0.55785...
0.83740175
0
check x is 2dlist([[1], []]) or 1d empty list([]).
def is_2dlist(x): if not isinstance(x, list): return False if len(x) == 0: return True return all(isinstance(item, list) for item in x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_3dlist(x):\n if not isinstance(x, list):\n return False\n if len(x) == 0:\n return True\n for sub_x in x:\n if not is_2dlist(sub_x):\n return False\n\n return True", "def check_1d(x, name):\n\n x = asarray(x)\n if size(x) == 1:\n x = asarray([x])\n ...
[ "0.71084034", "0.6429971", "0.63074654", "0.6260858", "0.62219685", "0.6206959", "0.61970204", "0.6142599", "0.6130701", "0.6035096", "0.60267055", "0.6013936", "0.600315", "0.6000378", "0.59949636", "0.5966555", "0.59324545", "0.59247744", "0.5922874", "0.59007895", "0.58671...
0.7903866
0
Watching if ++ or appear in a channel appended to a single word.
def _listen_(self, msg): for word in msg.msg.split(' '): if word[:-2].lower() == msg.user.name.lower(): return msg.prefix + \ _('Don\'t even think of modifying your own karma.') else: if word[-2:] == '++': self._x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def consume(self, word):\n if len(self.history) >= self.history_len:\n self.history = self.history[1:]\n self.history.append(str(word))", "async def wordfilter_add(self, ctx, *, phrase):\n phrase = phrase.lower()\n await self.bot.redis.rpush('wordfilter', phrase)\n s...
[ "0.5739408", "0.55870277", "0.5578364", "0.5492685", "0.54806924", "0.5424537", "0.5415494", "0.54078627", "0.5338593", "0.5328591", "0.5295912", "0.5263179", "0.5233918", "0.51867765", "0.51852083", "0.5165695", "0.5141927", "0.51325846", "0.5130422", "0.5121895", "0.5082026...
0.5918166
0
Resets karma of first parameter if invoker has level.
def reset_karma(self, msg): level = 15 if self.require_level(msg.user, level): word = msg.params.split(' ')[0].lower() if self._word_exists(word): del self.vault[word] self.vault.sync() return _('Reset karma of %s.' % word) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset() -> None:\n Parameter.by_name = {}", "def reset(*args):", "def reset(*args):", "def reset(*args):", "def _change_karma(self, nick, target, mode):\n if nick == target:\n return \"You can't modify your own karma.\"\n if target in self.karma and (datetime.datetime.no...
[ "0.5446032", "0.5440489", "0.5440489", "0.5440489", "0.54280657", "0.53661484", "0.53189063", "0.52874345", "0.52546316", "0.52452296", "0.5195697", "0.5195697", "0.51318574", "0.5090501", "0.508848", "0.5087434", "0.50784624", "0.5075133", "0.50489724", "0.5047986", "0.50281...
0.6385328
0
Test helper method to get similarity.
def test_get_similarity(): for similarity_enum in SimilarityEnum: similarity = get_similarity(similarity=similarity_enum)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_similarity(self):\n self.assertTrue(np.allclose(self.vectors.similarity('dog.n.01', 'dog.n.01'), 1))\n self.assertTrue(np.allclose(self.vectors.similarity('dog.n.01', 'mammal.n.01'), 0.180901358))", "def __getSimilarityScore(expected, actual):\n return SequenceMatcher(None, expected, ac...
[ "0.7354859", "0.7280552", "0.7056084", "0.679872", "0.6625316", "0.66248757", "0.66150284", "0.65865004", "0.65795416", "0.6544543", "0.6542008", "0.6537459", "0.65308046", "0.65308046", "0.65193725", "0.6505629", "0.6505251", "0.64992476", "0.64825267", "0.64813554", "0.6459...
0.72892106
1
If no custom variational expectation method is provided, we use cubature.
def variational_expectation_(self, y, m, v, cubature=None): return variational_expectation_cubature(self, y, m, v, cubature)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fv(self):\n return self.beta * (self.x ** self.c)", "def __abs__(self):\n return Factor().__build( VarSet(self.v) , np.fabs(self.t) )", "def variational_expectations(self, Fmu, Fvar, Y):\n return ndiagquad(self.logp, self.num_gauss_hermite_points, Fmu, Fvar, Y=Y)", "def __float__(self):\n ...
[ "0.6345054", "0.5744103", "0.5514673", "0.55132526", "0.541697", "0.54162294", "0.5396025", "0.53791803", "0.536064", "0.5349265", "0.53485364", "0.53485364", "0.53485364", "0.53485364", "0.53485364", "0.53485364", "0.53485364", "0.53485364", "0.5340279", "0.5335535", "0.5313...
0.67198485
0
If no custom moment matching method is provided, we use cubature.
def moment_match_(self, y, cav_mean, cav_cov, power=1.0, cubature=None): return moment_match_cubature(self, y, cav_mean, cav_cov, power, cubature)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_augment_moment_fn(self):\n pass # always override this function", "def _get_augment_moment_fn(self):\n return self._compute_instance_moments", "def first_moment(self, mass, z=None):\n return 1.0", "def moments(self):", "def moment_contact(self, *args, **kwargs) -> Any:\n ...
[ "0.579283", "0.51278555", "0.51072043", "0.50317395", "0.5021617", "0.50120544", "0.4913537", "0.48178473", "0.4796796", "0.46811798", "0.46475235", "0.45929852", "0.4592815", "0.45846412", "0.45793003", "0.4579115", "0.45478803", "0.45414335", "0.45207042", "0.45178017", "0....
0.59953386
0
a weight blend method, that corresponding parts in logo and source will be blend according to their alpha value.
def weight_paste(pixSrc, pixPng, src_id, logo_id): weight = pixPng[:, :, 3] / 255 weight = weight[:, :, np.newaxis] alpha = weight[logo_id] beta = 1 - alpha pixSrc[src_id] = pixSrc[src_id] * beta + pixPng[logo_id] * alpha return pixSrc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _blend(img1, img2, alpha):\n return img1.mul(alpha).add(1 - alpha, img2)", "def alpha_blending(im1, im2, window_size=0.5):\n assert(im1.shape == im2.shape)\n\n columns = im1.shape[1]\n rows = im1.shape[0]\n transition_size = int(columns * window_size)\n im1_size = (columns - transition_size) // 2\n ...
[ "0.7288768", "0.6564726", "0.65222967", "0.6419508", "0.6414909", "0.63892126", "0.6343093", "0.63157976", "0.6297902", "0.6283805", "0.6263074", "0.6234253", "0.621506", "0.61196524", "0.6100443", "0.609519", "0.60923606", "0.6088923", "0.60730666", "0.60658664", "0.6052815"...
0.68611676
1
Blend the source image with logo image at corresponding locations.
def channel_blend(pixSrc, pixPng, srcH, srcW, x, y, mode='weight', color_match=False): modes = [item for i, item in blend_mode.items()] # 1.find all indices satisfying conditions, and replace the value of indices in source image with logo image. # note: from pillow to numpy, (w,h) has converted to (h,w). ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _blend(img1, img2, alpha):\n return img1.mul(alpha).add(1 - alpha, img2)", "def _crossing_over(self, img_ext_1, img_ext_2) -> ExtendedImage:\n # Copy first extended image\n new_member = img_ext_1.img.copy()\n height = img_ext_2.get_height()\n\n # Add the right half of the 2nd i...
[ "0.65651447", "0.64991945", "0.6311233", "0.6190755", "0.6183678", "0.6163904", "0.6118799", "0.61160445", "0.61139077", "0.6045823", "0.6022472", "0.6019472", "0.587753", "0.5857409", "0.58231765", "0.5813919", "0.5800125", "0.57508075", "0.5732947", "0.5702724", "0.5674635"...
0.6518264
1
Handler for command "fridge" Queries states from castor fridge api and sends formatted status message
def cmdFridge(token, chatID): unixTime = 0 states = {} try: unixTime, states = getSwitchData() except: writeLog("errorneus reply") if unixTime == "": sendMessage(token, chatID, "`Ei dataa`") return lastUpdated = datetime.fromtimestamp(unix...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status_command(command, server):\n\n channel = command.event.args[0] if not command.event.args[\n 0] == server.nick else command.event.name\n\n # Display afk status for each name\n if len(command.args) > 0:\n for name in command.args:\n if not name == \"\":\n ma...
[ "0.57859796", "0.57119155", "0.5657806", "0.5653141", "0.56367266", "0.56214213", "0.5549745", "0.5448959", "0.54141206", "0.54064375", "0.5391417", "0.53818274", "0.5365671", "0.53583205", "0.5313209", "0.5291126", "0.52747834", "0.5226628", "0.5220819", "0.522048", "0.52116...
0.6662204
0
Upload files to Box
def boxUpload(client, path): file_info = [] for x in path: box_file = client.folder(0).upload(x) file_info.append(box_file.id) return file_info
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload(ctx: click.Context, **kwargs):\n root_commands.cmd_upload(ctx.obj, **kwargs)", "def file_upload():\n\n click.secho('*** Uploading image...', fg='green')\n uploaded = _uploaded_file('cover.jpg')\n click.secho(json.dumps(uploaded, indent=2, sort_keys=True), fg='yellow')\n\n click.secho('*...
[ "0.6888668", "0.68607336", "0.68578136", "0.68098044", "0.6739335", "0.6636619", "0.66122025", "0.6544335", "0.65226525", "0.64358366", "0.6408942", "0.63912135", "0.63750654", "0.63235784", "0.63225883", "0.6309114", "0.6308267", "0.62861806", "0.62693316", "0.6248572", "0.6...
0.7474553
0
Search Box for all files limits to 100 files
def boxSearch(client): files = [] items_iter = client.folder(folder_id=0).get_items(limit=100, offset=0) for x in items_iter: files.append(x) return files
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __searchFiles(self):\n self.ui.showFindFilesDialog(self.textForFind())", "def _search(self, btn):\n del btn\n if self.txt_search.value:\n found_files: Optional[List[Path]] = None\n while found_files is None:\n try:\n found_files = l...
[ "0.7295431", "0.6953798", "0.66348857", "0.64755803", "0.63517517", "0.614988", "0.6149577", "0.61274266", "0.6123645", "0.61161524", "0.60581344", "0.5974812", "0.5888116", "0.5852434", "0.5837915", "0.5837801", "0.5837728", "0.58318996", "0.58054507", "0.5791539", "0.577776...
0.7376368
0
Share a file to email
def boxShare(client, file_id, email): for i in file_id: client.file(i).collaborate_with_login(email, role='VIEWER')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def share(link, emails, from_name = \"\", reply_to = \"\", body = \"\"):\r\n now = datetime.datetime.now(g.tz)\r\n ival = now - timeago(g.new_link_share_delay)\r\n date = max(now,link._date + ival)\r\n Email.handler.add_to_queue(c.user, link, emails, from_name, g.share_reply,\r\n ...
[ "0.685159", "0.66511345", "0.664767", "0.6109776", "0.6007653", "0.59983873", "0.598276", "0.59420544", "0.59268576", "0.5915608", "0.5822419", "0.5822419", "0.5762922", "0.5757784", "0.5754199", "0.57380277", "0.57289696", "0.5707631", "0.5694756", "0.5682473", "0.567271", ...
0.7060654
0
Update existing file on box
def boxUpdate(client, file_id, path): box_file = client.file(file_id).update_contents(path) return box_file
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_update(self):\n self.update_file_path()", "def statusupdate(filepath):\n pass", "def _update_ondisk(self):\n with open(self.orig_path, \"w\") as f:\n f.write(self.content)", "def updateFile(filename, content):\n\tfilename = adaptPath(filename)\n\tif filename !...
[ "0.64442194", "0.64063203", "0.6153084", "0.6068481", "0.60507697", "0.60507697", "0.604971", "0.6042904", "0.59752285", "0.5824819", "0.5793628", "0.57831573", "0.57443243", "0.574215", "0.5705869", "0.5677697", "0.56648594", "0.56626284", "0.5628112", "0.56222546", "0.56116...
0.8195273
0
Local cost. It is a constant number for the original paper.
def local_cost(self) -> Number: mu_E = self._payoff_weight_energy mu_T = self._payoff_weight_time D_loc = SIMULATION_PARAMETERS['LOCAL_CPU_CYCLES'] F_loc = self.cpu_frequency T_loc = D_loc / F_loc E_loc = D_loc / self.cpu_effeciency return mu_T * T_loc + mu_E * E_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cost(self) -> float:", "def compute_cost(self, chrome):\n return 1", "def get_cost(self) -> float:\n return math.e / self.fitness", "def cost(self):\n return self._cost", "def cost(self):\n return self._cost", "def _cost_refueling(self):\n if self.number_of_courses ...
[ "0.74435276", "0.69626296", "0.6961224", "0.69467026", "0.69467026", "0.6932376", "0.686416", "0.68125033", "0.6784984", "0.6726596", "0.6711721", "0.6664859", "0.66626436", "0.6649669", "0.66363364", "0.65975237", "0.65934134", "0.6583541", "0.657953", "0.6570871", "0.652677...
0.81015706
0
Utility to ensure textlike usability. If s is of type bytes or int, return s.decode(encoding, errors), otherwise return s as it is.
def text_(s: Any, encoding: str = 'utf-8', errors: str = 'strict') -> Any: if isinstance(s, int): return str(s) if isinstance(s, bytes): return s.decode(encoding, errors) return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def text_(s, encoding='utf-8', errors='strict'):\n if isinstance(s, binary_type):\n return s.decode(encoding, errors)\n return s # pragma: no cover", "def force_unicode(s, encoding=encoding, errors='strict'):\n if isinstance(s, unicode):\n return s\n elif hasattr(s, '__unicode__'):\n ...
[ "0.779928", "0.7132164", "0.71243644", "0.7108504", "0.70143425", "0.69266945", "0.6859506", "0.6859506", "0.67835146", "0.67751604", "0.67617494", "0.6757854", "0.6742094", "0.6700172", "0.6700172", "0.6672358", "0.66558903", "0.6591792", "0.6561015", "0.6556834", "0.649977"...
0.8021022
1
Utility to ensure binarylike usability. If s is type str or int, return s.encode(encoding, errors), otherwise return s as it is.
def bytes_(s: Any, encoding: str = 'utf-8', errors: str = 'strict') -> Any: if isinstance(s, int): s = str(s) if isinstance(s, str): return s.encode(encoding, errors) return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ensure_binary(s, encoding='utf-8', errors='strict'):\n if isinstance(s, six.text_type):\n return s.encode(encoding, errors)\n elif isinstance(s, six.binary_type):\n return s\n else:\n raise TypeError(\"not expecting type '%s'\" % type(s))", "def ensure_binary(s, encoding=\"utf-8...
[ "0.8161377", "0.7675969", "0.7671829", "0.76134723", "0.7545099", "0.74283886", "0.73617977", "0.73382246", "0.7112478", "0.7066023", "0.6989391", "0.68542296", "0.6828603", "0.6825002", "0.6730803", "0.6685819", "0.6669617", "0.66628563", "0.66628563", "0.66465724", "0.65566...
0.82499933
1
Build and returns a HTTP request packet.
def build_http_request(method: bytes, url: bytes, protocol_version: bytes = HTTP_1_1, headers: Optional[Dict[bytes, bytes]] = None, body: Optional[bytes] = None) -> bytes: if headers is None: headers = {} return build_http_pkt( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_http_request(method: bytes, url: bytes,\n protocol_version: bytes = b'HTTP/1.1',\n headers: Optional[Dict[bytes, bytes]] = None,\n body: Optional[bytes] = None) -> bytes:\n if headers is None:\n headers = {}\n return build_htt...
[ "0.73017925", "0.6927009", "0.6739268", "0.6739268", "0.66733617", "0.661261", "0.64324754", "0.64064515", "0.6251981", "0.6248902", "0.6221216", "0.6193656", "0.6125617", "0.6114444", "0.5969525", "0.5935127", "0.5890128", "0.5820026", "0.57760775", "0.57601017", "0.575795",...
0.7260544
1
Build and return a HTTP header line for use in raw packet.
def build_http_header(k: bytes, v: bytes) -> bytes: return k + COLON + WHITESPACE + v
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_header(self): \n \n # create the individual labels\n hdr_bits = [hb.format(hdr) for hb, hdr in zip(self.row_base, self.headers)]\n \n # stick it all together and return with hdr_sep underneath\n hdr_str = f\"|{'|'.join(hdr_bits)}|\\n\"\n ...
[ "0.6726503", "0.67076457", "0.67076457", "0.6679974", "0.6527648", "0.6467381", "0.64456123", "0.6409515", "0.631277", "0.62477493", "0.6228026", "0.62213707", "0.62110794", "0.6207926", "0.61751235", "0.6165498", "0.615284", "0.6116615", "0.6113761", "0.6112869", "0.6086173"...
0.7037145
1
Build and returns a Websocket handshake request packet.
def build_websocket_handshake_request( key: bytes, method: bytes = b'GET', url: bytes = b'/', host: bytes = b'localhost') -> bytes: return build_http_request( method, url, headers={ b'Host': host, b'Connection': b'upgrade', b'Upgrad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_websocket_handshake_request(\n key: bytes,\n method: bytes = b'GET',\n url: bytes = b'/') -> bytes:\n return build_http_request(\n method, url,\n headers={\n b'Connection': b'upgrade',\n b'Upgrade': b'websocket',\n b'Sec-WebSocket-Key...
[ "0.7152327", "0.6808552", "0.61367875", "0.595799", "0.595799", "0.57933235", "0.57503295", "0.57185477", "0.56599486", "0.5583724", "0.5576461", "0.5517508", "0.55008024", "0.54950875", "0.54825586", "0.54270893", "0.5390322", "0.5386732", "0.53723335", "0.52927613", "0.5264...
0.711393
1
Build and returns a Websocket handshake response packet.
def build_websocket_handshake_response(accept: bytes) -> bytes: return build_http_response( 101, reason=b'Switching Protocols', headers={ b'Upgrade': b'websocket', b'Connection': b'Upgrade', b'Sec-WebSocket-Accept': accept } )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handshake(self):\n\n request_line = _build_method_line(self._options.get('resource'))\n self._logger.debug('Client\\'s opening handshake Request-Line: %r',\n request_line)\n self._socket.sendall(request_line)\n\n fields = []\n fields.append(_format_host_header(\n ...
[ "0.63807935", "0.6092031", "0.5937762", "0.5855341", "0.58070713", "0.5784399", "0.57644093", "0.56835926", "0.558388", "0.54542094", "0.5413581", "0.5361608", "0.5337215", "0.5335631", "0.53200066", "0.53066754", "0.5300943", "0.529926", "0.5282492", "0.5272044", "0.52666885...
0.6979216
1
Return a vector of (unique) node tags related to a vector of element tags. For only one element, use get connectivity.
def get_node_tags(self, elem_tag): all_node_tag = np.array([], dtype=int) if np.size(elem_tag) > 1: for ie in range(len(elem_tag)): all_node_tag = np.concatenate( (all_node_tag, self.get_connectivity(elem_tag[ie])) ) all_node_tag = np.unique(all_node_tag) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tags(self,element):\n if element in self.element2tags.keys():\n return self.element2tags[element]\n return []", "def get_all_tagged(self,tag_name):\n return self.tag2elements[tag_name]", "def tags(self):\n return tuple(self._tree.getTags())", "def get_node_tags(self):\n\n ...
[ "0.68512344", "0.62812114", "0.6205648", "0.6063796", "0.60137427", "0.59801376", "0.59512436", "0.5919799", "0.58629185", "0.58387655", "0.57809895", "0.5769953", "0.57641065", "0.5751689", "0.57366633", "0.5708408", "0.5706701", "0.5695809", "0.5694167", "0.5693853", "0.568...
0.8047518
0
Each line of the the Day 3 text file contains the claim ID, topleft coordinates, height and width. Each claim is a rectangle on the grid. There is only one single claim that is not overlapped by any other claim. This function reads each line in the puzzle input and finds that single claim.
def part2(puzzle_input): puzzle_input_arr = puzzle_input.split('\n') visited_squares = {} # (x coordinate, y coordinate): claim ID all_claims = set() # Every single claim overlapped = set() # Every single claim that is overlapped for line in puzzle_input_arr: line_elements = re.split('[#@...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allocate_cloth():\n cloth = defaultdict(set)\n with open(\"input.txt\") as f:\n claims = (parse_line(ln) for ln in f)\n for claim in claims:\n for square in claim[\"squares\"]:\n cloth[square].add(claim[\"claim_id\"])\n return cloth", "def read_txt(if_name):\n...
[ "0.5960726", "0.5833757", "0.57868874", "0.5721134", "0.570888", "0.56458473", "0.561214", "0.5533646", "0.5484229", "0.548413", "0.5479752", "0.54278463", "0.53975224", "0.5386779", "0.5338545", "0.52815044", "0.5277309", "0.5274866", "0.5254923", "0.5250964", "0.5246422", ...
0.69374156
0
Return the column order of the columns in the display tab.
def column_order(self): return ((1, 2), (1, 0), (1, 1))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_display_columns(self): \n if not hasattr(self, '_display_columns'):\n self._display_columns = self.gridpreference_displayorder.all().select_related()\n return self._display_columns", "def get_order_columns(self):\n return self.order_columns", "def get_sort_columns...
[ "0.75365704", "0.7256665", "0.7012469", "0.70077235", "0.6890462", "0.68693596", "0.67841136", "0.668463", "0.6668474", "0.66437155", "0.6615417", "0.66114193", "0.6576719", "0.653651", "0.6368881", "0.62906307", "0.62482643", "0.6243617", "0.62331694", "0.6117272", "0.609215...
0.75505567
0
Create a new Note instance and call the EditNote editor with the new note. Called when the Add button is clicked. If the window already exists (WindowActiveError), we ignore it. This prevents the dialog from coming up twice on the same object.
def add_button_clicked(self, obj): note = Note() if self.notetype : note.set_type(self.notetype) try: from .. import EditNote EditNote(self.dbstate, self.uistate, self.track, note, self.add_callback, sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_button_clicked(self, obj):\n handle = self.get_selected()\n if handle:\n note = self.dbstate.db.get_note_from_handle(handle)\n try:\n from .. import EditNote\n EditNote(self.dbstate, self.uistate, self.track, note,\n ...
[ "0.6291196", "0.60075516", "0.5843317", "0.5818341", "0.58142567", "0.57893556", "0.5711306", "0.56593543", "0.5626131", "0.5569847", "0.55559975", "0.5553282", "0.5545314", "0.5501547", "0.54904157", "0.54656535", "0.54577756", "0.54203916", "0.54171115", "0.539738", "0.5372...
0.71732914
0
Get the selected Note instance and call the EditNote editor with the note. Called when the Edit button is clicked. If the window already exists (WindowActiveError), we ignore it. This prevents the dialog from coming up twice on the same object.
def edit_button_clicked(self, obj): handle = self.get_selected() if handle: note = self.dbstate.db.get_note_from_handle(handle) try: from .. import EditNote EditNote(self.dbstate, self.uistate, self.track, note, callertitle ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mouseDoubleClickEvent(self, e):\n self.win = items.edit.Edit(self)\n self.win.setModal(True)\n self.win.show()", "def edit_note(self):\r\n names = [note.__str__() for note in self.source.notes]\r\n \r\n selected = self.notes_list.get(tk.ACTIVE)\r\n dex = names...
[ "0.65535975", "0.605835", "0.6041326", "0.5992341", "0.5970536", "0.5881743", "0.57300323", "0.56661344", "0.56658524", "0.55719995", "0.5536951", "0.55071354", "0.5504247", "0.54549533", "0.54329413", "0.53997976", "0.5377687", "0.5345839", "0.5289475", "0.5288488", "0.52758...
0.75340194
0
Decorator mark a function or method for skipping its doctest. This decorator allows you to mark a function whose docstring you wish to omit from testing, while preserving the docstring for introspection, help, etc.
def skip_doctest(f): f.__skip_doctest__ = True return f
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_skip_with_decorator_and_reason():\n pass", "def undocumented(func):\n func._undocumented_ = True\n return func", "def noop_decorator(func):\n return func", "def no_test(func):\n def inner(request, *args, **kwargs):\n return func(request, *args, **kwargs)\n inner.__name__ = f...
[ "0.7153295", "0.69773555", "0.69069266", "0.678293", "0.66318727", "0.6594034", "0.6565296", "0.6540149", "0.6396625", "0.6376084", "0.62921876", "0.6289516", "0.6269498", "0.62549025", "0.6218682", "0.6174685", "0.6164109", "0.6123483", "0.60925204", "0.60906154", "0.6054939...
0.80454737
0
Edit the content of an document. Trys to find the object, (decrypt,) read from editor, encrypt, update date fields and regenerates the title.
def edit(ctx, docid, password): coll = db.get_document_collection(ctx) config = ctx.obj["config"] doc, docid = db.get_document_by_id(ctx, docid) title = doc["title"] template, c = db.get_content(ctx, doc, password=password) content, tmpfile = utils.get_content_from_editor(config["editor"], te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_document():", "def document_edit(document_id):\n\n log(session['login'], 'updated', 'document {}'.format(document_id))\n\n doc = Document.query.filter(Document.id == document_id).first_or_404()\n doc.title = request.form['title']\n doc.price = request.form['price']\n doc.keywords = comma_...
[ "0.7969228", "0.6659041", "0.6619434", "0.63403827", "0.6338487", "0.62767893", "0.62657344", "0.6232299", "0.61663985", "0.5952887", "0.5898582", "0.5841548", "0.58015746", "0.57980996", "0.5793887", "0.57877755", "0.5751799", "0.5735717", "0.57264566", "0.5725905", "0.57148...
0.838082
0
For each sentence in the corpus, lowercases its words in a dummy stupid way.
def handle_sentence_simple(self, sentence, ctxinfo): global text_version global moses_version global lower_attr for w in sentence : setattr(w, lower_attr, getattr(w, lower_attr).lower()) self.chain.handle_sentence(sentence, ctxinfo)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _apply_lowercase(sentence_tokens):\n return [token.lower() for token in sentence_tokens]", "def test_lower_case():\n assert TextCleaner().transform([[\"TEST\"]])[\"corpus\"][0] == \"test\"", "def clean_cases(text):\n return text.lower()", "def preprocess(text):\n return text.lower()", "...
[ "0.698295", "0.69447345", "0.66862315", "0.6612921", "0.6539759", "0.6513351", "0.6495619", "0.6494213", "0.64673984", "0.64619434", "0.63840485", "0.6371262", "0.6337218", "0.63078785", "0.6275726", "0.6255239", "0.6241", "0.62409455", "0.62239885", "0.62202847", "0.6195341"...
0.69591206
1
Given a percents array generated by the function above, returns the form that occurrs most frequently. Besides of being the most frequent form, the preferred form must also occur above the threshold t defined by the formula t=0.90.1len(percents). For example, if there are two possible forms, t=0.7, with three possible ...
def get_preferred_form( percents ) : # If a given forms occurrs 70% of the cases (for 2 forms) or more, it is # considered preferred # TODO: Test an entropy-based measure for choosing among the forms PRED_THRESHOLD = .9 - .15 * len(percents) max_like = (0, None) for form in list(percents.keys()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_majority(values):\n counter = Counter(values)\n return counter.most_common(1)[0][0]", "def find_majority(dict_probs):\n # if there is no majority class, pick the first from the sorted\n max_val = max(dict_probs.values())\n max_keys = [key for key in dict_probs.keys()\...
[ "0.56323934", "0.5450923", "0.53744286", "0.5264484", "0.51824176", "0.5118351", "0.50734633", "0.50549734", "0.5052382", "0.5034046", "0.49810228", "0.4979254", "0.4967436", "0.4925797", "0.48720175", "0.48535427", "0.48285857", "0.48070258", "0.48064655", "0.47881833", "0.4...
0.75068754
0
Page through query to prevent killed queries
def page_query(q): offset = 0 while True: r = False for elem in q.limit(1000).offset(offset): r = True yield elem offset += 1000 if not r: break
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_query(self):\n raise NotImplementedError()", "def fetch_pages(query_val, page_num):\n \n for page_id in range(1 + page_num + 1):\n try:\n output = fetch_data(query_val, page_id)\n for j in output:\n print(str(j))\n \n except ...
[ "0.6400483", "0.62197566", "0.61458415", "0.60905385", "0.60769653", "0.60441834", "0.5992584", "0.59553283", "0.58734876", "0.5867684", "0.5825728", "0.5812955", "0.5800244", "0.5798734", "0.57965195", "0.57947236", "0.5768216", "0.5754619", "0.5748368", "0.5720514", "0.5683...
0.6812365
0
Addon configuration wizard, automatically configures profiles and addons dependencies, based on usersupplied data and device characteristics and restore to default some expert settings when requested
def run_addon_configuration(restore=False): LOG.debug('Running add-on configuration wizard') _set_codec_profiles() _set_kodi_settings() _set_isa_addon_settings(get_system_platform() == 'android') # For L3 devices we disable by default the esn auto generation (1080p workaround) # see workaround ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optional_install():\n # reduce\n print('{BOLD}Setting up Reduce (optional){END_C}'.format(**text_colours))\n reduce = {}\n reduce_path = get_user_path('Please provide a path to your reduce executable.', required=False)\n reduce['path'] = str(reduce_path)\n reduce['folder'] = str(reduce_path.p...
[ "0.6186538", "0.604018", "0.5848718", "0.57015836", "0.567656", "0.5619545", "0.560612", "0.5581192", "0.5562061", "0.5543828", "0.5472014", "0.5405828", "0.5372956", "0.5357944", "0.53249735", "0.5289706", "0.52862495", "0.52647126", "0.5262539", "0.5254465", "0.5230861", ...
0.72448164
0
Method for selfconfiguring of netflix manifest codec profiles
def _set_codec_profiles(): enable_vp9_profiles = True enable_hevc_profiles = False if get_system_platform() == 'android': # We cannot determine the codecs supported by the device in advance so... # ...we do not enable VP9 because many older mobile devices do not support it enable_vp9...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _augment_pipeline_cfg(self):", "def __init__(self):\r\n super(ProfileParser, self).__init__([self.ProfileEntryHandler()])", "def _setup_pipeline_cfg(self):", "def configure(self):", "def configure(self):", "def configure(self):", "def configure(self):", "def read_pardus_profiles(self):\n\n...
[ "0.5595994", "0.5556482", "0.54909825", "0.5454558", "0.5454558", "0.5454558", "0.5454558", "0.5383059", "0.533801", "0.52279866", "0.5219509", "0.5190809", "0.51723623", "0.51723623", "0.51467925", "0.51443726", "0.5131207", "0.51308465", "0.5129049", "0.5111551", "0.5103486...
0.5863919
0
Method for selfconfiguring Kodi settings
def _set_kodi_settings(): if get_system_platform() == 'android': # Media Codec hardware acceleration is mandatory, otherwise only the audio stream is played try: json_rpc('Settings.SetSettingValue', {'setting': 'videoplayer.usemediacodecsurface', 'value': True}) json_rpc('Set...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_config(self): # called from button_set object \n self.settings['lights_on'] = self.lights_on.get()\n self.settings['lights_off'] = self.lights_off.get()\n self.settings['ambient_min'] = self.ambient_min.get()\n self.settings['soil_1'] = self.smc1.get()\n self.setti...
[ "0.67479545", "0.6595456", "0.6444186", "0.6288202", "0.61837596", "0.61334646", "0.6122383", "0.60889596", "0.6061179", "0.6046686", "0.6024312", "0.6018421", "0.5927917", "0.59199727", "0.5897315", "0.5886806", "0.5872404", "0.58473986", "0.58289564", "0.58188826", "0.58185...
0.69491166
0
Add a new sample (image + annotations [+ pointcloud]) to the dataset.
def addSample(self, img, anns, pointcloud=None, img_id=None, img_format='BGR', write_img=True, other=None): # Sanity check assert img_format in ['BGR','RGB'], "Image format n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, sample, **kwargs):\n if not self.samples:\n self.init(sample)\n self.samples.append(sample)", "def add_samples(self, samples):\n samples = [samples] if isinstance(samples, Sample) else samples\n for sample in samples:\n if isinstance(sample, Sample):\n ...
[ "0.6714337", "0.6354155", "0.6270226", "0.6162691", "0.60495067", "0.5956128", "0.5885087", "0.58417606", "0.5826717", "0.5754306", "0.57272714", "0.56994927", "0.5691107", "0.56823397", "0.56365716", "0.5571827", "0.5561222", "0.5560639", "0.55440944", "0.55090404", "0.54714...
0.7628137
0
Generate a new image ID
def _getNewImgId(self): newImgId = COCO_PLUS.IMG_ID COCO_PLUS.IMG_ID += 1 return newImgId
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image_id(cls):\n return str(uuid.uuid4())", "def get_image_id(filename):\n del filename\n global GLOBAL_IMG_ID\n GLOBAL_IMG_ID += 1\n return GLOBAL_IMG_ID", "def generate_id(cls):\n cls._index += 1\n return 'fp_%s' % cls._index", "def newId():\n global lastId\n last...
[ "0.7741978", "0.7329962", "0.7089373", "0.7025507", "0.6940935", "0.68912184", "0.68550694", "0.68550694", "0.6840716", "0.67814726", "0.6713542", "0.67110664", "0.6700969", "0.66927385", "0.6651558", "0.66408783", "0.6638398", "0.6638398", "0.6625952", "0.66215014", "0.65984...
0.77955574
0
Generate a new category ID
def _getNewCatId(self): newCatId = COCO_PLUS.CAT_ID COCO_PLUS.CAT_ID += 1 return newCatId
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _newClusterId(self):\n return self.guidGenerator.new_id()", "def real_id_to_cat_id(realId):\n real_id_to_cat_id = \\\n {1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10, 11: 11, 12: 13, 13: 14, 14: 15, 15: 16, 16: 17,\n 17: 18, 18: 19, 19: 20, 20: 21, 21: 22, 22: 23, 23: 24, 24: 25, ...
[ "0.6693016", "0.6681845", "0.65717316", "0.65496635", "0.6543297", "0.6543297", "0.64524007", "0.6437468", "0.6394915", "0.63929725", "0.63838845", "0.6360864", "0.63253576", "0.62233", "0.6212811", "0.6172452", "0.6160554", "0.6154551", "0.6152435", "0.61450166", "0.61440045...
0.7658862
0
Returns the COCO image name given its ID
def imId2name(self, im_id): if isinstance(im_id, int): name = str(im_id).zfill(self.STR_ID_LEN) + '.jpg' elif isinstance(im_id, str): name = im_id + '.jpg' else: raise AssertionError('Image ID should be of type string or int') return name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_image_name(resource_id):\n match_images = re.match(r\".*images/(?P<image_name>[^/]*).*\", resource_id, flags=re.IGNORECASE)\n if match_images:\n return match_images.group(\"image_name\")\n return \"\"", "def _get_file_name(id):\n client = Client(DRS_URL)\n c = client...
[ "0.6840367", "0.6643786", "0.663092", "0.66189015", "0.6465215", "0.6465215", "0.6464055", "0.6461122", "0.63849777", "0.63608104", "0.6317632", "0.62867707", "0.6235744", "0.6197257", "0.61809635", "0.612984", "0.612984", "0.611926", "0.6096056", "0.60827583", "0.60510045", ...
0.70803857
0
Calculate the C[i] value from C[i+1],C[i+2],...,C[N]
def c(self, i): value = self.b(i) if i == self.N: return value else: for j in range(i+1, self.N+1): value = value - self.a(i,j) * self.C[j] return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_C(n_c,CV_matrix):\n C = np.zeros((n_c, n_c), dtype=np.float32)\n for i in range(3):\n C += np.asfortranarray(CV_matrix[:, :, i]) @ np.asfortranarray(CV_matrix[:, :, np.mod(i + 2, 3)].T)\n C = (C != 0).astype(np.int32)\n return C", "def cci(self, n, array=False, length=None):\n \...
[ "0.64014524", "0.63143986", "0.62404186", "0.6111056", "0.6088625", "0.6073554", "0.6003859", "0.5931129", "0.5898788", "0.58349395", "0.5804786", "0.5801423", "0.57929486", "0.57643735", "0.5761099", "0.5740284", "0.57275575", "0.57182413", "0.56973004", "0.56951153", "0.569...
0.752309
0
Calculate c[i], which is used for 1st order FD, from C[i]
def first_order(self): for i in range(1,self.N+1): self.d1[i] = self.C[i] / 2 / i;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def c(self, i):\n value = self.b(i)\n if i == self.N:\n return value\n else:\n for j in range(i+1, self.N+1):\n value = value - self.a(i,j) * self.C[j]\n return value", "def all_c(self):\n for i in range( self.N, 0, -1):\n sel...
[ "0.72778773", "0.63311243", "0.6323468", "0.6262154", "0.6258611", "0.61931646", "0.6153507", "0.60605466", "0.60605466", "0.6052288", "0.6047745", "0.6019292", "0.60170346", "0.5987925", "0.5981969", "0.59601295", "0.59391695", "0.59115505", "0.589958", "0.587147", "0.586601...
0.69338113
1
Generate the markdown table row for this order FD
def markdown_row(self, ncol, which): if which == 'C': dat = self.C elif which == 'c': dat = self.d1 elif which == 'f': dat = self.d2 line = '|%d|' % (self.N*2) for i in range(1,self.N+1): line = line + ' $%s$ |' % (dat[i]) f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def markdown_table(self, which):\n if which == 'C':\n coef = 'C'\n elif which == 'c':\n coef = 'c'\n elif which == 'f':\n coef = 'f'\n str = '|order|'\n for i in range(1,N+1):\n str = str + '$%s_{%d}$ |' % (coef,i)\n str = str + ...
[ "0.7840066", "0.6804444", "0.65945756", "0.6555751", "0.6473779", "0.6452076", "0.63583446", "0.6314814", "0.6270614", "0.6237986", "0.62068284", "0.6193822", "0.6175285", "0.6144532", "0.6122008", "0.61010027", "0.6084487", "0.60803753", "0.6064474", "0.60275173", "0.5998165...
0.6929845
1
Initializes a new instance of the the Command class. The command represents an action which will be executed. The parameter for the command.
def __init__(self, command, target: str): self.command = command self.target = target
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, command: str):\n\n # Assign attributes\n self.command_str: str = command\n self.name: str = \"\"\n self.arg: str = \"\"\n\n # Parse the command\n self.parse_command()", "def __init__(__self__, *,\n command: Optional[pulumi.Input[Sequenc...
[ "0.7580862", "0.75477815", "0.7518953", "0.7212085", "0.712699", "0.7010265", "0.69374126", "0.68572783", "0.6823892", "0.6808481", "0.6808481", "0.6808481", "0.6760076", "0.6757676", "0.666215", "0.65876514", "0.65570796", "0.6537137", "0.6500984", "0.6493685", "0.6441337", ...
0.7729718
0
Create a new game and persist it in the database.
def create_game(sid): game = Game(created=datetime.now()) board = Board() game.game_json = json.dumps(board.__dict__, cls=BoardEncoder) game.save() print(game.game_json) sio.emit('create_game', {'data': serializers.serialize( 'json', [game], fields=('create...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_game(current_user, data):\n\n game = Game(user_id=current_user,\n last_saving=data,\n status=data[\"status\"],\n timing=data[\"timing\"],\n score=data[\"score\"])\n\n db.session.add(game)\n db.session.commit...
[ "0.7566039", "0.7236394", "0.70471895", "0.70348", "0.70287186", "0.69724137", "0.6923298", "0.6895995", "0.68535334", "0.6842099", "0.6764229", "0.6675601", "0.65492654", "0.65327615", "0.6529416", "0.65062493", "0.64768034", "0.6456401", "0.64514124", "0.64350545", "0.64280...
0.74116546
1