query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Plot the IntensityMap The map can be added to an existing plot via the optional 'axes' argument.
def plot(self, axes=None, cax=None, threshold=None, vmin=None, vmax=None, cmap=None, cbar=True, cbar_kw=None, **kwargs): if axes is None: fig, axes = pyplot.subplots(subplot_kw={'aspect': 'equal'}) ret = [axes] x, y = self.bset.mesh data = self.data if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plotmap(self):\n if self.plotfigure is None: return\n\n self.plotfigure.clf()\n collist = [\"#%.2x%.2x%.2x\" % (i, i, i) for i in self.currentshades]\n cmap = colors.ListedColormap(collist)\n if self.gs.isfixed:\n crange = [self.minvalue] + self.currentvalues\n ...
[ "0.6860264", "0.6706442", "0.668482", "0.6682866", "0.6575665", "0.6491484", "0.6397474", "0.6358751", "0.63359517", "0.63324696", "0.6310626", "0.630582", "0.6255097", "0.6189529", "0.61703634", "0.60358286", "0.6011832", "0.5996486", "0.5978214", "0.5964041", "0.5932409", ...
0.0
-1
Test the application returns a 404 response when a specified revision can't be found
def test_root_invalid_revision(self, mock_get_entity): mock_get_entity.side_effect = AzureMissingResourceHttpError("Not Found", 404) url = '/?{0}=InvalidRevsion'.format(TestConfig.REVISION_PARAMETER) response = self.client.get(url) self.assertEqual(response.status_code, 404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_not_found(self):\n\n url = '/%s/job-types/missing-job/1.0.0/revisions/' % self.api\n response = self.client.get(url)\n\n self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND, response.content)\n\n # correct job type, bad version\n url = '/%s/job-types/my-job/...
[ "0.75771", "0.7277234", "0.7255319", "0.7064287", "0.70296043", "0.70256335", "0.7020161", "0.6941548", "0.69213945", "0.6868765", "0.68522424", "0.6849341", "0.68322897", "0.68160665", "0.68155414", "0.6805836", "0.6802857", "0.6791672", "0.6764223", "0.67638695", "0.6759667...
0.7264969
2
This makes the turret begin to shoot
def start_shoot(self): shooter_state = String() shooter_state.data = "shoot" self.ros_node.publish("/auto/shooter/state", String, shooter_state, latching = True) rospy.loginfo("Shooter Shooting")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shoot(self):\n if self.direction == 'left':\n self.__temp_bullet = Bullet(self.position, 60)\n elif self.direction == 'forward':\n self.__temp_bullet = Bullet(self.position, 90)\n else:\n self.__temp_bullet = Bullet(self.position, 120)\n global game\...
[ "0.7779523", "0.7368272", "0.72595525", "0.7167215", "0.7163265", "0.71510243", "0.71452653", "0.6957997", "0.69392145", "0.68043154", "0.6797206", "0.67571425", "0.6701134", "0.66935265", "0.65481937", "0.6500017", "0.64967924", "0.63268954", "0.6314482", "0.629769", "0.6278...
0.5985127
38
Validate that the extractrestore loop loses no data.
def validate_accumulator_extract_and_restore(self, combiner, data, expected): acc = combiner.compute(data) extracted_data = combiner.extract(acc) restored_acc = combiner.restore(extracted_data) self.assert_accumulator_equal(combiner, acc, restored_acc) self.assertAllClose(expected, combiner.extract(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_Data(self):\r\n \r\n if self._target_data is None:\r\n self.processData()", "def _check_for_incomplete_input(self):\n pass", "def _verify(self) -> None:\n # Check if the extracted files already exist\n pathname = os.path.join(self.root, self.data_dir)\n ...
[ "0.57524776", "0.57312435", "0.5675237", "0.5644865", "0.5637921", "0.55559564", "0.55380225", "0.55331373", "0.5449347", "0.5424725", "0.53747845", "0.5346498", "0.5330966", "0.532273", "0.53173107", "0.53160214", "0.5308409", "0.5302611", "0.5300618", "0.52918345", "0.52896...
0.5040686
86
Set rotation and translation parameters from a transformation matrix
def set_trans(self, head_mri_trans): x, y, z = -self.mri_origin[0] mri_tgt_trans = translation(x, y, z) head_tgt_trans = np.dot(mri_tgt_trans, head_mri_trans) x, y, z = self.hsp.nasion[0] src_hsp_trans = translation(x, y, z) src_tgt_trans = np.dot(head_tgt_trans, src_hsp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transformation_from_parameters(axisangle, translation, invert=False):\r\n R = rot_from_axisangle(axisangle)\r\n t = translation.clone()\r\n\r\n if invert:\r\n R = R.transpose(1, 2)\r\n t *= -1\r\n\r\n T = get_translation_matrix(t)\r\n\r\n if invert:\r\n M = torch.matmul(R, T...
[ "0.6756455", "0.65524673", "0.6445188", "0.64300823", "0.63128793", "0.6257994", "0.6243279", "0.62405354", "0.6192055", "0.61659086", "0.6165266", "0.61559033", "0.61344993", "0.61150014", "0.61150014", "0.6097609", "0.60747916", "0.606979", "0.6063725", "0.60310113", "0.600...
0.6635407
1
View should return 404 response if no object is found.
def test_bad_pk(self): self.url_kwargs[self.pk_url_kwarg] = 1234 response = self._get() self.assertEquals(response.status_code, 404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view(obj, request):\n return HTTPNotFound()", "def handle_nonexistence(view):\n\n def decorated_view(*args, **kwargs):\n try:\n result = view(*args, **kwargs)\n except ObjectDoesNotExist:\n return HttpResponse(\"Object not found\", status=404)\n return result\...
[ "0.86230326", "0.76483583", "0.74446285", "0.71561456", "0.7116876", "0.71098393", "0.70688987", "0.7066008", "0.7064818", "0.7045135", "0.6996424", "0.6972151", "0.69156444", "0.688914", "0.6845825", "0.6837346", "0.68328214", "0.6825511", "0.68066657", "0.67945385", "0.6791...
0.0
-1
View should return 404 response if no object is found.
def test_bad_pk(self): self.url_kwargs[self.pk_url_kwarg] = 1234 response = self._get() self.assertEquals(response.status_code, 404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view(obj, request):\n return HTTPNotFound()", "def handle_nonexistence(view):\n\n def decorated_view(*args, **kwargs):\n try:\n result = view(*args, **kwargs)\n except ObjectDoesNotExist:\n return HttpResponse(\"Object not found\", status=404)\n return result\...
[ "0.8623268", "0.764923", "0.74462", "0.71580064", "0.7119352", "0.7112773", "0.70699596", "0.7067581", "0.7065144", "0.7045855", "0.6996909", "0.6974396", "0.6917682", "0.6890072", "0.68463635", "0.68397504", "0.6835098", "0.6827439", "0.6809106", "0.67971724", "0.6793611", ...
0.0
-1
Page should render if there is one object & no search query.
def test_list_one(self): obj = self.factory.create() response = self._get() self.assertEquals(response.status_code, 200) self.assertTemplateUsed(response, self.template_name) self.assertEquals(response.context['object_list'].count(), 1) self.assertEquals(response.context[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_no_results(self):\n self.factory.create()\n response = self._get(get_kwargs={'search': 'hello'})\n self.assertEquals(response.status_code, 200)\n self.assertTemplateUsed(response, self.template_name)\n self.assertEquals(response.context['object_list'].count(), 0)", "de...
[ "0.6646892", "0.63554424", "0.63554424", "0.6242261", "0.6149068", "0.6125837", "0.6002217", "0.5985349", "0.59651166", "0.5915592", "0.58843505", "0.5875167", "0.5840554", "0.58240545", "0.58197546", "0.5805388", "0.57943326", "0.5784792", "0.575276", "0.57419497", "0.573078...
0.0
-1
View should return 404 response if no object is found.
def test_bad_pk(self): self.url_kwargs[self.pk_url_kwarg] = 1234 response = self._get() self.assertEquals(response.status_code, 404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view(obj, request):\n return HTTPNotFound()", "def handle_nonexistence(view):\n\n def decorated_view(*args, **kwargs):\n try:\n result = view(*args, **kwargs)\n except ObjectDoesNotExist:\n return HttpResponse(\"Object not found\", status=404)\n return result\...
[ "0.86235255", "0.7648853", "0.7446212", "0.7157503", "0.7118698", "0.7111731", "0.70701605", "0.70677304", "0.70653", "0.7046521", "0.6997766", "0.69735444", "0.6917432", "0.68904823", "0.6844793", "0.6838582", "0.6834556", "0.6827052", "0.6808378", "0.6796558", "0.6793543", ...
0.0
-1
Prepares the attention layer for our network
def new_parameter(*size): out = torch.nn.Parameter(torch.FloatTensor(*size).to(DEVICE)) torch.nn.init.xavier_normal_(out) return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_layers(self) -> None:\n self.self_attn = MultiheadAttention(**self.self_attn_cfg)\n self.embed_dims = self.self_attn.embed_dims\n self.ffn = FFN(**self.ffn_cfg)\n norms_list = [\n build_norm_layer(self.norm_cfg, self.embed_dims)[1]\n for _ in range(2)\n ...
[ "0.6619964", "0.65779936", "0.63610286", "0.6308447", "0.6186195", "0.6174245", "0.61636806", "0.6148588", "0.6104589", "0.6091636", "0.602437", "0.6012171", "0.59882814", "0.59780896", "0.5964104", "0.59286845", "0.5921171", "0.5917021", "0.5907551", "0.58933467", "0.5890185...
0.0
-1
Gets the list of allowed actions
def actions(self): r = self.session.query(models.Action).all() return [x.type_name for x in r]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_actions(self) -> List[str]:\n return list(self.action_map().keys())", "def get_list_of_actions(self):\n return self.actions", "def get_actions(self):\n return []", "def get_available_actions(self):\n return self.actions", "def all_allowed_actions(self):\n action...
[ "0.8164956", "0.8107749", "0.7967806", "0.7962076", "0.7793421", "0.76986516", "0.76783717", "0.7636347", "0.7514199", "0.74995595", "0.74805915", "0.73549515", "0.73172736", "0.72986996", "0.7245935", "0.72394836", "0.7234773", "0.7174135", "0.7165897", "0.7160841", "0.71262...
0.64314216
95
Search for target between lo and hi in a sorted list li.
def binary_search(li, target, lo=0, hi=None): hi = hi if hi is not None else len(li) pos = bisect_left(li, target, lo, hi) return pos if pos != len(li) and li[pos] == target else -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find(self, candidates, target, lb, rb):\n # we'v made sure there's no duplicate in candidates\n li, ri = lb, rb\n while li < ri:\n mi = (li + ri) // 2\n if candidates[mi] < target:\n li = mi + 1\n elif candidates[mi] > target:\n ...
[ "0.6937605", "0.6932119", "0.68768805", "0.6828407", "0.676444", "0.67444134", "0.6727017", "0.67002356", "0.66712576", "0.6663014", "0.6584818", "0.65714777", "0.6548986", "0.6513525", "0.6487812", "0.64640903", "0.64604414", "0.645695", "0.6448316", "0.6409059", "0.6388027"...
0.76017535
0
Converts 'value' to a google.protobuf.Value. We use ListValue conversion logic to do this to avoid depending on Value's internal structure.
def _to_google_protobuf_value(value): lv = struct_pb2.ListValue() lv.append(value) return lv.values[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_value_from_value_pb(value_pb):\n value_type = value_pb.WhichOneof('value_type')\n\n if value_type == 'timestamp_value':\n result = pb_timestamp_to_datetime(value_pb.timestamp_value)\n\n elif value_type == 'key_value':\n result = CustomIterator.key_from_protobuf(v...
[ "0.7213156", "0.7159158", "0.66380125", "0.6410671", "0.64052916", "0.63978046", "0.6347174", "0.62590045", "0.62590045", "0.6243408", "0.6243408", "0.6126837", "0.6106123", "0.6104261", "0.60811603", "0.60811603", "0.60811603", "0.60811603", "0.6059819", "0.6049606", "0.6004...
0.8227327
0
Opens a new database connection if there is none yet for the current application context.
def get_db(): top = flask._app_ctx_stack.top if not hasattr(top, 'shelve'): top.shelve = MODEL return top.shelve
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_open():\n if not hasattr(g, 'sqlite_db'):\n g.sqlite_db = db_connect()\n return g.sqlite_db", "def open_database(self):\n if self._conn is None:\n self._conn = sqlite3.connect(self._db_path)", "def open_db(db_name: str = DB_NAME) -> DBConnection:\n return sqlite3.connec...
[ "0.773897", "0.75835025", "0.7318477", "0.7169243", "0.70229524", "0.69677585", "0.6955773", "0.6949434", "0.6898107", "0.6842816", "0.68302435", "0.68196636", "0.6806231", "0.6795786", "0.676963", "0.67621964", "0.67503923", "0.674726", "0.67316467", "0.67005205", "0.6689189...
0.0
-1
Enable or disable suspend out, which will emit a signal when FT4222H enters suspend mode. Please note that the suspendout pin is not available under mode 2. By default, suspendout function is on. GPIO2 will be used as an GPIO in output mode for emitting a suspendout signal. When suspendout function is on, suspendout pi...
def set_suspend_out(ft_handle: FtHandle, enable: bool) -> None: result: Ft4222Status = _set_suspend_out(ft_handle, enable) if result != Ft4222Status.OK: raise Ft4222Exception(result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sleep_mode(self, value):\n if value:\n self._write(ST7789_SLPIN)\n else:\n self._write(ST7789_SLPOUT)", "def SetSuspend(self, val):\n self.suspended = val\n if self.suspended:\n self.Disconnect()", "def power_off(self):\n return self.inst....
[ "0.5875589", "0.57855755", "0.5589397", "0.5572492", "0.5524935", "0.5520485", "0.54559934", "0.5418055", "0.5382699", "0.53421694", "0.5304207", "0.5277523", "0.525148", "0.52467483", "0.5242475", "0.5234556", "0.52126086", "0.52112925", "0.5169652", "0.5117454", "0.5073892"...
0.675801
0
this func is in charge of setting the rep string for Formula into opt's with length of 1, in order to stay within LL0 borders
def replace_string(s): ret = s ret = ret.replace('<->', 'ב') ret = ret.replace('->', 'א') ret = ret.replace('-&', 'ג') ret = ret.replace('-|', 'ד') ret = ret.replace('?:', 'ה') return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_formula(self):\n label_formula = re.sub(\"([0-9])\", \"_\\\\1\", self.formula)\n label_formula = '$\\mathregular{'+label_formula+'}$'\n return label_formula", "def __str__(self):\n return \"{} MS REPLICATE\\nCell Lines: {}\\nSize: {}\\nIntersection Size: {}\\n\".format(self...
[ "0.58829063", "0.55989593", "0.5471829", "0.54645056", "0.5408118", "0.5326845", "0.5305463", "0.5266931", "0.5261831", "0.52524054", "0.5245425", "0.52313167", "0.52234393", "0.52228296", "0.52031106", "0.5195678", "0.51856685", "0.5180725", "0.5177656", "0.5165291", "0.5145...
0.0
-1
Return the usual (functional) representation of self
def __repr__(self): if is_constant(self.root) or is_variable(self.root): return (self.root) else: return_string = self.root + "(" for index, arg in enumerate(self.arguments): return_string += str(arg) if index != len(self.arguments)-1: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n # type: () -> str\n return self.to_str()", "def __repr__(self):\n # type: () -> str\n return self.to_str()", "def __repr__(self):\n # type: () -> str\n return self.to_str()", "def __repr__(self):\n return u\"(\" + str(self) + \", \" + str...
[ "0.7144266", "0.7144266", "0.7144266", "0.7041659", "0.697144", "0.6969626", "0.69671744", "0.69671744", "0.69671744", "0.69671744", "0.69671744", "0.69671744", "0.69671744", "0.69671744", "0.69671744", "0.69671744", "0.69671744", "0.69671744", "0.69671744", "0.69671744", "0....
0.0
-1
Return the set of variables that are free in this formula
def free_variables(self): free_vars = set() self.free_variables_helper(free_vars) return free_vars # Task 7.6
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def free_variables(formula):\n visitor = CollectFreeVariables()\n visitor.visit(formula)\n return [x.expr for x in visitor.free_variables] # Unpack the symrefs", "def free_symbols(self):\n return ({j for i in self.args for j in i.free_symbols\n .difference(self.variables)})", ...
[ "0.79985493", "0.712965", "0.6920318", "0.68654644", "0.6796395", "0.675601", "0.675601", "0.66421556", "0.66022617", "0.64625907", "0.64373547", "0.64188856", "0.6406176", "0.63908845", "0.63695675", "0.6336118", "0.63307977", "0.62488854", "0.61924237", "0.61890286", "0.617...
0.8120196
0
Sets the stat_id of this DestinyHistoricalStatsDefinition.
def stat_id(self, stat_id): self._stat_id = stat_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stat_name(self, stat_name):\n\n self._stat_name = stat_name", "def set_stats(self, stats):\n self._stats = stats", "def setStats(self, stats):\n self.stats = stats", "def trace_id(self, trace_id):\n\n self._trace_id = trace_id", "def trace_id(self, trace_id):\n\n self...
[ "0.58132416", "0.54855657", "0.5375789", "0.53603", "0.53603", "0.51470125", "0.5145491", "0.5092065", "0.5072073", "0.5015533", "0.5012003", "0.50025976", "0.4994071", "0.49588034", "0.49301073", "0.49156588", "0.48761225", "0.48761225", "0.4872542", "0.4818735", "0.4749458"...
0.77528495
0
Sets the group of this DestinyHistoricalStatsDefinition.
def group(self, group): self._group = group
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_group(self, group):\n self._group = group", "def group(self, group):\n self._group = group", "def set_group(self, group: str) -> None:\n self.group = group", "def setGroup(self, group):\n\t\tself.config.GROUP = group", "def with_group(self, group):\n\t\tself.variables['group'] ...
[ "0.639452", "0.62527066", "0.6240001", "0.61302793", "0.6006131", "0.5778126", "0.5751395", "0.56765264", "0.55625665", "0.5556985", "0.5400078", "0.532582", "0.52879655", "0.5260377", "0.52378106", "0.52297586", "0.5205495", "0.51999694", "0.5192465", "0.5172555", "0.5172555...
0.62190473
3
Sets the period_types of this DestinyHistoricalStatsDefinition.
def period_types(self, period_types): self._period_types = period_types
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def period(self, period):\n\n self._period = period", "def period(self, period):\n\n self._period = period", "def __set_period(self, period):\n if not isinstance(period, int):\n raise TypeError('The period should be an integer')\n if period <= 0:\n raise ValueE...
[ "0.51493585", "0.51493585", "0.5117861", "0.5078276", "0.50211734", "0.48611602", "0.48159927", "0.47899115", "0.47868782", "0.4699046", "0.4610526", "0.4559982", "0.45542938", "0.45542938", "0.45484766", "0.4528799", "0.4517698", "0.4515411", "0.44483182", "0.44438258", "0.4...
0.77296525
0
Sets the category of this DestinyHistoricalStatsDefinition.
def category(self, category): self._category = category
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def category(self, category: str):\n\n self._category = category", "def set_category(self, category):\n\n\t\tif category is not None and not isinstance(category, str):\n\t\t\traise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: category EXPECTED TYPE: str', None, None)\n\t\t\n\t\tself.__category = category...
[ "0.5621086", "0.54953796", "0.53427476", "0.5338209", "0.5296233", "0.50186867", "0.5016412", "0.5002404", "0.49826232", "0.4959348", "0.48421168", "0.48379976", "0.4805474", "0.46491575", "0.46155733", "0.45819542", "0.4565698", "0.45542693", "0.45388743", "0.45013586", "0.4...
0.55903983
2
Sets the stat_name of this DestinyHistoricalStatsDefinition.
def stat_name(self, stat_name): self._stat_name = stat_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_stats_name(self, stats_name):\n\n if self.stats_name == stats_name:\n return\n\n if stats_name in scales._Stats.stats:\n raise ValueError('\"{0}\" already exists in stats.'.format(stats_name))\n\n stats = scales._Stats.stats[self.stats_name]\n del scales._S...
[ "0.6844914", "0.68169725", "0.6174901", "0.60261416", "0.59878486", "0.54603034", "0.54603034", "0.543228", "0.5419434", "0.53844553", "0.53680927", "0.5335317", "0.53309935", "0.5315403", "0.5298371", "0.5292849", "0.5292849", "0.5291848", "0.52903396", "0.52802217", "0.5280...
0.7932595
0
Sets the stat_name_abbr of this DestinyHistoricalStatsDefinition.
def stat_name_abbr(self, stat_name_abbr): self._stat_name_abbr = stat_name_abbr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stat_name(self, stat_name):\n\n self._stat_name = stat_name", "def set_abbr(self, value):\n self._set_one_attribute(self.AttributeNames.ABBR, value)\n return self", "def audit_abbr(over_abbreviated, street_name):\n m = over_abbr_re.search(street_name)\n if m:\n abbr = m.gr...
[ "0.65715915", "0.60351557", "0.5704444", "0.5637139", "0.5410011", "0.5410011", "0.5228645", "0.5197811", "0.50589675", "0.49892625", "0.49743652", "0.49338886", "0.49239352", "0.48968428", "0.48927924", "0.48696586", "0.48238206", "0.48118418", "0.47966406", "0.47791344", "0...
0.878947
0
Sets the stat_description of this DestinyHistoricalStatsDefinition.
def stat_description(self, stat_description): self._stat_description = stat_description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_sdesc(self, sdesc: str):\n self._sdesc = sdesc", "def stat_name(self, stat_name):\n\n self._stat_name = stat_name", "def stat_id(self, stat_id):\n\n self._stat_id = stat_id", "def setStats(self, stats):\n self.stats = stats", "def set_video_statistics(self, video_stats):...
[ "0.56697464", "0.56536883", "0.55435383", "0.5484635", "0.54315394", "0.53779", "0.5200567", "0.5197987", "0.5197987", "0.512456", "0.51187956", "0.5108407", "0.5029806", "0.50041234", "0.49957836", "0.49945658", "0.49945658", "0.49945658", "0.49945658", "0.49945658", "0.4994...
0.79550785
0
Sets the merge_method of this DestinyHistoricalStatsDefinition.
def merge_method(self, merge_method): allowed_values = [0, 1, 2] # noqa: E501 if merge_method not in allowed_values: raise ValueError( "Invalid value for `merge_method` ({0}), must be one of {1}" # noqa: E501 .format(merge_method, allowed_values) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, merge_method, **kwargs):\n self.full_name, self.abbreviation = merge_method, merge_method\n self.merge_method = merge_method\n # Attributes for CONCAT method\n self._axis = kwargs.get('axis', -1)\n # Attributes for `CONCAT-SUM` method\n self._sum_indices = kwargs.get('sum_indic...
[ "0.5439018", "0.5303885", "0.5206038", "0.48770493", "0.48416555", "0.4708777", "0.4707771", "0.47015494", "0.46497875", "0.4649715", "0.4644707", "0.4636879", "0.46231154", "0.4560552", "0.45231172", "0.4460385", "0.44425914", "0.44415563", "0.44089893", "0.43732315", "0.435...
0.7434018
0
Sets the weight of this DestinyHistoricalStatsDefinition.
def weight(self, weight): self._weight = weight
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setWeight(self, w):\n self._W = w", "def set_weights(self, wts):\n\t\tself.wts = wts", "def set_weight(self, weight):\n self.weight = weight # overwrite the existing weight with the input weight value", "def setWeights(self, w):\n raise NotImplementedError", "def set_weights(self,...
[ "0.6877454", "0.67978007", "0.6666213", "0.6493848", "0.6340171", "0.6319404", "0.6271166", "0.6254891", "0.6153945", "0.61313456", "0.5990319", "0.5957149", "0.5917131", "0.5917131", "0.5917131", "0.59111446", "0.59111446", "0.59111446", "0.58855885", "0.5880125", "0.5861949...
0.6614206
4
Sets the medal_tier_hash of this DestinyHistoricalStatsDefinition.
def medal_tier_hash(self, medal_tier_hash): self._medal_tier_hash = medal_tier_hash
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tier(self, tier):\n\n self._tier = tier", "def extended_hash(self, extended_hash):\n\n self._extended_hash = extended_hash", "def tier_explanation(self, tier_explanation):\n\n self._tier_explanation = tier_explanation", "def director_activity_hash(self, director_activity_hash):\n\n ...
[ "0.51494837", "0.50470644", "0.5023862", "0.4840965", "0.47420165", "0.46815628", "0.46716106", "0.46716106", "0.4616489", "0.45992437", "0.4542015", "0.4507624", "0.44665325", "0.44645223", "0.4462169", "0.44614458", "0.44556713", "0.44163942", "0.4398131", "0.43955302", "0....
0.79750943
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, DestinyHistoricalStatsDefinition): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Fetch the next message and construct return a Chat object.
def _next_message(self): msg = yield self._read_message() message = self._slack_to_chat(msg) raise gen.Return(message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_next_message(self):\n newest_available_offset = self.broker.get_last_offset(self.topic_name)\n if self.offset <= newest_available_offset:\n msg = self.broker.read_message(self.topic_name, self.offset)\n self.offset += 1\n return msg", "def next(self):\n ...
[ "0.69967765", "0.67948204", "0.6528175", "0.6307632", "0.6203799", "0.6055931", "0.6054992", "0.5964525", "0.5773179", "0.57673043", "0.5750888", "0.5743721", "0.5740828", "0.5708121", "0.5668122", "0.5651917", "0.56237125", "0.56225044", "0.5597019", "0.5548614", "0.5511918"...
0.73920566
0
returns True if player is not fold
def notFold(self): return not self._fold
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fold(self):\n self.active = False\n self.hand = None\n self.bet = 0\n return True", "def isGameOver(self):\n for i in range(self.rows):\n for j in range(self.columns):\n if self.grid[i][j].face == 'down':\n return False\n ...
[ "0.7115066", "0.6812277", "0.6808746", "0.67171854", "0.66055876", "0.655105", "0.6529719", "0.65183", "0.6488825", "0.64867336", "0.6451427", "0.64366883", "0.64034545", "0.6399862", "0.6321155", "0.6303043", "0.6246769", "0.6235676", "0.6222943", "0.6211001", "0.6205996", ...
0.70899224
1
returns a list with player informations for all players
def _get_player_info(self): return [player._player_info() for player in self.players.values()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_players(self):\r\n return self.players.values()", "def _player_list(self):\n game = self.ctrl.game\n return game.players[self.i_to_player_id(0)], game.players[self.i_to_player_id(1)]", "def get_all_players(self):\n\n self._logger.debug(\"Getting player list\")\n\n try...
[ "0.79230434", "0.78984207", "0.7712032", "0.7584438", "0.7568995", "0.7457675", "0.7451062", "0.7376945", "0.73686343", "0.7322816", "0.73092777", "0.7284814", "0.7270592", "0.7266507", "0.7263653", "0.7263112", "0.72534734", "0.724697", "0.7236359", "0.7219922", "0.7215157",...
0.815604
0
Test default product price being 10.
def test_default_product_price(self): prod = Product('Test Product') self.assertEqual(prod.price, 10)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_default_product_price(self):\r\n prod = Product('Test Product')\r\n self.assertEqual(prod.price, 10)", "def test_default_product_price(self):\n prod = product('Test Product')\n self.assertEqual(prod.price, 10)\n self.assertEqual(prod.weight, 20)", "def test_default_p...
[ "0.87333673", "0.8610413", "0.8580199", "0.7287374", "0.72686666", "0.72686666", "0.72686666", "0.72686666", "0.72686666", "0.72686666", "0.7263497", "0.717852", "0.6858057", "0.6813622", "0.67408824", "0.67408824", "0.6709257", "0.6688696", "0.66599596", "0.6654696", "0.6654...
0.8738257
5
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, GenerateReportInfo): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.808826", "0.808826", "0.8054592", "0.79827315", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Asks user to specify a city, month, and day to analyze.
def get_filters(): print('.'*40) print('Hello! Let\'s explore some US bikeshare data!\n') # user input for city (chicago, new york city, washington) while True: city = input( '\nWhich city\'s data will you like to explore? Chicago, New York City, or Washington?\n').lower() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Raw_Data(city,month,day):\n print(\"The city you have entered is: \",city)\n print(\"The month you have entered is: \",month)\n print(\"The day you have entered is: \",day)", "def get_filters():\n city = None\n month = None\n day = None\n while day == None:\n # TO DO: get user input f...
[ "0.6671997", "0.6536215", "0.646006", "0.6373503", "0.634963", "0.6310927", "0.62878346", "0.6260315", "0.6230766", "0.6212286", "0.62057954", "0.61819345", "0.6171279", "0.617014", "0.6159775", "0.6159162", "0.6154152", "0.6145805", "0.61331624", "0.6105786", "0.6103557", ...
0.0
-1
Loads data for the specified city and filters by month and day if applicable.
def load_data(city, month, day): # load data file into a dataframe df = pd.read_csv(CITY_DATA[city]) df['City'] = city.title() # convert the Start Time column to datetime df['Start Time'] = pd.to_datetime(df['Start Time']) # extract month and day of week from Start Time to create new columns ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(city, month, day):\n df = pd.read_csv(CITY_DATA [city])\n \n # convert the Start Time column to datetime\n df['Start Time'] = pd.to_datetime(df['Start Time'])\n \n # extract month and day of week from Start Time to create new columns\n df['month'] = df['Start Time'].dt.month\n ...
[ "0.8132439", "0.81092066", "0.80460113", "0.80428666", "0.80092704", "0.80078983", "0.79997176", "0.7999047", "0.7989329", "0.7979842", "0.7973761", "0.79617316", "0.7956702", "0.79477483", "0.7946521", "0.7908704", "0.7908281", "0.79049814", "0.7901444", "0.7893375", "0.7889...
0.77307016
57
Displays statistics on the most frequent times of travel.
def time_stats(df): print('\nCalculating The Most Frequent Times of Travel...\n') start_time = time.time() # the most common month if np.count_nonzero(df['month'].unique()) > 1: most_traveled_month = df['month'].mode()[0] print('The month with the most trips is', most_traveled_month) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_stats(df):\n\n print('\\nDisplaying the statistics on the most frequent times of '\n 'travel...\\n')\n start_time = time.time()\n\n # display the most common month\n most_common_month = df['Month'].mode()[0]\n print('For the selected filter, the month with the most travels is: ' +\...
[ "0.8023676", "0.8022362", "0.79149705", "0.7825905", "0.78213924", "0.7813664", "0.7765152", "0.77395964", "0.7735777", "0.7733763", "0.76860064", "0.7668081", "0.7651128", "0.7644099", "0.7639373", "0.7636164", "0.7624668", "0.7622597", "0.76122236", "0.7599646", "0.75829977...
0.0
-1
Displays statistics on the most popular stations and trip.
def station_stats(df): print('\nCalculating The Most Popular Stations and Trip...\n') start_time = time.time() # most commonly used start station most_start_station = df['Start Station'].mode()[0] print('Most trips start at {} Station'.format(most_start_station)) # display most commonly used ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def station_stats(df):\n\n print('\\nCalculating The Most Popular Stations and Trip...\\n')\n start_time = time.time()\n\n # display most commonly used start station\n print(popular_start_station(df))\n\n # display most commonly used end station\n print(popular_end_station(df))\n\n # display m...
[ "0.7815675", "0.7662213", "0.7553417", "0.74914914", "0.74748665", "0.7446617", "0.7428588", "0.74237514", "0.74177027", "0.7400495", "0.7387161", "0.7385634", "0.73647535", "0.73566747", "0.73548365", "0.7351854", "0.7351274", "0.735057", "0.73421645", "0.7340198", "0.733738...
0.735934
13
Displays statistics on the total and average trip duration.
def trip_duration_stats(df): print('\nCalculating Trip Duration...\n') start_time = time.time() # display total travel time total_travel_time = ((df['Trip Duration'].sum())/60).round(1) print('The total travel time is {:,} minutes, which is approximately {:,} hours'.format( total_travel_ti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trip_duration_stats(data):\n print('\\nCalculating Trip Duration...\\n')\n start_time = time.time()\n # display total travel time\n total_trip_time= data['Trip Duration'].sum()\n print('The Total Travel Time is {} Hours'. format(total_trip_time/3600))\n # display mean travel time\n avg_tri...
[ "0.8143788", "0.8025597", "0.8004826", "0.7950089", "0.7937902", "0.79316837", "0.7927231", "0.7915687", "0.7914976", "0.79086065", "0.79061425", "0.79011726", "0.7892046", "0.7890013", "0.7887204", "0.7885618", "0.7884607", "0.78830457", "0.7874646", "0.78690827", "0.7866999...
0.78350616
36
Set the logger to log info in terminal and file `log_path`. In general, it is useful to have a logger so that every output to the terminal is saved in a permanent file. Here we save it to `model_dir/train.log`.
def set_logger(log_path): logger = logging.getLogger() logger.setLevel(logging.INFO) if not logger.handlers: # Logging to a file file_handler = logging.FileHandler(log_path) file_handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s: %(message)s')) logger...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_log_dir(self, model_path=None):\n # Set date and epoch counter as if starting a new model\n self.epoch = 0\n now = datetime.datetime.now()\n\n # If we have a model path with date and epochs use them\n if model_path:\n # Continue from we left of. Get epoch and d...
[ "0.71066064", "0.69991827", "0.69528496", "0.6781568", "0.6651227", "0.66434616", "0.66361105", "0.6459926", "0.63375634", "0.632943", "0.6299785", "0.62892693", "0.6270558", "0.62299055", "0.62065256", "0.62006307", "0.61857957", "0.6149785", "0.61172694", "0.6080346", "0.60...
0.61983967
16
Displays a box container around content, with an optional class name.
def box(context, nodelist, classname=None): return render_to_string('deco/box.html', { 'classname': classname or "", 'content': nodelist.render(context) })
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def box(self) -> None:\n self.screen.box()", "def componentBox(*args, annotation: Union[AnyStr, bool]=\"\", backgroundColor: Union[List[float,\n float, float], bool]=None, defineTemplate: AnyStr=\"\", docTag: Union[AnyStr,\n bool]=\"\", dragCallback: Script=None, dropCallba...
[ "0.5563728", "0.55115235", "0.54921156", "0.5327208", "0.53082716", "0.527142", "0.52662903", "0.52440953", "0.5230245", "0.52188027", "0.5181289", "0.5176844", "0.51695746", "0.51617134", "0.51578665", "0.51326394", "0.5097014", "0.50860816", "0.5084642", "0.5083773", "0.506...
0.72953516
0
Generates a sequence of tokens from the markov chain, starting from initial_state. If initial state is empty, and pad is false it chooses an initial state at random. If pad is true,
def generate_sequence(self, n=100, initial_state=None): if initial_state is None: if self.pad: sequence = [START_OF_SEQ] * self.order else: sequence = list(random.choice(self.records.keys())) else: sequence = initial_state[:] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_sample(seed_phrase=\" \",max_length=MAX_LENGTH): \n x_sequence = [token_to_id[token] for token in seed_phrase]\n s.run(tf.assign(h_t,h_t.initial_value))\n \n # Feed the seed phrase, if any.\n for ix in x_sequence[:-1]:\n s.run(tf.assign(h_t,next_h),{x_t:[ix]})\n \n # Gener...
[ "0.5512073", "0.54191947", "0.54162246", "0.5319297", "0.5231597", "0.5226616", "0.52212644", "0.52005845", "0.5175979", "0.5145019", "0.51227385", "0.5078889", "0.5078161", "0.5067775", "0.50671834", "0.50234073", "0.5017862", "0.5015463", "0.50131124", "0.4998205", "0.49982...
0.5212059
7
Returns an empty multidimensional list whose first column is array with row index.
def CreateEmptyList(maxVal, nDim): return [[[np.array([i], dtype = "uint32")] if j == 0 else [[]] for j in range(nDim)] for i in range(maxVal + 1)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def array (self, length, width):\n\t\treturn [[0 for i in range(width)] for j in range(length)] #List comprehensions (Works like two for loops)", "def rows(self):\n out = []\n for row in self.a:\n new = self.new(1, len(row), fake=False)\n new.a[0] = row\n out.append...
[ "0.64652634", "0.6437996", "0.63558966", "0.6279318", "0.6203485", "0.60722756", "0.60574013", "0.60574013", "0.6046045", "0.6042727", "0.60266954", "0.60151887", "0.59529334", "0.59394574", "0.59359515", "0.5874254", "0.58543247", "0.5852962", "0.58494914", "0.58357024", "0....
0.68565947
0
Return device specific state attributes.
def device_state_attributes(self): # Move these to Thermostat Device and make them global return { "current_humidity": self._current_humidity, "status": self._current_state, "program": self._current_program, "away_mode": self._away }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_state_attributes(self):\r\n return self.attributes", "def device_state_attributes(self):\n return self.attr", "def device_state_attributes(self):\n return self.attr", "def device_state_attributes(self): # Can be remove from 0.99\n return self._attr", "def device_stat...
[ "0.87326586", "0.87130606", "0.87130606", "0.8661474", "0.86244243", "0.86244243", "0.86156", "0.8589153", "0.85687816", "0.85626554", "0.85169643", "0.84891194", "0.84891194", "0.84891194", "0.84891194", "0.84891194", "0.84891194", "0.84891194", "0.84891194", "0.84891194", "...
0.8135956
44
Return the name of the climate device.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self.device.name()", "def name(self):\n return f\"{get_device_name(self._data, 0, self._name)}\"", "def name(self):\n return self._device.name", "def name(self):\n return self._device.name", "def name(self):\n return self._device.name", "def nam...
[ "0.73749846", "0.7320608", "0.7287729", "0.7287729", "0.7287729", "0.72592664", "0.7224597", "0.7211017", "0.71846616", "0.71846616", "0.71691746", "0.71691746", "0.71321905", "0.7123743", "0.7113181", "0.70849967", "0.7015856", "0.69676185", "0.69589245", "0.6932036", "0.692...
0.0
-1
Adds a new comment to the database. Optionally, it may replace the comment instead.
def comment_add(request,comment=None, error='', message=''): categories = Category.objects.all() error_fields=[] default_comment = Comment(date=datetime.date.today(), time=datetime.datetime.now().time, source='', detail='', category=Category.objects.filter(description='Events')[0], user_email='') try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_comment(self, comment: str):\n self.add_relationship(\n RDFS.comment, self._graph.string_literal(comment))", "def add_comment(self, comment: str):\n self.add_relationship(RDFS.comment, self._graph.string_literal(comment))", "def add_comment(self, comment):\n assert isins...
[ "0.7443766", "0.7389064", "0.73520213", "0.73461545", "0.72174513", "0.70027", "0.6984918", "0.6941035", "0.68435735", "0.6793739", "0.6754713", "0.67484134", "0.6746418", "0.67294735", "0.67280585", "0.67280585", "0.669175", "0.66420025", "0.66304046", "0.66304046", "0.66297...
0.0
-1
Retrieve value of an environment variable.
def get_var(self, p_varnm): retval = tuple() (rc, rslt) = self.run_cmd("echo $" + p_varnm) if rc: retval = (p_varnm, rslt.decode('UTF-8')[0:-1]) else: retval = (p_varnm, '') return retval
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetEnvVariable(name):\n return os.environ.get(name)", "def windows_get_env_value(var_name: str) -> str:\n if var_name in os.environ.keys():\n return os.environ[var_name]", "def getenv(self, var):\n return os.environ[var]", "def _get_env(key: str) -> str:\n value = os.getenv(key...
[ "0.818993", "0.7953558", "0.7944833", "0.79429144", "0.7934016", "0.79031706", "0.7776299", "0.77147317", "0.7711648", "0.7699816", "0.76410794", "0.75496256", "0.75417763", "0.7525228", "0.7465075", "0.7424253", "0.74007046", "0.72975266", "0.72876775", "0.7221306", "0.72051...
0.0
-1
Returns an MLReader instance for this class.
def read(cls): return JavaMMLReader(cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_reader(self) -> SpectrumReader:\n # Get the reader class\n reader_class = self.get_reader_class()\n\n # Get the common options between ourselves and the reader class\n common_options = self.get_common_options(reader_class)\n\n # Get the options sub-list corresponding to t...
[ "0.67606074", "0.65719575", "0.6528666", "0.6503996", "0.60503477", "0.5873765", "0.586067", "0.5854983", "0.58386725", "0.5770769", "0.577049", "0.5730291", "0.56816494", "0.56610745", "0.5620556", "0.55785227", "0.5539242", "0.550706", "0.5463413", "0.5425498", "0.5414667",...
0.7062961
2
Initializes the stack. Fills it with zeros if the .mem file is missing.
def initstack(st_size): stack = [] st_size = max(st_size, stack_min) while st_size: stack.append(0.0) st_size -= 1 return stack
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.RAM = [] #Random access memory\n self.STACK = deque([]) #Stack of data using LIFO\n self.SP = 0 #Stack pointer points to top of stack", "def __init__(self):\n self.memory = [0] * 256\n self.reg = [0] * 8\n sel...
[ "0.6699442", "0.64995015", "0.6294765", "0.62834203", "0.62465954", "0.61760056", "0.61617213", "0.61518633", "0.61518633", "0.61518633", "0.61518633", "0.61518633", "0.61518633", "0.61518633", "0.61518633", "0.61518633", "0.61518633", "0.61518633", "0.6147287", "0.6143084", ...
0.59874374
28
Get the total duration for the state run. We skip if anything fails here. We aren't testing state success, just performance.
def _gather_durations(ret, minion_id): if isinstance(ret.data, dict) and isinstance( ret.data.get(minion_id, None), dict ): duration = 0 for _, state_ret in ret.data[minion_id].items(): try: duration += state_ret["duration"] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration(self) -> int:\n return 0", "def duration(self):\n\t\tif self.status():\n\t\t\t# Currently on, return time since session was started\n\t\t\treturn self.length()\n\t\telse:\n\t\t\t# Otherwise return time until last bit of work\n\t\t\t# Check that this isn't an empty session\n\t\t\tif not self.t...
[ "0.6780451", "0.6696935", "0.66818", "0.66803426", "0.6668161", "0.6635437", "0.6601775", "0.6569559", "0.65645283", "0.65277886", "0.6509791", "0.6482649", "0.6447559", "0.6418445", "0.6418445", "0.6410645", "0.64059496", "0.63975865", "0.6396914", "0.6383323", "0.6380331", ...
0.712317
0
runs an episode with a random policy
def random_rollout(env, episode_length, results=None, seed=None): if results is None: results = defaultdict(list) env = env(seed=seed) done = False observation = env.reset() step = 0 while not done: action = env.action_space.sample() next_observation, reward, done, info ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample_episode(env, policy):\n states = []\n actions = []\n rewards = []\n dones = []\n \n # YOUR CODE HERE\n done = False\n state = env.reset() # Could also use env._get_obs(), but codegrade seems to expect this\n while done == False:\n states.append(state)\n \n act...
[ "0.7222194", "0.7098884", "0.68345124", "0.6816357", "0.6766137", "0.67426866", "0.66495854", "0.66375494", "0.6566788", "0.65297586", "0.65028906", "0.6497635", "0.64542466", "0.6414639", "0.6342691", "0.63058126", "0.63003546", "0.62841", "0.6280694", "0.62713516", "0.62690...
0.5618554
84
Index page must be present and HTTP Status Code have to be `200`
def test_index_availability(client): response = client.get('/') assert response.status_code == 200
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index():\n return 'OK'", "def testindex(self):\n rv = self.app.get('/')\n self.assertEqual(rv.status_code, 302, \"homepage didnot load\")", "def test_home_status_code(self):\n result = self.app.get('/')\n self.assertEqual(result.status_code, 200)", "def test_index_loads_pro...
[ "0.7736432", "0.7605049", "0.7535316", "0.7486049", "0.7477052", "0.7413132", "0.74029964", "0.73859775", "0.73824495", "0.7380797", "0.73011655", "0.7298428", "0.7289267", "0.72545904", "0.7190575", "0.7138797", "0.7117644", "0.71175766", "0.7101541", "0.70992327", "0.705650...
0.70173603
23
Returns string with API key to access ResultStore. Intended to be used in Kokoro environment.
def _get_api_key(): api_key_directory = os.getenv("KOKORO_GFILE_DIR") api_key_file = os.path.join(api_key_directory, "resultstore_api_key") assert os.path.isfile(api_key_file), ( "Must add --api_key arg if not on " "Kokoro or Kokoro environment is not set up properly." ) with open(ap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_api_key(self):\r\n url = '{0}/{1}'.format(self.get_url(), 'api_key')\r\n\r\n return http.Request('GET', url), parsers.parse_json", "def api_key(self):\n # type () -> str\n return self._api_key", "def api_key(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"api_...
[ "0.7574579", "0.75709414", "0.71667796", "0.71667796", "0.71667796", "0.71667796", "0.7156194", "0.7064962", "0.70609355", "0.7042508", "0.6956267", "0.693494", "0.6925645", "0.6890953", "0.6870767", "0.6852384", "0.6852384", "0.68502426", "0.6838111", "0.68377286", "0.683350...
0.7630378
0
Parse test duration string in '123.567s' format
def _parse_test_duration(duration_str): try: if duration_str.endswith("s"): duration_str = duration_str[:-1] return float(duration_str) except: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_duration_string_ms(duration):\n pattern = r'(?P<value>[0-9]+\\.?[0-9]*?)(?P<units>\\D+)'\n matches = list(re.finditer(pattern, duration))\n assert matches, 'Failed to parse duration string %s' % duration\n\n times = {'h': 0, 'm': 0, 's': 0, 'ms': 0}\n for match in matches:\n parsed = match.groupd...
[ "0.7363314", "0.7289042", "0.71679497", "0.70707834", "0.68884134", "0.66430646", "0.66214466", "0.66196465", "0.65671456", "0.65658575", "0.65528256", "0.65237635", "0.65017635", "0.6486903", "0.6476134", "0.6471492", "0.64354056", "0.6430652", "0.64242876", "0.64182484", "0...
0.79038805
0
Return a unique ID to use for this entity.
def unique_id(self): return f"{DOMAIN}_{self._name}_camera"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique_id(self) -> str:\n return self._unique_id", "def unique_id(self) -> str:\n return self._unique_id", "def unique_id(self) -> str:\n return self._unique_id", "def unique_id(self) -> str:\n return self._unique_id", "def unique_id(self) -> str:\n return self._uniqu...
[ "0.8460817", "0.8460817", "0.8460817", "0.8460817", "0.8460817", "0.8460817", "0.8460817", "0.8460817", "0.8355675", "0.8343812", "0.8343812", "0.83238506", "0.8221654", "0.8221654", "0.8203365", "0.8203365", "0.81823623", "0.8174053", "0.8151542", "0.8146305", "0.81339616", ...
0.0
-1
Return a unique ID to use for this entity.
def unique_id(self): return f"{DOMAIN}_{self._cam_name}_{self._obj_name}_snapshot"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique_id(self) -> str:\n return self._unique_id", "def unique_id(self) -> str:\n return self._unique_id", "def unique_id(self) -> str:\n return self._unique_id", "def unique_id(self) -> str:\n return self._unique_id", "def unique_id(self) -> str:\n return self._uniqu...
[ "0.84589195", "0.84589195", "0.84589195", "0.84589195", "0.84589195", "0.84589195", "0.84589195", "0.84589195", "0.83539873", "0.8342106", "0.8342106", "0.8321798", "0.82194704", "0.82194704", "0.8203072", "0.8203072", "0.81811434", "0.81726646", "0.81494546", "0.8145183", "0...
0.0
-1
Return the name of the sensor.
def name(self): friendly_camera_name = self._cam_name.replace('_', ' ') return f"{friendly_camera_name} {self._obj_name}".title()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._sensor.name", "def get_sensor_name(self):\n return self.data[1]", "def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._sensor_type}'", "def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.senso...
[ "0.91896784", "0.9168378", "0.890185", "0.8770976", "0.8511273", "0.8479953", "0.844435", "0.8299758", "0.8186503", "0.8105667", "0.8079737", "0.8066149", "0.8049647", "0.7700968", "0.7612295", "0.7611456", "0.7600605", "0.7600605", "0.7600605", "0.75392073", "0.75166553", ...
0.0
-1
Computes the precision for the specified values of k
def accuracy(output, target, topk=(1,)): maxk = max(topk) batch_size = target.size(0) _, pred = output.topk(maxk, 1, True, True) pred = pred.t() correct = pred.eq(target.view(1, -1).expand_as(pred)) res = [] for k in topk: correct_k = correct[:k].view(-1).float().sum(0) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(gt, pred, k):\n k = min(len(pred), k)\n den = min(len(gt), k)\n return sum([int(pred[i] in gt) for i in range(k)]) / den", "def precision_at_k(r, k):\n assert k >= 1\n r = np.asarray(r)[:k] != 0\n if r.size != k:\n raise ValueError('Relevance score length < k')\...
[ "0.76418036", "0.7420304", "0.74194485", "0.7270131", "0.72454584", "0.72450197", "0.7238218", "0.72204375", "0.7211439", "0.7059468", "0.685063", "0.6786684", "0.67810476", "0.67657244", "0.6726067", "0.67154443", "0.67154443", "0.67154443", "0.67154443", "0.67154443", "0.67...
0.0
-1
get a mapping relation between timeindex and holiday, which uses 1 to represent holiday(01)
def holiday(): time_index = np.load(exp_data_path + os.sep + 'station_list' + os.sep + 'time_index.npy', allow_pickle=True) time_index = dict(time_index.tolist()) numpy_res = np.empty((len(time_index['index']),)) for index, time in time_index['index'].items(): if str(time)[0:8] == '20200101': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_holidays(self, year=datetime.date.today().year):\n # create a hard copy\n holidays = {}\n for month in HOLIDAYS:\n holidays[month] = []\n for day in HOLIDAYS[month]:\n holidays[month].append(day)\n \n easter = dateutil.easter.easter(year)\n easter_monday = easter + date...
[ "0.60853046", "0.57911545", "0.57410187", "0.5701636", "0.55276704", "0.5413588", "0.5369778", "0.5356576", "0.5326665", "0.5287437", "0.5239321", "0.5226931", "0.5207901", "0.5188985", "0.51867884", "0.5185138", "0.5177329", "0.5168225", "0.5148064", "0.5127214", "0.51044124...
0.64413244
0
Compute next action(s) given the observation(s)
def step(self, observation, **extra_feed): action = self._evaluate(self.action, observation, **extra_feed) return action
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _step(self, action):\n transitions = self.query_model(self.s, action)\n prob, next_s, r, is_terminal = transitions[categorical_sample(\n (t[0] for t in transitions), self.rng)]\n\n next_s = np.asarray(next_s)\n for i in range(len(self.s) - 1):\n if next_s[i+1] ...
[ "0.7517387", "0.7189573", "0.71646166", "0.67703646", "0.6677667", "0.6625742", "0.6570582", "0.6570197", "0.65338045", "0.6495479", "0.6493507", "0.64857185", "0.64847976", "0.6460056", "0.6455342", "0.64471614", "0.6433014", "0.6433014", "0.64321744", "0.6431591", "0.643159...
0.6269766
33
Compute next action(s) given the observation(s)
def step(self, observation, **extra_feed): action = self._evaluate(self.action, observation, **extra_feed) return action
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _step(self, action):\n transitions = self.query_model(self.s, action)\n prob, next_s, r, is_terminal = transitions[categorical_sample(\n (t[0] for t in transitions), self.rng)]\n\n next_s = np.asarray(next_s)\n for i in range(len(self.s) - 1):\n if next_s[i+1] ...
[ "0.7516505", "0.718964", "0.7164665", "0.6770361", "0.6678305", "0.6625063", "0.65704775", "0.6569794", "0.65342087", "0.64954317", "0.6493647", "0.6485946", "0.64843255", "0.6460185", "0.6455386", "0.6447227", "0.6433035", "0.6433035", "0.6432249", "0.6431606", "0.6431606", ...
0.62702423
34
Generate the OneHot encoded classlabels from an array of integers. For example, if class_number=2 and num_classes=4 then
def one_hot_encoded(class_numbers, num_classes=None): # Find the number of classes if None is provided. # Assumes the lowest class-number is zero. if num_classes is None: num_classes = np.max(class_numbers) + 1 return np.eye(num_classes, dtype=float)[class_numbers]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_onehot(x,num_labels=7):\n enc = OneHotEncoder(n_values=num_labels)\n return enc.fit_transform(np.array(x).reshape(-1, 1)).toarray()", "def one_hot_encoding(labels, num_classes=10):\n num_labels = labels.shape[0]\n encoded = np.zeros((num_labels, num_classes))\n encoded[np.arange(num_label...
[ "0.7915557", "0.78779274", "0.7824354", "0.7803814", "0.7803814", "0.77992415", "0.77992415", "0.7781083", "0.77659416", "0.773527", "0.7733319", "0.77149636", "0.76776016", "0.7661272", "0.7636502", "0.7583619", "0.7564254", "0.7560411", "0.75548714", "0.75425845", "0.751330...
0.8247396
0
Compute a list of (begin, end) pairs representing the tokens encountered during matching.
def tokens(self): data, end = \ self.pat.traverse(lambda obj, *args: obj.tokens(*args), self.begin, self.data) return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tokens(self):\n\t\treturn self.get_starttokens() + self.get_endtokens()", "def get_tokens(self, text):\n\t\treturn tuple(self._compiled_pattern.findall(text))", "def getTokens(self):\n list = []\n for i in range(self.startIdx, self.endIdx + 1):\n token = self.sentence[i]\n ...
[ "0.7130705", "0.66104084", "0.6332303", "0.6175351", "0.61398804", "0.6127904", "0.6050738", "0.5997737", "0.59742564", "0.5972012", "0.5915156", "0.5901644", "0.5863145", "0.58111167", "0.57890856", "0.5769757", "0.5764562", "0.57620335", "0.57558525", "0.57487726", "0.57450...
0.63738155
2
Returns layer by index or name. If multiple matches are found, returns earliest.
def get_layer(model, layer_name=None, layer_idx=None): _validate_args(layer_name, layer_idx, layer=None) if layer_idx is not None: return model.layers[layer_idx] layer = [layer for layer in model.layers if layer_name in layer.name] if len(layer) > 1: print(warn_str + "multiple matching...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_layer(self, name=None, index=None):\n # TODO(fchollet): We could build a dictionary based on layer names\n # since they are constant, but we have not done that yet.\n if index is not None:\n if len(self.layers) <= index:\n raise ValueError('Was asked to retrieve layer at index ' + str(...
[ "0.7014858", "0.6575528", "0.6340156", "0.61433053", "0.5948046", "0.5666659", "0.5615688", "0.55641407", "0.5541828", "0.5480063", "0.5454364", "0.5439705", "0.53115743", "0.5307517", "0.53066623", "0.52546465", "0.52516216", "0.5247359", "0.523704", "0.5221024", "0.5199543"...
0.7123434
0
Calculate the heuristic value of a game state from the point of view of the given player.
def custom_score_2(game, player): # TODO: finish this function! if game.is_loser(player): #print("You lose!") return -math.inf if game.is_winner(player): #print("You win") return math.inf # center width = game.width / 2 height = game.height / 2 # Opponent ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def utility(self, state, player):\n if state.isWin() or state.isLose():\n return state.getScore()\n\n # In case of cycle.\n if player == PACMAN:\n return INFINITY\n else:\n return -INFINITY", "def calculate_utility(state, player):\n thisPlayer = pla...
[ "0.71622145", "0.71275526", "0.6841688", "0.68176264", "0.6798444", "0.6590645", "0.65840644", "0.6450326", "0.6449404", "0.6437236", "0.6436251", "0.6433642", "0.6420292", "0.64159733", "0.64063334", "0.64009804", "0.6355119", "0.6340802", "0.63390905", "0.6310655", "0.63084...
0.0
-1
Calculate the heuristic value of a game state from the point of view of the given player.
def custom_score_3(game, player): # TODO: finish this function! if game.is_winner(player): # check to see if player is in state winner #print("You win!") return math.inf # abstraction of score, +inf equates to a win elif game.is_loser(player): #print("You lose!") return -ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def utility(self, state, player):\n if state.isWin() or state.isLose():\n return state.getScore()\n\n # In case of cycle.\n if player == PACMAN:\n return INFINITY\n else:\n return -INFINITY", "def calculate_utility(state, player):\n thisPlayer = pla...
[ "0.71621376", "0.7128209", "0.68405724", "0.68154395", "0.6798845", "0.6591335", "0.65823066", "0.6450825", "0.64501864", "0.6437358", "0.6435719", "0.6433593", "0.6421158", "0.64153874", "0.6406683", "0.64014214", "0.6352514", "0.63406056", "0.633918", "0.63108516", "0.63081...
0.0
-1
Return True if the channel is a help post, and the user is the claimant or has a whitelisted role.
async def close_check(self, ctx: commands.Context) -> bool: if not _channel.is_help_forum_post(ctx.channel): return False if ctx.author.id == ctx.channel.owner_id: log.trace(f"{ctx.author} is the help channel claimant, passing the check for dormant.") self.bot.stats....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _have_permission(self, user: discord.User, in_guild: discord.Guild) -> bool:\n guild = connector.getGuildByID(in_guild.id)\n\n return (guild.moderator_role_id in [role.id for role in user.roles]) or (in_guild.owner == user)", "def _have_permission(self, user: discord.User, in_guild: discord.Gui...
[ "0.6940593", "0.6940593", "0.6768924", "0.6528149", "0.6506961", "0.6506961", "0.6501238", "0.6476448", "0.64453137", "0.6428861", "0.64086556", "0.6366098", "0.63568056", "0.63427466", "0.6328988", "0.6275128", "0.62749076", "0.6271494", "0.62676233", "0.62432903", "0.615177...
0.7252414
0
Return the label of a type.
def get_type_label(type_url): return type_dict[type_url]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_label(cls):\n return cls._type_name(cls.label)", "def get_label(cls):\r\n return cls._type_name(cls.label)", "def label_type(self) -> str:\n return pulumi.get(self, \"label_type\")", "def entity_type_label(self, type_id):\n type_labels = self._load_entity_type_labels()\n ...
[ "0.8616953", "0.86045223", "0.83727986", "0.80323684", "0.7614209", "0.7264798", "0.72565544", "0.7230543", "0.7160245", "0.7084266", "0.7081773", "0.7048345", "0.70412135", "0.7039831", "0.7039831", "0.7039831", "0.7039831", "0.702489", "0.69995666", "0.69995666", "0.6974829...
0.78685766
4
Return the label of a NER type.
def get_ner_type_label(type_url): for ner_label, type_urls in ner_type_to_wikidata_map.items(): if type_url in type_urls: return ner_label
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_label(cls):\r\n return cls._type_name(cls.label)", "def get_label(cls):\n return cls._type_name(cls.label)", "def label_type(self) -> str:\n return pulumi.get(self, \"label_type\")", "def entity_type_label(self, type_id):\n type_labels = self._load_entity_type_labels()\n ...
[ "0.7750689", "0.7748438", "0.77449083", "0.7190988", "0.7173268", "0.7000581", "0.69336134", "0.6854307", "0.684128", "0.6827966", "0.6809344", "0.67499334", "0.67179483", "0.67179483", "0.67179483", "0.67179483", "0.6713096", "0.6699204", "0.6699204", "0.6683994", "0.6665031...
0.7544801
3
String representation of the mapping.
def __str__(self): tmp = {str(c)+" (id="+str(id(c))+")":v for c,v in self.items()} return "ComponentMap("+str(tmp)+")"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dump_map(self) -> str:\n return utils.to_json(self.mapping)", "def dump(self) -> str:\n return '\\n'.join(map(str, self._mappings.values()))", "def __str__(self) -> str:\n mapping_str = ', '.join(\n f'{variable!s} -> {term!s}'\n for (variable, term) in self.mappin...
[ "0.8344057", "0.82393897", "0.75814646", "0.7366302", "0.7366302", "0.7366302", "0.7366302", "0.7366302", "0.7366302", "0.7366302", "0.7366302", "0.73490846", "0.7321704", "0.72037745", "0.7196717", "0.7196717", "0.7196717", "0.7196717", "0.7196717", "0.7196717", "0.7196717",...
0.7271388
13
Test that TIMESTAMP must not be used in the statements within the batch.
def only_one_timestamp_is_valid_test(self): session = self.prepare() assert_invalid(session, """ BEGIN BATCH USING TIMESTAMP 1111111111111111 INSERT INTO users (id, firstname, lastname) VALUES (0, 'Jack', 'Sparrow') USING TIMESTAMP 2 INSERT INTO users (id, firstname, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def only_one_timestamp_is_valid_test(self):\n cursor = self.prepare()\n assert_invalid(cursor, \"\"\"\n BEGIN BATCH USING TIMESTAMP 1111111111111111\n INSERT INTO users (id, firstname, lastname) VALUES (0, 'Jack', 'Sparrow') USING TIMESTAMP 2\n INSERT INTO users (id, ...
[ "0.7978503", "0.71067417", "0.6986887", "0.6976385", "0.6880362", "0.6803028", "0.6787628", "0.67142045", "0.66229707", "0.65932244", "0.65297455", "0.6484212", "0.6398453", "0.6231953", "0.6182918", "0.61585337", "0.6034745", "0.597092", "0.5914962", "0.5877579", "0.58119434...
0.79052186
1
Returns the robot that we are wrapping with this nuisance.
def get_original_robot(self): if isinstance(self.robot, EquivRobot): return self.robot.get_original_robot() else: return self.robot
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def robot(self):\n return equipment_module.Equipment(\n self._get_attr('extraction_robot_id'))", "def robot(self):\n return equipment_module.Equipment(self._get_attr('robot_id'))", "def GetRobot(self, Index): # return requested robot\n\t\treturn self.__robotList[Index]", "def robotID...
[ "0.734437", "0.7229321", "0.7157033", "0.7091555", "0.66141945", "0.66141945", "0.65904325", "0.65904325", "0.6527999", "0.63000584", "0.6266652", "0.6266652", "0.6250529", "0.6250529", "0.6147817", "0.60380477", "0.60003626", "0.5988587", "0.5975076", "0.5975076", "0.5975076...
0.7416061
0
Standard building block for residual networks with BN after convolutions.
def residual_block_(inputs, filters, is_training, strides, use_projection=False, pruning_method='baseline', init_method='baseline', data_format='channels_first', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_resnet(self):\r\n\r\n # INPUTS\r\n inputs_data = Input((self.data_rows, self.data_cols, 1),name='inputs_data')\r\n\r\n\r\n def residual_block(input, output_channels=64, kernel_size=(3, 3), stride=(1, 1)):\r\n x = Conv2D(output_channels, kernel_size, padding='same', strides...
[ "0.6761057", "0.6718992", "0.65846515", "0.65790915", "0.649853", "0.64868796", "0.64450806", "0.64450806", "0.6441736", "0.6411527", "0.64062256", "0.6399525", "0.63963383", "0.63919085", "0.6371196", "0.63613915", "0.62739086", "0.62727815", "0.6233148", "0.623134", "0.6202...
0.5610863
98
Bottleneck block variant for residual networks with BN after convolutions.
def bottleneck_block_(inputs, filters, is_training, strides, use_projection=False, pruning_method='baseline', init_method='baseline', data_format='channels_first', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet50_base(freeze_blocks=[1,2,3], weight_regularizer=None, bias_regularizer=None):\n img_input = Input(shape=(None, None, 3))\n bn_axis = 3\n train1 = 1 not in freeze_blocks\n x = Conv2D(64, (7, 7), strides=(2, 2), padding='same', name='conv1', trainable=train1,\n kernel_regularizer=weigh...
[ "0.6797115", "0.6790525", "0.67894906", "0.6715248", "0.6568025", "0.65359396", "0.65177923", "0.65177673", "0.6465531", "0.64160335", "0.6413386", "0.6396102", "0.63938797", "0.637781", "0.6364579", "0.63327837", "0.62617636", "0.6257734", "0.6249995", "0.6243509", "0.623719...
0.60108477
37
Compute rating (one of 'POSITIVE', 'NEGATIVE', 'NEUTRAL' or 'CONTROVERSIAL'). Rating currently handtuned.
def compute_rating(positive_count, neutral_count, negative_count): total = positive_count + neutral_count + negative_count if total < 5: return 'NEUTRAL' pos = positive_count/total neg = negative_count/total if pos > 0.3 and neg > 0.3: return 'CONTROVERSIAL' if pos > 0.7 or (po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_rating(self):\n if not (self.votes and self.score):\n return 0\n return float(self.score)/(self.votes+self.field.weight)", "def rating(self):\n try:\n return self._rating\n except AttributeError:\n if self.is_deprecated:\n rating...
[ "0.6952476", "0.6597651", "0.6517509", "0.6425501", "0.63415396", "0.6271793", "0.61715055", "0.616329", "0.61171854", "0.6098205", "0.60454905", "0.6044428", "0.60322183", "0.6027708", "0.5985675", "0.59460574", "0.59002036", "0.5881003", "0.58797544", "0.5840185", "0.583075...
0.7127014
0
Format the price with a precision
def get_formated_price( amount: Decimal, precision: int = DEFAULT_DECIMAL_PLACES ) -> str: return "{:0.0{}f}".format(amount, precision)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_price(self, price):\n precision = self._price_limits[3] or 8\n tick_size = self._price_limits[2] or 0.00000001\n\n adjusted_price = truncate(round(price / tick_size) * tick_size, precision)\n formatted_price = \"{:0.0{}f}\".format(adjusted_price, precision)\n\n # remov...
[ "0.8146908", "0.719476", "0.6952348", "0.6879956", "0.68512154", "0.67624307", "0.67314714", "0.67286426", "0.6720296", "0.6685231", "0.66056275", "0.6576389", "0.64241034", "0.64192975", "0.6395313", "0.63845515", "0.6346885", "0.63349545", "0.632768", "0.63213634", "0.62826...
0.8234451
0
Retrieve the decimal precision of a Decimal of the strict form 10^n (with n an integer and n the decimal_precision of the number).
def decimal_precision_from_scientific_notation(decimal_value: Decimal) -> int: return strict_integer_validator( None, -decimal_value.log10() )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_decimal_quantum(precision: int | decimal.Decimal) -> decimal.Decimal:\n assert isinstance(precision, (int, decimal.Decimal))\n return decimal.Decimal(10) ** (-precision)", "def get_decimal_precision(number: decimal.Decimal) -> int:\n # Copied from: https://github.com/mahmoud/boltons/pull/59\n ...
[ "0.7355238", "0.7157621", "0.71134424", "0.6772741", "0.6646865", "0.65462315", "0.6325303", "0.6272605", "0.613864", "0.613653", "0.6102998", "0.6101101", "0.6092312", "0.60773313", "0.6014721", "0.595179", "0.5948693", "0.59070325", "0.58668274", "0.5865504", "0.58302087", ...
0.6545971
6
Returns data at the specified index or indices of this object's list of time points.
def get_data_at_time_indices(self, indices): if _is_iterable(indices): # Raise error if indices not sorted? index_list = list(sorted(indices)) time_list = [self._time[i] for i in indices] data = { cuid: [values[idx] for idx in index_list] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, index):\n return self._timeseriesData[index]", "def __getitem__(self, index):\n\n if self._data_indices is not None:\n index = self._data_indices[index]\n data = self._dataset[index]\n return data", "def __getitem__(self, index):\n return [sel...
[ "0.7914915", "0.69811803", "0.6947568", "0.68254036", "0.67429996", "0.67142165", "0.66617244", "0.66479844", "0.66318977", "0.66175807", "0.66175807", "0.65860283", "0.65860283", "0.65836895", "0.655481", "0.65326756", "0.6522115", "0.64901555", "0.64832824", "0.647515", "0....
0.7374477
1
test the customer orders get view
def test_get_order_list(self): customer = Customer.objects.get(first_name="Larosh", last_name="Tanbari") orders = PizzaOrder.objects.filter(customer=customer) response = self.client.get( reverse('order_list', kwargs={'customer': orders.custome}), forma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_orders(self):\n pass", "def test_get_orders_by_caterer(self):\n\n\t\tres = self.login_user()\n\t\taccess_token = json.loads(res.data.decode())['access_token']\n\n\t\tresponse = self.client().post(\n\t\t\t'/api/v2/orders',\n\t\t\theaders={\"x-access-token\": access_token},\n\t\t\tdata = json.d...
[ "0.7640166", "0.7428147", "0.7348322", "0.73050714", "0.7294504", "0.7276643", "0.69950074", "0.6938416", "0.6916041", "0.6892933", "0.688076", "0.6863166", "0.6782283", "0.6706003", "0.6661587", "0.66063845", "0.6566426", "0.65104777", "0.6502982", "0.6484877", "0.64380443",...
0.7506522
1
Sets the id of this Participant.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id_):\n\n self.id_ = id_", "def set_id(self, id):\n self.__id = id", "def SetId(self, id):\n self.id = int(id)", "def setID(self, id):\n self._id = id\n return self.callRemote('setID', id)", "def id(self, id):\n if id is None:\n raise Va...
[ "0.77010345", "0.76269126", "0.7528074", "0.734136", "0.7314197", "0.7314197", "0.7314197", "0.7293539", "0.7290921", "0.72646075", "0.72646075", "0.72646075", "0.72646075", "0.72646075", "0.72646075", "0.72646075", "0.72646075", "0.72646075", "0.72646075", "0.72646075", "0.7...
0.6831644
94
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Participant): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, Participant): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
The stopwatch should provide a consistent duration even if the timezone changes.
def test_Stopwatch_timezone_change(monkeypatch): watch = timing.Stopwatch() with change('AEST-10AEDT-11,M10.5.0,M3.5.0', monkeypatch): assert abs(watch.split().total_seconds()) < 0.1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop_time(self):\n return self.start_time + timedelta(hours=self.duration)", "def get_duration(self):\n return (self.stop_day - self.start_day) * (24 * 60) \\\n + (self.stop_hour - self.start_hour) * 60", "def get_duration(self):\n try:\n if self.is_skipped:\n ...
[ "0.6571499", "0.6367958", "0.60485214", "0.581159", "0.57999796", "0.5742435", "0.56592286", "0.56405675", "0.5611479", "0.5603774", "0.5559744", "0.5544129", "0.55289435", "0.5513543", "0.5508194", "0.5498629", "0.5494857", "0.5492584", "0.54803205", "0.5478868", "0.54597896...
0.72052133
0
Compute softmax values for each sets of scores in Z. each ROW of Z is a set of scores.
def softmax_stable(Z): e_Z = np.exp(Z - np.max(Z, axis = 1, keepdims = True)) A = e_Z / e_Z.sum(axis = 1, keepdims = True) return A
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(self, z):\n assert len(z.shape) == 2\n s = np.max(z, axis=1)\n s = s[:, np.newaxis] # necessary step to do broadcasting\n e_x = np.exp(z - s)\n div = np.sum(e_x, axis=1)\n div = div[:, np.newaxis] # dito\n return e_x / div", "def softmax(Z):\r\n e_Z...
[ "0.7580719", "0.7413708", "0.7338157", "0.7270185", "0.72269624", "0.71714514", "0.71182555", "0.7105876", "0.7080963", "0.70140535", "0.70140535", "0.70140535", "0.70140535", "0.70112854", "0.67846507", "0.66684073", "0.66569024", "0.6483673", "0.64426637", "0.64090014", "0....
0.7400161
2
Initialize W1, b1, W2, b2
def mlp_init(d0, d1, d2): W1 = 0.01*np.random.randn(d0, d1) b1 = np.zeros(d1) W2 = 0.01*np.random.randn(d1, d2) b2 = np.zeros(d2) return (W1, b1, W2, b2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, a = 0, b = 0, w = 0.0):\n self.a = a\n self.b = b\n self.w = w", "def set_initial_wb(self):\n self.w = np.append(self.iniW, self.iniB)", "def set_model_params(self, w1, b1, w2, b2, w3, b3, w4, b4, w5, b5, w6, b6):\n self.w1 = w1\n self.w2 = w2\n ...
[ "0.70973796", "0.6854284", "0.6550951", "0.651267", "0.6399561", "0.63956255", "0.63614684", "0.6328225", "0.6307828", "0.6295379", "0.62747294", "0.62321556", "0.61915076", "0.61660355", "0.615267", "0.6147737", "0.6145548", "0.6145548", "0.6145548", "0.6114565", "0.6082076"...
0.5826094
51
Returns a copy of mesh.
def copy(self): return self.from_builder(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self):\r\n return BasicMesh(self.gl_lists, list(self.pos),\r\n list(self.rotation), list(self.verts),\r\n self.scale, list(self.colorize))", "def mesh(self):\n self._ensure_mesh()\n return self._mesh", "def copy(self, name=None):\n ...
[ "0.8132741", "0.754086", "0.737815", "0.7192232", "0.7106371", "0.7105341", "0.7105341", "0.7105341", "0.7105341", "0.70952815", "0.7067108", "0.66013765", "0.66013765", "0.6538548", "0.64799756", "0.6471506", "0.6461612", "0.64286065", "0.63966954", "0.63871074", "0.6386097"...
0.0
-1
Iterate over all mesh faces as list of vertices.
def faces_as_vertices(self) -> Iterable[List[Vec3]]: v = self.vertices for face in self.faces: yield [v[index] for index in face]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vertices(self):\n\n if self._faces is None:\n if self._vertices is None:\n return None\n self.triangulate()\n return self._vertices", "def vertices(self):\n try:\n return self._vertices\n except:\n self._vertices = [list(x...
[ "0.75866157", "0.7165219", "0.7063683", "0.70325166", "0.7024865", "0.6892495", "0.6769163", "0.6760904", "0.6730043", "0.6728717", "0.66844636", "0.6658169", "0.66133916", "0.6609592", "0.6578641", "0.65187705", "0.6516357", "0.6509816", "0.6509099", "0.6500426", "0.6498261"...
0.85691226
0
Iterate over all mesh edges as tuple of two vertices.
def edges_as_vertices(self) -> Iterable[Tuple[Vec3, Vec3]]: v = self.vertices for edge in self.edges: yield v[edge[0]], v[edge[1]]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edge_vertices(edge):\n return [edge.vertex1, edge.vertex2]", "def vertices(self):\n \n yielded = set()\n \n # Iterate over every tuple of edges, e.g. ..., (1, 2), (4, 3), ...\n for vertices in self.edges():\n # Iterate over every vertex in the tuple, e.g. ...,...
[ "0.7336578", "0.7029292", "0.69170606", "0.6894471", "0.6816882", "0.6776997", "0.67286175", "0.66877353", "0.6687303", "0.66425025", "0.6590387", "0.65796274", "0.6575036", "0.649218", "0.6491672", "0.6491672", "0.647976", "0.6440609", "0.63760626", "0.63573515", "0.6341804"...
0.77692026
0
Returns ``True`` if any face is none planar.
def has_none_planar_faces(self) -> bool: return not all( is_planar_face(face) for face in self.faces_as_vertices() )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self) -> bool:\n if (self._pax_with_carry_on.is_empty()\n and self._pax_without_carry_on.is_empty()):\n\n # no pax in the plane\n return True\n\n return False", "def face_is_plane(self, face)->bool:\n hs = BRep_Tool_Surface(face)\n dow...
[ "0.68490756", "0.63793427", "0.63637835", "0.63218385", "0.63165843", "0.6313217", "0.6312912", "0.6310338", "0.6308039", "0.629542", "0.62870455", "0.62795675", "0.6245346", "0.6234928", "0.6192908", "0.618556", "0.6183799", "0.618353", "0.61788845", "0.61735016", "0.6157931...
0.84331137
0
Compute the ycoordinates of the arc.
def circle(x, r, a, b, x_lim): y = (b + np.sqrt(maximum( r ** 2 - ((x - a) ** 2) * (x >= x_lim[0]) * (x <= x_lim[1])) )) * (x >= x_lim[0]) * (x <= x_lim[1]) return y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y(self):\n self._sort_measurements()\n return self._distances*np.sin(self._angles)", "def y(self) -> int:\n return self.data.y_centre >> 4", "def y_coord(self):\n\n return self.y0 + np.arange(self.ny) * self.dy", "def y(self):\n return self._turtle.ycor()", "def y(sel...
[ "0.6995352", "0.6835103", "0.6820917", "0.6758793", "0.6758793", "0.63824034", "0.6362374", "0.62969625", "0.6296534", "0.62904763", "0.6246509", "0.62118065", "0.61884975", "0.6180513", "0.61758584", "0.61571485", "0.6128298", "0.61185384", "0.61059904", "0.6102307", "0.6098...
0.0
-1
Compute the ycoordinates of the time series.
def pyts_time_series(x): p = circle(x, r=0.2, a=0, b=0, x_lim=(-0.2, 0.2)) y = - circle(x, r=0.2, a=0.4, b=0, x_lim=(0.2, 0.6)) t = 0 s = circle(x, r=0.125, a=0.9, b=-0.025, x_lim=(0.775, 0.9)) s += 0.1 * (x >= 0.9) * (x <= 1.2) return p + y + t + s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y_coord(self):\n\n return self.y0 + np.arange(self.ny) * self.dy", "def y(self):\n if self._y is None:\n self.compute_coordinates()\n return self._y", "def y_coords(self):\n y_coords = self.get_fre_band_arr()\n y_coords = np.insert(y_coords, 0, self.low_fre)\n ...
[ "0.7395257", "0.70318836", "0.69392395", "0.69116783", "0.6908767", "0.68989", "0.68753743", "0.6850228", "0.6840628", "0.6829869", "0.6822183", "0.6819051", "0.6819051", "0.6819051", "0.6819051", "0.6819051", "0.6819051", "0.6819051", "0.6819051", "0.6819051", "0.6819051", ...
0.0
-1
Convert an image from cartesian to logpolar coordinates.
def logpolar_fancy(image, i_0=None, j_0=None, p_n=None, t_n=None, crop=False): # Default for image center if i_0 is None: i_0 = int(image.shape[0] / 2) if j_0 is None: j_0 = int(image.shape[1] / 2) log.debug("Using image center ({}v, {}h)".format(i_0, j_0)) (i_n, j_n) = image.sh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def polar_convert_1d_data(scale_polar_image):\n row, col = np.shape(scale_polar_image)\n scale_data = np.zeros(row, dtype=np.uint8)\n pointer_data = np.zeros(row, dtype=np.uint8)\n # Accumulte the number of positions whose label is 1 along the theta axis.\n # Accumulte the number of positions whose ...
[ "0.585682", "0.5815327", "0.5469508", "0.5457197", "0.54508203", "0.5411461", "0.5401614", "0.5361213", "0.535421", "0.5338889", "0.533063", "0.5329354", "0.5221855", "0.5218886", "0.51926386", "0.51783264", "0.51481366", "0.5139244", "0.51364344", "0.5111829", "0.51041406", ...
0.63074476
0
Sort path segments in guessed order that they should be added to vertex queue. Order matters due to uniqueness.
def sortPathSegments(self, pathSegments): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_path(self):\n self.entries.sort(key=lambda x: x.source_path)", "def sort(self):\n self.fragment_list.sort()", "def f_way_sort(buffer_size: int, input_paths: list, output_path: str):\n pass", "def _sort_routes(self):\n sorted_routes = OrderedDict()\n for inp_lab, inp in...
[ "0.67211723", "0.6711665", "0.647322", "0.6430161", "0.64267975", "0.6249188", "0.6203513", "0.6193462", "0.6133517", "0.6120678", "0.6103983", "0.6072859", "0.6070753", "0.60041744", "0.60041493", "0.59987164", "0.5979027", "0.5903049", "0.58757424", "0.5874618", "0.5823419"...
0.77031964
0
Show a list of all the comments related to the passed object
def comments_for_object(request, reminder_id): check_permissions(request.user, [PERMISSION_COMMENT_VIEW]) reminder = get_object_or_404(Reminder, pk=reminder_id) return render_to_response('generic_list.html', { 'object': reminder, 'title': _(u'comments'), 'object_list': Comment.obje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comments_get(obj_collection, request):\n objs = [request.view(obj) for obj in obj_collection.query()]\n return {\n \"@id\": request.link(obj_collection),\n \"comments\": objs,\n \"result_complete\": True\n }", "def comments(self):\n return self.get_queryset().filter(conte...
[ "0.6921026", "0.6885069", "0.6716291", "0.669246", "0.669246", "0.669246", "0.6533686", "0.64684623", "0.6428373", "0.6354215", "0.6313508", "0.63030833", "0.63030833", "0.63030833", "0.6302651", "0.6280802", "0.6276531", "0.62707657", "0.6263077", "0.62305623", "0.61835486",...
0.72869664
0
Returns a list of entries. Use this method to get all entries.
def get(self): args = pagination_arguments.parse_args(request) page = args.get('page', 1) per_page = args.get('per_page', 10) entries_query = Entry.query entries_page = entries_query.paginate(page, per_page, error_out=False) return entries_page
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getEntries(self):\n return self.entries", "def get_entries(self) -> List[Entry]:\n return list(self.__entries)", "def getEntries(self):\n return self.__entries", "def entries(self):\n return self._entries", "def entries(self):\n return self._entries", "def get_entri...
[ "0.842741", "0.8405706", "0.8221824", "0.79674697", "0.79674697", "0.78759766", "0.77441174", "0.7666225", "0.7652839", "0.75918937", "0.75353354", "0.74421436", "0.74028313", "0.7354084", "0.722111", "0.7172486", "0.703163", "0.70263505", "0.6999483", "0.6961155", "0.6913733...
0.66752094
26
Basic item class. Sets all default values and might render them in the world if world=1
def __init__(self, game, name, pos=[0, 0], spin=0, world=1): super(Item, self).__init__(game, Surface((1, 1))) self.name = name self.file = name.lower().replace(' ', '_') + '.png' self.pos = pos self.dead = 0 self.belongs = True self.id = uuid4() self.imag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, items):\n self.items = items", "def init_items(self):\r\n raise NotImplementedError()", "def preset_items(self):\r\n\r\n raise NotImplementedError", "def __defaults__(self): \n self.tag = 'Constant-property atmosphere'\n self.composition ...
[ "0.5875111", "0.5776265", "0.5746261", "0.5702365", "0.5701518", "0.568146", "0.5661621", "0.55948126", "0.5593509", "0.5544698", "0.55168015", "0.5500628", "0.54967403", "0.5495153", "0.5468511", "0.5461691", "0.5431124", "0.54257303", "0.54108715", "0.53947264", "0.53897864...
0.5678718
6
Initializes a collector of the quantization statistics.
def __init__( self, weight_quantizers: Dict[WeightQuantizerId, WeightQuantizerInfo], non_weight_quantizers: Dict[NonWeightQuantizerId, NonWeightQuantizerInfo], build_time_info: QuantizationShareBuildTimeInfo, ): self._weight_quantizers = {k: v.quantizer_module_ref for k, v in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_statistics_collection(self):\n # Create statistics collector for testing.\n self.testing_stat_col = StatisticsCollector()\n self.add_statistics(self.testing_stat_col)\n self.problem.add_statistics(self.testing_stat_col)\n self.model.add_statistics(self.testing_stat...
[ "0.71131676", "0.6814023", "0.6494555", "0.6374334", "0.6364802", "0.62627095", "0.6255815", "0.618391", "0.614439", "0.61434007", "0.61364454", "0.61322796", "0.61181486", "0.6103491", "0.6103491", "0.6096265", "0.60953707", "0.6074537", "0.60482234", "0.6040373", "0.6031319...
0.0
-1
Initializes collector of the memory consumption statistics.
def __init__( self, compressed_model: NNCFNetwork, weight_quantizers: Dict[WeightQuantizerId, WeightQuantizerInfo], non_weight_quantizers: Dict[NonWeightQuantizerId, NonWeightQuantizerInfo], ): self._compressed_model = compressed_model self._weight_quantizers = weight...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect(self):\n if not self._btime:\n return\n\n try:\n with open(\"/proc/self/stat\", 'rb') as stat:\n parts = (stat.read().split(b')')[-1].split())\n\n self.process_metrics[\"vmem\"].set(\"\", float(parts[20]))\n self.process_metrics[\...
[ "0.66198343", "0.6613002", "0.6601707", "0.65119445", "0.649201", "0.6430968", "0.64273876", "0.637311", "0.6333632", "0.6276344", "0.6265905", "0.6249615", "0.6192068", "0.6134602", "0.6128709", "0.612617", "0.6113368", "0.60462105", "0.59873396", "0.5985197", "0.5965036", ...
0.0
-1