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
Sets the buyOpenVal of this Todays.
def buyOpenVal(self, buyOpenVal): self._buyOpenVal = buyOpenVal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sellOpenVal(self, sellOpenVal):\n\n self._sellOpenVal = sellOpenVal", "def buyOpenQtyLot(self, buyOpenQtyLot):\n\n self._buyOpenQtyLot = buyOpenQtyLot", "def buyTradedVal(self, buyTradedVal):\n\n self._buyTradedVal = buyTradedVal", "def open(self, open: float):\n if open is No...
[ "0.792224", "0.62134796", "0.6187658", "0.61292297", "0.57097995", "0.5694079", "0.55710834", "0.5538013", "0.5439113", "0.5423213", "0.5409403", "0.53930104", "0.5371976", "0.53390944", "0.5323059", "0.53198767", "0.53141415", "0.53055614", "0.51960117", "0.5193765", "0.5150...
0.86845124
0
Sets the buyTradedVal of this Todays.
def buyTradedVal(self, buyTradedVal): self._buyTradedVal = buyTradedVal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sellTradedVal(self, sellTradedVal):\n\n self._sellTradedVal = sellTradedVal", "def buyTradedQtyLot(self, buyTradedQtyLot):\n\n self._buyTradedQtyLot = buyTradedQtyLot", "def buyOpenVal(self, buyOpenVal):\n\n self._buyOpenVal = buyOpenVal", "def set_live_trading(self, live_trading):\n...
[ "0.6755813", "0.6105963", "0.6105754", "0.59289825", "0.5776081", "0.54695594", "0.54328215", "0.5383405", "0.52926034", "0.5233931", "0.519191", "0.50842357", "0.5061703", "0.5025194", "0.49871567", "0.49049658", "0.49037305", "0.48808557", "0.4878656", "0.4819408", "0.48194...
0.80446833
0
Sets the buyTrdAvg of this Todays.
def buyTrdAvg(self, buyTrdAvg): self._buyTrdAvg = buyTrdAvg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sellTrdAvg(self, sellTrdAvg):\n\n self._sellTrdAvg = sellTrdAvg", "def set_average(self, avg, num_samples):\n self._average = avg * num_samples\n self.num_samples = num_samples", "def weee_tax_applied(self, weee_tax_applied):\n\n self._weee_tax_applied = weee_tax_applied", "de...
[ "0.7440573", "0.522036", "0.52128994", "0.51768416", "0.517454", "0.51028574", "0.50514036", "0.50004125", "0.49885854", "0.49856508", "0.49826112", "0.49350753", "0.49138016", "0.48891297", "0.48878974", "0.48775244", "0.48676342", "0.48521516", "0.484965", "0.48290765", "0....
0.8381549
0
Sets the exposureMarginTotal of this Todays.
def exposureMarginTotal(self, exposureMarginTotal): self._exposureMarginTotal = exposureMarginTotal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exposureMargin(self, exposureMargin):\n\n self._exposureMargin = exposureMargin", "def spanMarginTotal(self, spanMarginTotal):\n\n self._spanMarginTotal = spanMarginTotal", "def days(self, days):\n\n self._days = days", "def days(self, days):\n\n self._days = days", "def set...
[ "0.6919726", "0.5897003", "0.55853295", "0.55853295", "0.5266935", "0.5245048", "0.50665647", "0.50144047", "0.49765855", "0.49096358", "0.48703825", "0.48626423", "0.4814657", "0.4814657", "0.4814657", "0.4814657", "0.4814657", "0.4814657", "0.4814657", "0.4814657", "0.48066...
0.83488405
0
Sets the instrumentName of this Todays.
def instrumentName(self, instrumentName): self._instrumentName = instrumentName
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setName(self, name):\n self._name = name", "def setName(self, name):\n self._name = name", "def setName(self, name):\n self.name = str(name)", "def schedule_name(self, schedule_name):\n\n self._schedule_name = schedule_name", "def setName(self, name): \n\n self...
[ "0.5659957", "0.5659957", "0.5655562", "0.56327075", "0.5618122", "0.5607145", "0.5607145", "0.5607145", "0.5607145", "0.5576745", "0.5566113", "0.5546005", "0.5539264", "0.552822", "0.5500624", "0.5500624", "0.5500624", "0.5500624", "0.5500624", "0.5500624", "0.5500624", "...
0.7908122
0
Sets the lastPrice of this Todays.
def lastPrice(self, lastPrice): self._lastPrice = lastPrice
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_sold_price(self, last_sold_price):\n\n self._last_sold_price = last_sold_price", "def max_price(self, new_max_price):\n self._max_price = new_max_price", "def last_sold_date(self, last_sold_date):\n\n self._last_sold_date = last_sold_date", "def last_update(self, last_update):\n...
[ "0.76870024", "0.64453244", "0.63118416", "0.6260388", "0.6115564", "0.6115564", "0.6115564", "0.6115564", "0.6012773", "0.5945576", "0.5814375", "0.57499397", "0.573068", "0.5725616", "0.5697028", "0.5697028", "0.5697028", "0.5697028", "0.5697028", "0.5697028", "0.5697028", ...
0.8106717
0
Sets the maxCODQty of this Todays.
def maxCODQty(self, maxCODQty): self._maxCODQty = maxCODQty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_sale_qty(self, max_sale_qty):\n if max_sale_qty is None:\n raise ValueError(\"Invalid value for `max_sale_qty`, must not be `None`\")\n\n self._max_sale_qty = max_sale_qty", "def set_qty(self, qty):\n self.__qty = qty", "def use_config_max_sale_qty(self, use_config_max_s...
[ "0.6039956", "0.5635461", "0.5585717", "0.54745233", "0.54406464", "0.54406464", "0.5440165", "0.54338616", "0.54162395", "0.54162395", "0.54162395", "0.5366474", "0.53645563", "0.534075", "0.5307947", "0.5268674", "0.52447546", "0.52447546", "0.51799726", "0.51434195", "0.50...
0.83763963
0
Sets the normalSqOffQty of this Todays.
def normalSqOffQty(self, normalSqOffQty): self._normalSqOffQty = normalSqOffQty
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_qty(self, qty):\n self.__qty = qty", "def qty(self, qty):\n\n self._qty = qty", "def netTrdQtyLot(self, netTrdQtyLot):\n\n self._netTrdQtyLot = netTrdQtyLot", "def qty(self, qty):\n if qty is None:\n raise ValueError(\"Invalid value for `qty`, must not be `None`...
[ "0.5729276", "0.54751456", "0.54494506", "0.50820524", "0.50820524", "0.4980234", "0.4862853", "0.4841309", "0.4778189", "0.47389305", "0.47219193", "0.47157934", "0.46747112", "0.46407852", "0.4631502", "0.46031743", "0.4602834", "0.45372623", "0.45176375", "0.44964582", "0....
0.8387398
0
Sets the realizedPL of this Todays.
def realizedPL(self, realizedPL): self._realizedPL = realizedPL
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def planned(self, planned):\n\n self._planned = planned", "def set_plyrbolts(self, plyrbolts):\n self._plyrbolts = plyrbolts", "def planned_purge_date(self, planned_purge_date):\n\n self._planned_purge_date = planned_purge_date", "def planned_purge_date(self, planned_purge_date):\n\n ...
[ "0.5504624", "0.5277286", "0.48903647", "0.48903647", "0.48841494", "0.484144", "0.4787247", "0.4701438", "0.4612002", "0.45979857", "0.45940223", "0.4584943", "0.45501566", "0.45421958", "0.45152426", "0.45133227", "0.4508421", "0.45060623", "0.45026186", "0.44949692", "0.44...
0.76740044
0
Sets the sellOpenVal of this Todays.
def sellOpenVal(self, sellOpenVal): self._sellOpenVal = sellOpenVal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buyOpenVal(self, buyOpenVal):\n\n self._buyOpenVal = buyOpenVal", "def sellOpenQtyLot(self, sellOpenQtyLot):\n\n self._sellOpenQtyLot = sellOpenQtyLot", "def sellTradedVal(self, sellTradedVal):\n\n self._sellTradedVal = sellTradedVal", "def set_sell_amount_from_buy_amount(self, *args...
[ "0.7842964", "0.64404714", "0.5858791", "0.57749903", "0.57126355", "0.56925833", "0.56652045", "0.5647393", "0.5638476", "0.5633755", "0.5619304", "0.55632746", "0.5557169", "0.55131936", "0.5479172", "0.5472713", "0.5448849", "0.53595304", "0.53315955", "0.5294227", "0.5257...
0.8756516
0
Sets the sellTradedVal of this Todays.
def sellTradedVal(self, sellTradedVal): self._sellTradedVal = sellTradedVal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buyTradedVal(self, buyTradedVal):\n\n self._buyTradedVal = buyTradedVal", "def sellTradedQtyLot(self, sellTradedQtyLot):\n\n self._sellTradedQtyLot = sellTradedQtyLot", "def sellOpenVal(self, sellOpenVal):\n\n self._sellOpenVal = sellOpenVal", "def sells(self, sells):\n\n self...
[ "0.7237824", "0.6751613", "0.6502228", "0.6135291", "0.601004", "0.6008388", "0.586594", "0.5793435", "0.5705081", "0.5620574", "0.5545526", "0.5523706", "0.5516475", "0.5416297", "0.52913755", "0.52766633", "0.517192", "0.5168107", "0.5148421", "0.513201", "0.50286686", "0...
0.8211346
0
Sets the spanMargin of this Todays.
def spanMargin(self, spanMargin): self._spanMargin = spanMargin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spanMarginTotal(self, spanMarginTotal):\n\n self._spanMarginTotal = spanMarginTotal", "def set_margin(self, margin):\n _pal.lib.geometry_set_margin(self._geometry, c.c_float(margin))", "def change_margin(self, margin):\n self.margin = margin * self._MM_IN_MICRONS\n\n self._creat...
[ "0.6576839", "0.5993651", "0.5863074", "0.5770549", "0.55829585", "0.53886014", "0.53886014", "0.53337723", "0.5246872", "0.51989", "0.51454604", "0.5065816", "0.50485206", "0.50272894", "0.4999453", "0.49740312", "0.4906146", "0.48618513", "0.47878632", "0.47790757", "0.4774...
0.73883986
0
Sets the spanMarginTotal of this Todays.
def spanMarginTotal(self, spanMarginTotal): self._spanMarginTotal = spanMarginTotal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exposureMarginTotal(self, exposureMarginTotal):\n\n self._exposureMarginTotal = exposureMarginTotal", "def spanMargin(self, spanMargin):\n\n self._spanMargin = spanMargin", "def days(self, days):\n\n self._days = days", "def days(self, days):\n\n self._days = days", "def tot...
[ "0.61584926", "0.6138209", "0.55055887", "0.55055887", "0.5172367", "0.5160601", "0.5155821", "0.5125953", "0.5086602", "0.50012535", "0.4913711", "0.48961848", "0.47081298", "0.46686873", "0.46538928", "0.46340597", "0.46340597", "0.46340597", "0.46340597", "0.46340597", "0....
0.7949429
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Todays): 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.80886984", "0.80886984", "0.8055307", "0.7983415", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, Todays): 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.84560555", "0.83913696", "0.8143685", "0.81403786", "0.8131871", "0.8093231", "0.80915105", "0.80915105", "0.80915105", "0.8084564", "0.8084564", "0.8075547", "0.8075547", "0.8065006", "0.80417657", "0.80417657", "0.80417657", "0.80417657", "0.80417657", "0.80417657", "0.8...
0.0
-1
Gets a collection of `InputExample`s for the train set.
def get_train_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_train_inputs(self, example):\n return example", "def get_train_examples(self):\n raise NotImplementedError()", "def get_train_examples(self, input_file):\r\n raise NotImplementedError()", "def _create_examples(self, data, set_type):\n examples = []\n for (i, elem) in en...
[ "0.7351723", "0.7176769", "0.7129576", "0.6561703", "0.6423176", "0.6406007", "0.6342966", "0.6290008", "0.6282498", "0.6251752", "0.6250117", "0.6250117", "0.6250117", "0.6250117", "0.6250117", "0.6250117", "0.6250117", "0.6250117", "0.6250117", "0.6250117", "0.6250117", "...
0.6209044
34
Gets a collection of `InputExample`s for the dev set.
def get_dev_examples(self, data_dir): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dev_examples(self, input_file):\r\n raise NotImplementedError()", "def get_train_inputs(self, example):\n return example", "def get_examples(self, env):\n return self.fam.c_get_examples(self, env)", "def get_dev_examples(self):\n raise NotImplementedError()", "def _create_ex...
[ "0.68096465", "0.6588737", "0.65564847", "0.6552217", "0.64253366", "0.63810265", "0.62574667", "0.6191878", "0.6116491", "0.6095453", "0.6055614", "0.60522205", "0.5994734", "0.5994734", "0.5994734", "0.5994734", "0.5994734", "0.5994734", "0.5994734", "0.5994734", "0.5994734...
0.5915606
36
A test status code of response for anonymous user
def test_status_code_for_anonymous_user(self): response = self.client.get(self.get_url()) self.assertEqual(response.status_code, self.status_anonymous)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_whoami_by_anonymous_user(self):\n response = self.client.get(\"/api/users/whoami/\")\n self.assertEqual(response.status_code, 401)", "def test_status_code_for_signed_user(self):\n self.client.login(username=\"john\", password=\"pass\")\n response = self.client.get(self.get_ur...
[ "0.76912373", "0.75791943", "0.7486997", "0.7346519", "0.72885984", "0.7232091", "0.71685225", "0.7132378", "0.7130539", "0.71257293", "0.71161425", "0.7030195", "0.7006366", "0.7006366", "0.70001423", "0.69591725", "0.6952329", "0.69495934", "0.6945756", "0.68966967", "0.688...
0.8502435
0
Get the tiering_policy enum.
def get_tiering_policy_enum(self, tiering_policy): if tiering_policy in utils.TieringPolicyEnum.__members__: return utils.TieringPolicyEnum[tiering_policy] else: errormsg = "Invalid choice {0} for tiering policy".format( tiering_policy) LOG.error(erro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_locking_policy_enum(self, locking_policy):\n if locking_policy in utils.FSLockingPolicyEnum.__members__:\n return utils.FSLockingPolicyEnum[locking_policy]\n else:\n errormsg = \"Invalid choice {0} for locking_policy\".format(\n locking_policy)\n ...
[ "0.6397545", "0.634253", "0.63034767", "0.63034767", "0.63034767", "0.6250823", "0.6237406", "0.62089485", "0.61861485", "0.61861485", "0.61861485", "0.61861485", "0.6163467", "0.6160561", "0.6086308", "0.6016778", "0.5997057", "0.59932476", "0.5970653", "0.5855682", "0.58343...
0.89365596
0
This method sets seconds in minutes, hours or days.
def get_time_with_unit(time): sec_in_min = 60 sec_in_hour = 60 * 60 sec_in_day = 24 * 60 * 60 if time % sec_in_day == 0: time = time / sec_in_day unit = 'days' elif time % sec_in_hour == 0: time = time / sec_in_hour unit = 'hours' else: time = time / se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_time(self, sec):\n self.set_timed(round(sec * 10.0))", "def seconds(self, seconds):\n\n self._seconds = seconds", "def setSecond(self, *args):\n return _libsbml.Date_setSecond(self, *args)", "def __init__(self, seconds):\n self._seconds = seconds", "def duration_in_secon...
[ "0.76748514", "0.74424386", "0.66163504", "0.64558667", "0.64133805", "0.64109707", "0.6401154", "0.6397392", "0.638656", "0.63768166", "0.6354098", "0.63376427", "0.6333682", "0.6284368", "0.628019", "0.6275721", "0.62380767", "0.623474", "0.6231666", "0.62107664", "0.620419...
0.0
-1
AuthorizationPolicyStatus defines the observed state of AuthorizationPolicy
def __init__(__self__, *, message: Optional[pulumi.Input[str]] = None, policy_id: Optional[pulumi.Input[str]] = None, roles: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, source: Optional[pulumi.Input['AuthorizationPolicyStatusSourceArgs'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPolicy(self, state):\n util.raiseNotDefined()", "def getPolicy(self, state):\n util.raiseNotDefined()", "def status(self) -> Optional['outputs.ValidatingAdmissionPolicyStatus']:\n return pulumi.get(self, \"status\")", "def status(ctx):\n status = ctx.status()\n click.echo(cl...
[ "0.6004429", "0.6004429", "0.589617", "0.5854452", "0.57064515", "0.5650583", "0.55248946", "0.54457945", "0.54323304", "0.5370546", "0.53590304", "0.535598", "0.5296116", "0.52956057", "0.5289436", "0.52861017", "0.5285436", "0.52596825", "0.5252264", "0.5250852", "0.5250647...
0.50970525
31
Yields all propositions in this tree matching the specified path.
def retrieve(self, path): if len(path) == 0: for leaf in self.leaves: yield leaf else: next_index = path[0] if self._is_variable(next_index): for leaf in self._retrieve_variable(path[1:]): yield leaf else: next_disc_tree = self._child_at_index(next_index...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n for (_,_,path) in self.frontierpq:\n yield path", "def path_it(d):\n for p in _path_walk([], d):\n yield p", "def path(self):\r\n node, p = self, []\r\n while node:\r\n p.append(node)\r\n node = node.parent\r\n yield f...
[ "0.61683244", "0.5970815", "0.58298516", "0.5769936", "0.57153827", "0.567977", "0.5679161", "0.5603973", "0.5594862", "0.5590501", "0.55403316", "0.55403316", "0.5488624", "0.5474393", "0.5437475", "0.54317427", "0.5427958", "0.5424383", "0.5409215", "0.5393515", "0.53763336...
0.58082455
3
From a list , replace a single instance of with . Raises a ValueError if is not found, or is found multiple times.
def listReplace(inputList, a, b, onlyOne = True): index = None for i,item in enumerate(inputList): if index is None and item==a: index = i if onlyOne: break elif index is not None and item==a: raise ValueError("Multiple copies of {0} were found...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_replace(text, list):\r\n\tfor pair in list:\r\n\t\tif pair[0] in text:\r\n\t\t\ttext = text.replace(pair[0], pair[1])\r\n\treturn text", "def search_replace(my_list, search, replace):\n\n new_list = list(map(lambda a: replace if (a == search) else a, my_list))\n return (new_list)", "def search_r...
[ "0.68770045", "0.672791", "0.6654641", "0.6552881", "0.6478725", "0.6427196", "0.64206135", "0.6399069", "0.633334", "0.62853277", "0.6264004", "0.6175482", "0.6046381", "0.60372823", "0.6016073", "0.6007531", "0.5817499", "0.57966685", "0.57444364", "0.5736971", "0.5688116",...
0.74271905
0
Administer a drug to this patient. After a prescription is added, the drug acts on the virus population for all subsequent time steps. If the newDrug is already prescribed to this patient, the method has no effect.
def addPrescription(self, newDrug): if newDrug not in self.Prescriptions: self.Prescriptions.append(newDrug)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addPrescription(self, newDrug):\n\n self.administeredDrugs.append(newDrug)", "def addPrescription(self, newDrug):\n if self.prescriptions.count(newDrug) == 0:\n self.prescriptions.append(newDrug)", "def illicit_drug(self, illicit_drug):\n\n self.logger.debug(\"In 'illicit_dr...
[ "0.82073563", "0.6658299", "0.5626224", "0.5345675", "0.49271238", "0.48004666", "0.45710114", "0.45217797", "0.4489947", "0.4489095", "0.4455575", "0.4401897", "0.4361488", "0.43498558", "0.4346843", "0.43387407", "0.4316562", "0.43126994", "0.43051687", "0.43042076", "0.430...
0.70758677
1
Returns the short name for the user.
def get_short_name(self): return self.first_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_short_name(self):\n return self.username", "def get_short_name(self):\n return self.username", "def get_short_name(self):\n return self.username", "def get_short_name(self):\n # The user is identified by their email address\n return self.first_name", "def get_shor...
[ "0.90316343", "0.90316343", "0.90316343", "0.8829965", "0.88074076", "0.8665172", "0.8423785", "0.8335693", "0.8307673", "0.8281205", "0.8281205", "0.81919736", "0.8174178", "0.8150322", "0.81289876", "0.80974096", "0.80956835", "0.8077189", "0.79694206", "0.79643494", "0.796...
0.81823653
27
Returns the first_name plus the last_name, with a space in between.
def get_full_name(self): full_name = '%s %s' % (self.first_name, self.last_name) return full_name.strip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_name(first_name, last_name):\n return first_name + \" \" + last_name", "def full_name(first_name, last_name):\n\t\n\treturn first_name + \" \" + last_name", "def get_formated_name(first_name,last_name):\n\tfull_name = first_name + '' + last_name\n\treturn full_name.title()", "def get_full_name(se...
[ "0.8313066", "0.82006806", "0.8049215", "0.80409706", "0.8017754", "0.7999701", "0.79541886", "0.7942144", "0.7942144", "0.7942144", "0.7937664", "0.79287225", "0.7921711", "0.790314", "0.7892264", "0.7890117", "0.7878668", "0.786143", "0.78528684", "0.7823523", "0.7813124", ...
0.77466476
51
Vectorizes padding and masks last word of sentence. (EOS token)
def preprocess_batch(self, context, question, answer, mask): # make input and question fixed size new_input = np.zeros([self.config.batch_size, self.dataset.max_input_size, self.config.word_vector_length]) # zero padding new_question =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pad_sentence_length(self, sentence):\n if len(sentence) > self.pad_sentence_length:\n sentence = sentence[:self.pad_sentence_length]\n sentence[self.pad_sentence_length-1] = \"@EOS@\"\n elif len(sentence) < self.pad_sentence_length:\n sentence.extend([\"@PAD@\"] ...
[ "0.5888574", "0.5697063", "0.56645525", "0.56425786", "0.56326514", "0.56315976", "0.5547267", "0.5533461", "0.54940605", "0.54899", "0.5451357", "0.5379438", "0.5373771", "0.53726137", "0.53599024", "0.53030574", "0.5296092", "0.52920943", "0.52830356", "0.5274911", "0.52651...
0.0
-1
Convert s, a command separated list of whole numbers, into a list of int.
def comma_list(s): return tuple(int(v) for v in s.split(","))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_str_2_int_list(s, d=\",\"):\n\n ss = s.split(d)\n\n temp = []\n\n for t in ss:\n temp.append( int(t) )\n\n return temp", "def line2ints(line):\n return [int(d) for d in line.strip()]", "def str2ints(params: str) -> List[int]:\n return list(map(int, params.split(\",\")))", ...
[ "0.7293066", "0.71518475", "0.71385217", "0.709224", "0.7090437", "0.69723064", "0.6947008", "0.6921535", "0.6915192", "0.6872384", "0.6869889", "0.677663", "0.6758972", "0.6694627", "0.6618454", "0.65448016", "0.6505061", "0.6498804", "0.6457406", "0.6456938", "0.6399968", ...
0.572374
78
Create a dict mapping label id to human readable string.
def create_readable_names_for_imagenet_labels(): base_url = 'http://cnbj1-fds.api.xiaomi.net/ml-datasets/imagenet/' # noqa synset_url = '{}/imagenet_lsvrc_2015_synsets.txt'.format(base_url) synset_to_human_url = '{}/imagenet_metadata.txt'.format(base_url) filename, _ = urllib.urlretrieve(synset_url) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_labels_and_mapping(self, labels, mapping):\n numbered_classes = list(enumerate(list(labels), start=0))\n if mapping:\n new_mapping = {number: str(mapping[label]) for number, label in numbered_classes}\n else:\n new_mapping = {number: str(label) for number, lab...
[ "0.6659889", "0.66004634", "0.658425", "0.6549008", "0.65021294", "0.6488751", "0.6484011", "0.640811", "0.64059776", "0.6376804", "0.6359671", "0.63115203", "0.6235658", "0.62094486", "0.620497", "0.6180193", "0.61330223", "0.61097467", "0.61067617", "0.6097204", "0.60965496...
0.0
-1
Fills the missing values of `series` with only the value provided (default zeroes).
def _const_fill(series: TimeSeries, fill: float = 0) -> TimeSeries: return TimeSeries.from_times_and_values( series.time_index, series.pd_dataframe().fillna(value=fill), freq=series.freq, columns=series.columns, static_covariates=series.static_covariates, hierarchy=s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fill_missing_values(\n series: TimeSeries, fill: Union[str, float] = \"auto\", **interpolate_kwargs\n) -> TimeSeries:\n raise_if_not(\n isinstance(fill, str) or isinstance(fill, float),\n \"`fill` should either be a string or a float\",\n logger,\n )\n raise_if(\n isinst...
[ "0.7136625", "0.709207", "0.68450874", "0.6656159", "0.6341916", "0.63358647", "0.6328167", "0.6262715", "0.62560636", "0.62413216", "0.62156135", "0.61693394", "0.61686003", "0.6064794", "0.60038745", "0.5992132", "0.5980443", "0.59703183", "0.5963774", "0.59323215", "0.5776...
0.6993336
2
Checks the length for a Hugging Face Transformers tokenizer using a Hugging Face Transformers config. Copies the max_position_embeddings parameter if the tokenizer has no max_length set. This helps with backwards compatibility with older tokenizers.
def checklength(config, tokenizer): # Unpack nested config, handles passing model directly if hasattr(config, "config"): config = config.config if ( hasattr(config, "max_position_embeddings") and tokenizer and hasattr(tokenizer, "model_max_length...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _resize_token_embeddings(\n cls, model: PreTrainedModel, tokenizer_wrapper: TokenizerWrapper\n ):\n if tokenizer_wrapper.num_added_special_tokens > 0:\n model.resize_token_embeddings(\n new_num_tokens=len(tokenizer_wrapper.tokenizer)\n )", "def test_embed...
[ "0.5711118", "0.5426763", "0.5255646", "0.5245503", "0.5245503", "0.5245503", "0.5245503", "0.5210988", "0.52006274", "0.50267303", "0.50076056", "0.49952373", "0.49209923", "0.48601574", "0.48592582", "0.4850963", "0.4830976", "0.48153925", "0.48108733", "0.47946444", "0.479...
0.72631747
0
Gets the best max length to use for generate calls. This method will return config.max_length if it's set. Otherwise, it will return tokenizer.model_max_length.
def maxlength(config, tokenizer): # Unpack nested config, handles passing model directly if hasattr(config, "config"): config = config.config # Get non-defaulted fields keys = config.to_diff_dict() # Use config.max_length if not set to default value, else use token...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _max_length(self):\n return self.__max_length", "def max_length(self):\n\t\treturn self._max_length", "def _model_string_maxlen():\n # hardcoded for convenience. Could be dynamically set in future.\n # the current longest is: BLOSUM62+I+G+X, i.e. 14 chars.\n # so we just over double it, for...
[ "0.79405546", "0.7843473", "0.7619192", "0.7608121", "0.71693355", "0.7094461", "0.7046673", "0.69798476", "0.6894663", "0.68818414", "0.6845005", "0.68170446", "0.6746684", "0.66152346", "0.6553684", "0.65375984", "0.64956737", "0.6461967", "0.64548415", "0.6432982", "0.6432...
0.84325695
0
Translates input gpu argument into a device id.
def deviceid(gpu): # Return if this is already a torch device # pylint: disable=E1101 if isinstance(gpu, torch.device): return gpu # Always return -1 if gpu is None or an accelerator device is unavailable if gpu is None or not Models.hasaccelerator(): re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetGPU():\n return option['device_id']", "def to_device(device, x):\n if device is None:\n return x\n elif device < 0:\n return cuda.to_cpu(x)\n else:\n return cuda.to_gpu(x, device)", "def ConvertGpuToVendorName(gpu):\n if not gpu:\n return 'No GPU'\n elif '8086' in g...
[ "0.6964336", "0.69079167", "0.67300904", "0.67153615", "0.6606423", "0.6566457", "0.6508084", "0.64685595", "0.64474094", "0.6415288", "0.6337208", "0.6267058", "0.6247046", "0.62168324", "0.6188465", "0.6186235", "0.6170216", "0.6126492", "0.6126492", "0.61091566", "0.605798...
0.726502
0
Gets a tensor device.
def device(deviceid): # Torch device # pylint: disable=E1101 return deviceid if isinstance(deviceid, torch.device) else torch.device(Models.reference(deviceid))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device(self):\n return self._tensor.device", "def get_device_of(self, tensor):\n if not tensor.is_cuda:\n return -1\n else:\n return tensor.get_device()", "def get_device():\n import torch\n\n if torch.cuda.is_available():\n return torch.d...
[ "0.8164742", "0.76639354", "0.7298995", "0.72871435", "0.72539467", "0.72441936", "0.7124126", "0.70127064", "0.68898284", "0.6874498", "0.6826608", "0.6801499", "0.6799926", "0.6793535", "0.676261", "0.6665935", "0.66055286", "0.66055286", "0.66055286", "0.66055286", "0.6605...
0.66141444
16
Gets a tensor device reference.
def reference(deviceid): return ( deviceid if isinstance(deviceid, str) else "cpu" if deviceid < 0 else f"cuda:{deviceid}" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device(self):\n return self._tensor.device", "def device(self) -> torch.device:\n return self._device", "def get_device_of(self, tensor):\n if not tensor.is_cuda:\n return -1\n else:\n return tensor.get_device()", "def device(self):\n return torch....
[ "0.7835659", "0.69524187", "0.6910918", "0.6675793", "0.6584419", "0.65061194", "0.6471759", "0.64582735", "0.64544827", "0.64336944", "0.64211166", "0.64211166", "0.64211166", "0.64211166", "0.64211166", "0.64086044", "0.63569194", "0.6350916", "0.6350318", "0.6339761", "0.6...
0.6087808
27
Get the version number of the DLL.
def MPUSBGetDLLVersion(self): if not self.__dll: return None return self.__dll._MPUSBGetDLLVersion() #end MPUSBGetDLLVersion()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dll_version(self):\n major = ctypes.c_uint32()\n minor = ctypes.c_uint32()\n revision = ctypes.c_uint8()\n\n result = self._lib.NRFJPROG_dll_version(ctypes.byref(major), ctypes.byref(minor), ctypes.byref(revision))\n if result != NrfjprogdllErr.SUCCESS:\n raise API...
[ "0.76344067", "0.74684596", "0.74162537", "0.74123", "0.7367389", "0.7258252", "0.7252815", "0.7229101", "0.720304", "0.71995544", "0.71995544", "0.71995544", "0.7196376", "0.71776766", "0.7132807", "0.70834774", "0.70676786", "0.7063237", "0.6989423", "0.6966079", "0.6960703...
0.7094877
15
Get number of devices connected.
def MPUSBGetDeviceCount(self, vid_pid_string): if not self.__dll: return 0 return self.__dll._MPUSBGetDeviceCount(vid_pid_string.encode('utf-8')) #end MPUSBGetDeviceCount
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_count():\n _check_init()\n return _pypm.CountDevices()", "def get_number_of_devices(self):\n return self.drt_manager.get_number_of_devices()", "def get_device_count():\n c_num = ct.c_int(0)\n safe_call(backend.get().af_get_device_count(ct.pointer(c_num)))\n return c_num.value", "def...
[ "0.8508309", "0.8323714", "0.82190895", "0.7869438", "0.77642435", "0.77367294", "0.74786454", "0.7279567", "0.715227", "0.71362555", "0.71303964", "0.70103717", "0.70077246", "0.69313", "0.6870126", "0.68391997", "0.67820454", "0.67653406", "0.6730397", "0.66155225", "0.6608...
0.5994583
77
Sets configProto from tensorflow, serialized into byte array.
def setConfigProtoBytes(self, b): return self._set(configProtoBytes=b)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setConfigProtoBytes(self, v):\n return self._set(configProtoBytes=v)", "def make_config_proto(c):\n # tensorflow config\n use_gpu = os.environ.get('use_gpu', c.get('tf.config.use_gpu', c.get('use_gpu', 1)))\n cfg = tf.ConfigProto(device_count={'GPU': use_gpu})\n\n # scan config for tf conf...
[ "0.75618696", "0.6219305", "0.6167628", "0.59814763", "0.59055257", "0.5844697", "0.5599306", "0.55863786", "0.5412146", "0.53233427", "0.5217989", "0.52129155", "0.51678354", "0.51494646", "0.50938296", "0.5053427", "0.50138324", "0.49860623", "0.4972503", "0.49635026", "0.4...
0.7518328
42
Post an object to the server by JSON; return the received object.
def post_json(self, url, payload, csrf_token=None, expect_errors=False, expected_status_int=200, upload_files=None): data = {'payload': json.dumps(payload)} if csrf_token: data['csrf_token'] = csrf_token json_response = self.testapp.post( str(url), data...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(self, url, obj):\n with warnings.catch_warnings():\n warnings.simplefilter(\"ignore\")\n return self.session.post(url, json=obj, verify=False)", "def post(**args):\n\tglobal _objstore\n\t_objstore = _objstore or ObjStore()\n\t\n\tif 'json' in args:\n\t\t_objstore.post(args['...
[ "0.7611127", "0.70503545", "0.7015738", "0.69528824", "0.682873", "0.6698919", "0.6669453", "0.6663495", "0.6586448", "0.6545432", "0.6545432", "0.65274906", "0.64938664", "0.64926225", "0.6450602", "0.63934225", "0.63787633", "0.63643277", "0.63610274", "0.63509077", "0.6309...
0.0
-1
Saves a new default exploration written by owner_id. Returns the exploration domain object.
def save_new_default_exploration(self, exploration_id, owner_id, title='A title'): exploration = exp_domain.Exploration.create_default_exploration( exploration_id, title, 'A category') exp_services.save_new_exploration(owner_id, exploration) return exploration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_new_valid_exploration(\n self, exploration_id, owner_id, title='A title'):\n exploration = exp_domain.Exploration.create_default_exploration(\n exploration_id, title, 'A category')\n exploration.states[exploration.init_state_name].widget.handlers[\n 0].rule_s...
[ "0.7502665", "0.51888716", "0.51870084", "0.5003496", "0.49176863", "0.47992614", "0.47962826", "0.47937116", "0.46809012", "0.46634847", "0.4581752", "0.45622504", "0.45026258", "0.4442152", "0.4433455", "0.44076717", "0.44015548", "0.43778506", "0.43730906", "0.43640757", "...
0.83821166
0
Give and randomize all player in the game
def getMembersName(self): listMemberName = [] for member in self.playersAndRoles: listMemberName.append(member.user.name) random.shuffle(listMemberName) return listMemberName
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randomize(self):\n if self.randomize_players is True:\n random.shuffle(self.player_field)", "def seed_players(self):\n raise NotImplementedError()", "def make_players(player_names, seed):\n\n np.random.seed(seed)\n players = [Player(name) for name in player_names]\n\n for ...
[ "0.80500937", "0.6924485", "0.6726389", "0.6663254", "0.6662036", "0.6647794", "0.6628226", "0.6618328", "0.65626156", "0.65197897", "0.64625067", "0.6444857", "0.64310265", "0.6389021", "0.63687474", "0.6366432", "0.63451564", "0.63302433", "0.6316544", "0.6315681", "0.62979...
0.0
-1
Build complete URL to the API endpoint by replacing single formatting character (%s) in endpoint_url with instance_id of the object and combining it with base url.
def build_url(self, endpoint_url: str) -> str: return self.base_url + endpoint_url % self.instance_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_url(self, endpoint:str, params:Dict[str, str]=None) -> str:\n if params:\n return f\"{self.BASE_URL}/{self._api_version}{endpoint}?{urlencode(params)}\"\n return f\"{self.BASE_URL}/{self._api_version}{endpoint}\"", "def _construct_url(self, endpoint):\n return self.b...
[ "0.78190833", "0.7807703", "0.75187397", "0.7305575", "0.7272995", "0.718999", "0.71346897", "0.7057869", "0.70359516", "0.7008521", "0.69545925", "0.69352406", "0.6933932", "0.6888178", "0.68276626", "0.6800728", "0.67874175", "0.6739863", "0.6672235", "0.66091466", "0.65833...
0.8523575
0
Class method that creates instance of StorageObject from supplied dictionary. Source dictionary is expected to contain at least 'instanceId' and 'name' keys.
def from_json(cls, req_session: Session, base_url: str, source_dict: Dict[Any, Any]) -> 'StorageObject': return StorageObject(req_session=req_session, base_url=base_url, instance_id=source_dict['instanceId'], name=source_dict...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\r\n dictionary):\r\n if dictionary is None:\r\n return None\r\n\r\n # Extract variables from the dictionary\r\n ephemeral_public_key = dictionary.get('ephemeral_public_key')\r\n public_key_hash = dictionary.get('public_key_hash'...
[ "0.6531803", "0.64313513", "0.6332392", "0.6305054", "0.6305054", "0.6243611", "0.6169091", "0.6168182", "0.6167342", "0.61640555", "0.6157975", "0.61408114", "0.61392015", "0.6119208", "0.6094934", "0.6068212", "0.60595566", "0.6054184", "0.6038218", "0.603112", "0.59827", ...
0.80090475
0
Class method that creates instance of StorageObjectFolder from supplied dictionary. Source dictionary is expected to contain at least 'instanceId', 'name' and 'parent' keys. 'parent' key is optional (it can be missing in case the folder is root) but if it's present, it should be dictionary containing at least 'instance...
def from_json(cls, req_session: Session, base_url: str, source_dict: Dict[Any, Any]) -> 'StorageObjectFolder': return StorageObjectFolder(req_session=req_session, base_url=base_url, instance_id=source_dict['instanceId'], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, dict_, archive_reader):\n\n obj = Folder.__new__(cls)\n super().__init__(obj)\n obj.to_natives(dict_, archive_reader)\n return obj", "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n #...
[ "0.6527107", "0.64611316", "0.6094325", "0.60849226", "0.60635656", "0.5828018", "0.568668", "0.547843", "0.53664464", "0.5359711", "0.5353126", "0.5334621", "0.53256506", "0.52380645", "0.5222712", "0.5198479", "0.5173817", "0.5127954", "0.5094439", "0.5082993", "0.5076785",...
0.81057453
0
Find StorageObject with specified name in this collection. Since names do not have to be unique, this method will always return StorageObjectCollection containing all the StorageObjects with given name. In case no StorageObject is found, returned collection is empty
def find_by_name(self, name: str) -> 'StorageObjectCollection': result = StorageObjectCollection() for storage_object in self: if storage_object.name == name: result.add(storage_object) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collection_find_by_name(self, name):\n raise Exception(\"NEVER BEEN TESTED!\")\n try:\n return CastleCollection(name, self, look_for_name=True)\n except:\n raise", "def get_obj(cls, container, name):\n\n for obj in container:\n if obj.name == name:...
[ "0.67676127", "0.66511506", "0.64123625", "0.63516635", "0.63055855", "0.62963516", "0.62313825", "0.61662656", "0.61442083", "0.60885876", "0.60579133", "0.5970078", "0.5946046", "0.59425235", "0.5908228", "0.5859953", "0.5754233", "0.5726119", "0.5709372", "0.5676487", "0.5...
0.8885192
0
Return all StorageObjects in this collection as a list
def all_objects(self) -> List[StorageObject]: return [item for item in self._store.values()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all(self):\n return FileStorage.__objects", "def all(self):\n return FileStorage.__objects", "def all(self):\n return FileStorage.__objects", "def get_objects(self):\r\n bucket = self._get_bucket()\r\n objs = []\r\n for key in bucket:\r\n objs.append(k...
[ "0.78049266", "0.78049266", "0.78049266", "0.7471495", "0.7341949", "0.7190397", "0.69481677", "0.68407756", "0.6689236", "0.6654563", "0.6643759", "0.6642281", "0.6635458", "0.6585769", "0.65833503", "0.65833503", "0.65833503", "0.65833503", "0.65833503", "0.65833503", "0.65...
0.8522565
0
The set of arguments for constructing a DataIntegration resource.
def __init__(__self__, *, kms_key: pulumi.Input[str], schedule_config: pulumi.Input['DataIntegrationScheduleConfigArgs'], source_uri: pulumi.Input[str], description: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__,\n resource_name: str,\n args: DataIntegrationArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...", "def __init__(__self__,\n resource_name: str,\n opts: Optional[pulumi.ResourceOptions] = None,...
[ "0.76459354", "0.65185326", "0.6284663", "0.62347496", "0.6072901", "0.5998088", "0.5948348", "0.5936615", "0.5914055", "0.58974063", "0.5886617", "0.58800066", "0.58713657", "0.58633226", "0.5860326", "0.58513266", "0.58349276", "0.58241624", "0.5815463", "0.58131826", "0.58...
0.55254614
96
Specifies the KMS key Amazon Resource Name (ARN) for the Data Integration.
def kms_key(self) -> pulumi.Input[str]: return pulumi.get(self, "kms_key")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kms_key_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"kms_key_arn\")", "def kms_key_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"kms_key_arn\")", "def kms_key_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"kms_key...
[ "0.74931383", "0.74931383", "0.71421015", "0.6641949", "0.6641949", "0.6641949", "0.6579134", "0.6503104", "0.6503104", "0.6447976", "0.62465423", "0.62465423", "0.62465423", "0.62465423", "0.62460285", "0.6245138", "0.6179588", "0.6179588", "0.6179588", "0.6179588", "0.61795...
0.67058694
3
Specifies the name of the Data Integration.
def name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_source_name(self, data_source_name):\n\n self._data_source_name = data_source_name", "def define_name(self):\n\n self._name = 'dwi-noddi'", "def name(self, name):\n self._name = name", "def name(self, name):\n self._name = name", "def name(self, name):\n self._na...
[ "0.6678785", "0.6651162", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65167475", "0.6504857", "0.6504857", "0.6504857", "0.6504857", "0.6496784", "0....
0.0
-1
Tags to apply to the Data Integration. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the providerlevel.
def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: return pulumi.get(self, "tags")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_tags(self) -> str:\n tags = [\"persistent\"]\n if self.id_tag:\n tags.append(self.id_tag)\n tags.append(\"dismissable\" if self.is_dismissable else \"undismissable\")\n tags.append(\"safe\" if self.mark_content_safe else \"unsafe\")\n return \" \".join(tags...
[ "0.5867141", "0.57960916", "0.57271373", "0.57156086", "0.5672781", "0.5630762", "0.55945444", "0.5491105", "0.5482737", "0.54638237", "0.5441341", "0.5441341", "0.5441341", "0.54171884", "0.53731775", "0.5302327", "0.5302327", "0.5302327", "0.5302327", "0.5302327", "0.530232...
0.0
-1
The Amazon Resource Name (ARN) of the Data Integration.
def arn(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"arn\")", "def arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"arn\")", "def arn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"arn\")", "def arn(self) -> pulumi.Output[str]:\n return pulumi.get...
[ "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984", "0.73644984"...
0.68103695
59
Specifies the KMS key Amazon Resource Name (ARN) for the Data Integration.
def kms_key(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "kms_key")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kms_key_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"kms_key_arn\")", "def kms_key_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"kms_key_arn\")", "def kms_key_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"kms_key...
[ "0.74931383", "0.74931383", "0.71421015", "0.67058694", "0.6641949", "0.6641949", "0.6641949", "0.6579134", "0.6503104", "0.6503104", "0.62465423", "0.62465423", "0.62465423", "0.62465423", "0.62460285", "0.6245138", "0.6179588", "0.6179588", "0.6179588", "0.6179588", "0.6179...
0.6447976
10
Specifies the name of the Data Integration.
def name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_source_name(self, data_source_name):\n\n self._data_source_name = data_source_name", "def define_name(self):\n\n self._name = 'dwi-noddi'", "def name(self, name):\n self._name = name", "def name(self, name):\n self._name = name", "def name(self, name):\n self._na...
[ "0.6678785", "0.6651162", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65167475", "0.6504857", "0.6504857", "0.6504857", "0.6504857", "0.6496784", "0....
0.0
-1
Tags to apply to the Data Integration. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the providerlevel.
def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: return pulumi.get(self, "tags")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_tags(self) -> str:\n tags = [\"persistent\"]\n if self.id_tag:\n tags.append(self.id_tag)\n tags.append(\"dismissable\" if self.is_dismissable else \"undismissable\")\n tags.append(\"safe\" if self.mark_content_safe else \"unsafe\")\n return \" \".join(tags...
[ "0.58648264", "0.57958984", "0.57270074", "0.57155323", "0.56727374", "0.5630112", "0.5593873", "0.54900074", "0.54823184", "0.54640704", "0.5442516", "0.5442516", "0.5442516", "0.54174817", "0.53738093", "0.5303477", "0.5303477", "0.5303477", "0.5303477", "0.5303477", "0.530...
0.0
-1
A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
def tags_all(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: return pulumi.get(self, "tags_all")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi....
[ "0.7442922", "0.7442922", "0.74372643", "0.74372643", "0.74372643", "0.74372643", "0.71595305", "0.7096487", "0.70816255", "0.70577693", "0.69300693", "0.6916472", "0.68235135", "0.67972314", "0.67532057", "0.6701463", "0.66302735", "0.66302735", "0.66302735", "0.66302735", "...
0.0
-1
The Amazon Resource Name (ARN) of the Data Integration.
def arn(self) -> pulumi.Output[str]: return pulumi.get(self, "arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return p...
[ "0.7360675", "0.7360675", "0.7360675", "0.7360675", "0.7360675", "0.7046089", "0.696861", "0.69407207", "0.69407207", "0.69287246", "0.690667", "0.690667", "0.690667", "0.68578607", "0.68103695", "0.68103695", "0.68103695", "0.68103695", "0.68103695", "0.68103695", "0.6810369...
0.73644984
20
Specifies the KMS key Amazon Resource Name (ARN) for the Data Integration.
def kms_key(self) -> pulumi.Output[str]: return pulumi.get(self, "kms_key")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kms_key_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"kms_key_arn\")", "def kms_key_arn(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"kms_key_arn\")", "def kms_key_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"kms_key...
[ "0.74931383", "0.74931383", "0.71421015", "0.67058694", "0.6641949", "0.6641949", "0.6641949", "0.6579134", "0.6503104", "0.6503104", "0.6447976", "0.62465423", "0.62465423", "0.62465423", "0.62465423", "0.6245138", "0.6179588", "0.6179588", "0.6179588", "0.6179588", "0.61795...
0.62460285
15
Specifies the name of the Data Integration.
def name(self) -> pulumi.Output[str]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_source_name(self, data_source_name):\n\n self._data_source_name = data_source_name", "def define_name(self):\n\n self._name = 'dwi-noddi'", "def name(self, name):\n self._name = name", "def name(self, name):\n self._name = name", "def name(self, name):\n self._na...
[ "0.6678785", "0.6651162", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65699786", "0.65167475", "0.6504857", "0.6504857", "0.6504857", "0.6504857", "0.6496784", "0....
0.0
-1
Tags to apply to the Data Integration. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the providerlevel.
def tags(self) -> pulumi.Output[Optional[Mapping[str, str]]]: return pulumi.get(self, "tags")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_tags(self) -> str:\n tags = [\"persistent\"]\n if self.id_tag:\n tags.append(self.id_tag)\n tags.append(\"dismissable\" if self.is_dismissable else \"undismissable\")\n tags.append(\"safe\" if self.mark_content_safe else \"unsafe\")\n return \" \".join(tags...
[ "0.5865286", "0.5795028", "0.57262284", "0.57162976", "0.5673484", "0.5629419", "0.55921173", "0.5490613", "0.5482501", "0.546356", "0.5440562", "0.5440562", "0.5440562", "0.5416105", "0.53724253", "0.53015757", "0.53015757", "0.53015757", "0.53015757", "0.53015757", "0.53015...
0.0
-1
A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
def tags_all(self) -> pulumi.Output[Mapping[str, str]]: return pulumi.get(self, "tags_all")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi....
[ "0.74431396", "0.74431396", "0.743729", "0.743729", "0.743729", "0.743729", "0.7158087", "0.70961046", "0.70812654", "0.7056976", "0.6930697", "0.69170326", "0.68244463", "0.67974514", "0.6752651", "0.67016584", "0.66306543", "0.66306543", "0.66306543", "0.66306543", "0.66306...
0.6411191
60
String for representing the Model object.
def __str__(self): return str(self.pic)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self):\n return \"DataModel(name={},attributes={},description={})\".format(\n self.name, {a.name: str(a) for a in self.attributes}, self.description\n )", "def __str__(self):\n \n res =...
[ "0.82368803", "0.79901737", "0.7849152", "0.78468513", "0.77520275", "0.7625378", "0.7625378", "0.76225406", "0.76225406", "0.75483394", "0.7522958", "0.7470355", "0.7469358", "0.7447144", "0.7447144", "0.74314755", "0.7427648", "0.7389925", "0.7351721", "0.73424315", "0.7322...
0.0
-1
returns url of next page
def find_next_page(soup): base = "https://www.cdc.gov.tw" next_page = soup.find_all("a", rel="next", text="下一頁") if next_page: next_url = base + next_page[0]["href"] return next_url else: None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_next_page_url(self, response):\n return None", "def next_url(request):\n next = request.REQUEST.get(\"next\", \"\")\n host = request.get_host()\n return next if next and is_safe_url(next, host=host) else None", "def nextURL(self):\n return self.wizard.nextURL", "def next_url(se...
[ "0.8290349", "0.81363636", "0.8075945", "0.79853827", "0.79681677", "0.7830608", "0.77928525", "0.77043283", "0.7612347", "0.7605529", "0.7599506", "0.75714266", "0.75233227", "0.74588686", "0.7410139", "0.7398786", "0.73506314", "0.7319363", "0.7250058", "0.7204416", "0.7155...
0.7482667
13
searches for target in int_list[low..high] and returns index if found If target is not found returns None. If list is None, raises ValueError
def bin_search(target, low, high, int_list): # must use recursion if int_list == None: raise ValueError("Must be a list") middle = (low + high) // 2 if low > high: return None if int_list[middle] > target: return bin_search(target, low, middle - 1, int_list) if int_list[middle] < t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bin_search(target, low, high, int_list): # must use recursion\n if int_list == None:\n raise ValueError\n if len(int_list) == 0:\n return None\n middle = (low + high) // 2\n if low > high or low < 0 or high > len(int_list):\n return None\n elif int_list[middle] == target:\n retur...
[ "0.78057975", "0.76300216", "0.7628147", "0.7616939", "0.7502047", "0.7131072", "0.7062548", "0.7030497", "0.7007689", "0.69068366", "0.68500876", "0.6822365", "0.68209255", "0.6785105", "0.67299217", "0.6692448", "0.6691608", "0.66910535", "0.6679178", "0.66237825", "0.66197...
0.77216744
1
columns in each row matches column headers. Partial test that commas in fields were escaped correctly.
def test_num_columns(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_header_row(self, strdata):\n debug = False\n comma_dec_sep_ok = True\n if debug: print(strdata)\n if len(strdata) < 2: ## a header row needs a following row to be a header\n return False\n row1_types = [lib.get_val_type(val, comma_dec_sep_ok) \n for...
[ "0.63913846", "0.6322381", "0.6206363", "0.6188817", "0.60749954", "0.6049709", "0.6028108", "0.6023561", "0.6010636", "0.6009025", "0.596032", "0.59340733", "0.59254736", "0.59246445", "0.5923742", "0.5910188", "0.58981776", "0.58895016", "0.58892226", "0.58696645", "0.58651...
0.0
-1
View function for home page of our catalog app
def index(request): # Generate counts of main objects num_books = Book.objects.all().count() num_instances = BookInstance.objects.all().count() # Available books num_instances_available = BookInstance.objects.filter(status__exact=BookInstance.AVAILABLE).count() # Authors num_authors = Aut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home(request):\n\treturn render(request, \"compta/home.html\")", "def homepage(request):\n\treturn render(request, 'core/homepage.html')", "def homepage(request):\n return render_to_response('h1ds_core/homepage.html', \n context_instance=RequestContext(request))", "def hom...
[ "0.7972356", "0.77871716", "0.7737987", "0.7657246", "0.7643873", "0.76135135", "0.7607832", "0.75653404", "0.7543884", "0.7488783", "0.74873537", "0.74750006", "0.7457853", "0.7451618", "0.74393106", "0.74376374", "0.7437026", "0.74159425", "0.7397599", "0.73939735", "0.7392...
0.0
-1
Return a view to use as the API root.
def get_api_root_view(self, api_urls=None): api_root_dict = OrderedDict() list_name = self.routes[0].name for prefix, viewset, basename in self.registry: api_root_dict[prefix] = list_name.format(basename=basename) registry = self.registry name = self.name desc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_api_root_view(self):\n api_root_dict = {}\n list_name = self.routes[0].name\n for prefix, viewset, basename in self.registry:\n api_root_dict[prefix] = list_name.format(basename=basename)\n\n class APIRoot(views.APIView):\n _ignore_model_permissions = True\...
[ "0.8156992", "0.7414068", "0.7298024", "0.71469635", "0.70345426", "0.70345426", "0.70345426", "0.7007782", "0.69690424", "0.6904303", "0.685838", "0.6843567", "0.68409103", "0.68318844", "0.67578167", "0.6753709", "0.67217803", "0.66900116", "0.6664957", "0.6649356", "0.6638...
0.724371
3
If a user id is stored in the session, load the user object from the database into ``g.user``.
def load_logged_in_user(): user_id = session.get("user_id") if user_id is None: g.user = None else: g.user = ( get_db().execute("SELECT * FROM user WHERE id = ?", (user_id,)).fetchone() )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_logged_in_user():\n\n user_id = session.get('user_id')\n\n if user_id is not None:\n g.user = get_db().execute(\n 'SELECT * FROM user WHERE id = ?', [user_id]\n ).fetchone()\n else:\n g.user = None", "def load_user():\n if session.get(\"user_id\"):\n us...
[ "0.86495817", "0.86198115", "0.8413379", "0.8293096", "0.82063067", "0.819206", "0.789397", "0.7871321", "0.7830225", "0.7822424", "0.7765826", "0.7765826", "0.7765826", "0.7765826", "0.7765613", "0.7759568", "0.7759568", "0.7759568", "0.7759568", "0.7759568", "0.7759568", ...
0.86918235
1
Update a post if the current user is the author.
def adminedit(object, id): db = get_db() if request.method == "POST": execute_string = 'UPDATE ' + object.title() + " SET " if object == 'post': execute_string += 'title = "' + request.form['title'] + '", content = "' + request.form['content'] + '", authorId = ' + request.form["au...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, request, pk=None):\n user = RareUser.objects.get(user=request.auth.user)\n\n # Do mostly the same thing as POST, but instead of\n # creating a new instance of Post, get the Post record\n # from the database whose primary key is `pk`\n post = Post.objects.get(pk=p...
[ "0.6402288", "0.63080543", "0.6191634", "0.6187933", "0.6152581", "0.61517787", "0.6136023", "0.61076", "0.60637295", "0.5993216", "0.59245545", "0.591297", "0.59033036", "0.5816044", "0.57806003", "0.5779193", "0.57767224", "0.57723206", "0.57613695", "0.5746237", "0.5740192...
0.0
-1
Delete a post. Ensures that the post exists and that the logged in user is the author of the post.
def admindelete(object, id): db = get_db() execute_str = 'DELETE FROM ' + object + ' WHERE id = ' + str(id) db.execute(execute_str) db.commit() return redirect(url_for("adminview", object=object))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_post(request, post_id):\n post = Post.objects.get(id=post_id)\n\n check_post_owner(request, post)\n post.delete()\n\n return redirect('/posts')", "def delete_post(post_id):\n\n if CURRENT_USER_KEY not in session:\n raise Unauthorized()\n\n post = Post.query.get_or_404(post_id)...
[ "0.82031965", "0.8147868", "0.79974276", "0.79791605", "0.795231", "0.7889284", "0.7818166", "0.780275", "0.7791886", "0.7790292", "0.77895135", "0.7640452", "0.7622604", "0.7566871", "0.74835986", "0.7420969", "0.74029267", "0.7326913", "0.72961706", "0.71755576", "0.7161776...
0.0
-1
View decorator that redirects anonymous users to the login page.
def login_required(view): @functools.wraps(view) def wrapped_view(**kwargs): if g.user is None: return redirect(url_for("login")) return view(**kwargs) return wrapped_view
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login_required(view):\n\n @functools.wraps(view)\n def wrapped_view(**kwargs):\n if g.user is None:\n return redirect(url_for(\"auth.login\"))\n\n return view(**kwargs)\n\n return wrapped_view", "def login_required(view):\n\n @functools.wraps(view)\n def wrapped_view(*...
[ "0.76936996", "0.76936996", "0.76673865", "0.758813", "0.742035", "0.7351566", "0.7307617", "0.723159", "0.71720594", "0.71177274", "0.70479155", "0.70386076", "0.7037009", "0.70323974", "0.7022595", "0.70209605", "0.70107865", "0.7002442", "0.6985365", "0.69602716", "0.69585...
0.7701439
0
Return a list of ofc variable names.
def getOfcVarNames( self ): if self.ofcVarNames: return self.ofcVarNames.keys() n = self.adb.get( "nOfcVars" ) for indx in xrange( n ): name = self.adb.get( "ofcVarName", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def variable_names(self):\n \n return [x['variable'] for x in self.variable_dicts()]", "def get_variable_names(self):\n return [var[1] for var in self.variables]", "def varNames(self):\n return self.__varNames", "def var_names(self):\n return self._var_names", "def get_va...
[ "0.7862883", "0.7816231", "0.7764783", "0.7718953", "0.7616493", "0.7459965", "0.74205774", "0.7317483", "0.72509986", "0.7216723", "0.7150053", "0.70894057", "0.6992133", "0.6990533", "0.6905542", "0.6886886", "0.6884045", "0.68683773", "0.686787", "0.6850925", "0.68422616",...
0.78822166
0
Return the "Run Data" Elapsed Time value.
def getElapseTimes( self ): pars = ( _EVENT_ELAPSED_TIME,0, 0, 0 ) values = self.adbGetEvent( pars ) return values[2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def t(self):\n return self._data_writer.get_current_run_time_ms()", "def ElapsedTime(self):\n if self.force_auto_sync:\n self.get('ElapsedTime')\n return self._ElapsedTime", "def get_time_elapsed(self, pipeline_run):\n begin = pipeline_run[\"steps\"][0][\"method_calls\"][...
[ "0.73431987", "0.7256445", "0.72208256", "0.7059831", "0.70494807", "0.69947976", "0.69548094", "0.685741", "0.6818784", "0.6769749", "0.675608", "0.6704072", "0.66909873", "0.6678845", "0.665975", "0.6646014", "0.6639863", "0.66245663", "0.6608101", "0.6606845", "0.6596319",...
0.613241
76
Return a list of "Linear Iterations" variable names.
def getLinIterVarNames( self ): self.updateAdb( ) return self.iterNames.keys()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_variable_names(self):\n varNames = []\n for var in self.variables:\n # EstimationVariable\n varNames.append(var.name)\n return varNames", "def get_variable_names(self):\n return [var[1] for var in self.variables]", "def variable_names(self):\n \n...
[ "0.68671024", "0.6786807", "0.6747088", "0.6700756", "0.65919495", "0.65165377", "0.64638937", "0.6383871", "0.6312647", "0.6245573", "0.62267584", "0.6211404", "0.618689", "0.61776006", "0.6147943", "0.614727", "0.60928917", "0.5997736", "0.5972225", "0.59659904", "0.5960613...
0.75914377
0
Test the boundary values of the current densities
def test_current_density_boundaries(self): t, x_n, x_p = self.t, self.x_n_edge, self.x_p_edge current_param = self.model.param.current_with_time i_cell = self.param.process_symbol(current_param).evaluate(t=t) np.testing.assert_array_almost_equal(self.i_s_n(t, x_n[0]), i_cell, decimal=2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decision_boundary(self, w, min_x, max_x):\n if np.size(w) < 3:\n w = np.append(w, np.zeros(1))\n x = np.array([min_x, max_x])\n y = -1 * ((w[0] * x) - w[2]) / w[1]\n return x, y", "def make_conditional_density(bgm_fit, threshold, sigma, width):\n pass", "def test_k...
[ "0.59749854", "0.5934604", "0.5918896", "0.59174", "0.58929235", "0.57443094", "0.5736643", "0.5704074", "0.56971514", "0.5676771", "0.5673828", "0.5591843", "0.55914044", "0.55890274", "0.55652213", "0.55293554", "0.5525406", "0.552354", "0.5503028", "0.5499675", "0.54813564...
0.64887184
0
Test the boundary values of the current densities
def test_velocity_boundaries(self): L_x = self.x_edge[-1] np.testing.assert_array_almost_equal(self.v_box(self.t, 0), 0, decimal=4) np.testing.assert_array_almost_equal(self.v_box(self.t, L_x), 0, decimal=4)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_current_density_boundaries(self):\n t, x_n, x_p = self.t, self.x_n_edge, self.x_p_edge\n\n current_param = self.model.param.current_with_time\n\n i_cell = self.param.process_symbol(current_param).evaluate(t=t)\n np.testing.assert_array_almost_equal(self.i_s_n(t, x_n[0]), i_cell...
[ "0.64887184", "0.59749854", "0.5934604", "0.5918896", "0.59174", "0.58929235", "0.57443094", "0.5736643", "0.5704074", "0.56971514", "0.5676771", "0.5673828", "0.5591843", "0.55914044", "0.55890274", "0.55652213", "0.55293554", "0.552354", "0.5503028", "0.5499675", "0.5481356...
0.5525406
17
Test the boundary values of the current densities
def test_vertical_velocity(self): L_x = self.x_edge[-1] np.testing.assert_array_equal(self.dVbox_dz(self.t, 0), 0) np.testing.assert_array_less(self.dVbox_dz(self.t, 0.5 * L_x), 0) np.testing.assert_array_equal(self.dVbox_dz(self.t, L_x), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_current_density_boundaries(self):\n t, x_n, x_p = self.t, self.x_n_edge, self.x_p_edge\n\n current_param = self.model.param.current_with_time\n\n i_cell = self.param.process_symbol(current_param).evaluate(t=t)\n np.testing.assert_array_almost_equal(self.i_s_n(t, x_n[0]), i_cell...
[ "0.64887184", "0.59749854", "0.5934604", "0.5918896", "0.59174", "0.58929235", "0.57443094", "0.5736643", "0.5704074", "0.56971514", "0.5676771", "0.5673828", "0.5591843", "0.55914044", "0.55890274", "0.55652213", "0.55293554", "0.5525406", "0.552354", "0.5503028", "0.5499675...
0.0
-1
Test the boundary values of the current densities
def test_velocity_vs_current(self): t, x_n, x_p = self.t, self.x_n, self.x_p beta_n = self.model.param.beta_n beta_n = self.param.evaluate(beta_n) beta_p = self.model.param.beta_p beta_p = self.param.evaluate(beta_p) np.testing.assert_array_almost_equal( sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_current_density_boundaries(self):\n t, x_n, x_p = self.t, self.x_n_edge, self.x_p_edge\n\n current_param = self.model.param.current_with_time\n\n i_cell = self.param.process_symbol(current_param).evaluate(t=t)\n np.testing.assert_array_almost_equal(self.i_s_n(t, x_n[0]), i_cell...
[ "0.64887184", "0.59749854", "0.5934604", "0.5918896", "0.59174", "0.58929235", "0.57443094", "0.5736643", "0.5704074", "0.56971514", "0.5676771", "0.5673828", "0.5591843", "0.55914044", "0.55890274", "0.55652213", "0.55293554", "0.5525406", "0.552354", "0.5503028", "0.5499675...
0.0
-1
Process 'text' and return a list of unique words sorted by descending word length. During processing, we remove single letters words (1 char). We also remove uncommon words (<1% occurrence).
def process_dict(text, frequency_threshold): # Trying to load previous unique_words (pickle file) UNIQUE_WORDS_PICKLE = "unique_words_with_frequency_" + str(frequency_threshold) + ".pickle" unique_words = None if os.path.isfile(UNIQUE_WORDS_PICKLE): try: with open(UNIQUE_WORDS_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filterWords(text):\n words = text.split()\n out = []\n for w in words:\n w = normalizeOrRemoveWord(w)\n if w != None:\n out.append(w)\n return out", "def _preprocess_text(text: str) -> List[List[str]]:\n\n # replace all except characters_to_keep with space\n charact...
[ "0.7425564", "0.7109993", "0.71092325", "0.7011776", "0.69913656", "0.69835925", "0.6965866", "0.6927025", "0.68715805", "0.68441975", "0.6829975", "0.6824484", "0.6783103", "0.6765471", "0.67580205", "0.6755206", "0.6746778", "0.6730305", "0.6707169", "0.66715544", "0.666599...
0.6382604
46
Returns the number of unrecognized characters
def accuracy(text): return sum(1 for c in text if c.isupper())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_not_ascii_chars(file_path: str) -> int:\n with open(file_path, encoding=\"unicode-escape\") as f:\n text = f.read()\n chars = set(text) - set(\n string.punctuation + string.ascii_letters + string.digits + \"\\n \"\n )\n return sum(text.count(x) for x in chars)", "def count_exc...
[ "0.63695556", "0.6336252", "0.6311099", "0.62521166", "0.62361944", "0.6234435", "0.621606", "0.6212845", "0.6194593", "0.6137384", "0.6122823", "0.6118639", "0.6113598", "0.61131597", "0.60895246", "0.6068835", "0.6061821", "0.6020991", "0.5989862", "0.59800684", "0.59691167...
0.0
-1
Renders the about page.
def about(): return render_template( 'about.html', title='About', year=datetime.now().year, message='Your application description page.' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n return render_template('about.html', title='About')", "def about():\n\n return render_template('about_page.html', title='About')", "def about():\n\n\treturn render_template(\"about.html\")", "def on_about(self):\n render_about_window()", "def about():\n return render_temp...
[ "0.85650355", "0.85034525", "0.84489655", "0.84044397", "0.8394454", "0.82935613", "0.82680845", "0.8243358", "0.8239194", "0.8224137", "0.82079816", "0.8204868", "0.8173699", "0.8172736", "0.80967313", "0.80501616", "0.80501616", "0.80501616", "0.80501616", "0.80501616", "0....
0.82709616
18
Return zerofilled state tensor(s).
def zero_state(self, batch_size: int) ->State: self.init_batch() if isinstance(self._cell, nn.RNNCellBase): state = self._param.new_zeros(batch_size, self.hidden_size, requires_grad=False) else: state = self._cell.zero_state(batch_size) return state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state(self):\n return self.kf.x[:self.dim_z].squeeze()", "def _initalize_state(self):\n\n self.memories.append(tf.tanh(\n tf.random_normal(shape=(self.memory_capacity, self.memory_vector_size), stddev=0.5)))\n self.ww_t.append(tf.nn.softmax(tf.range(self.memory_capacity, 0...
[ "0.67729384", "0.672447", "0.6591672", "0.6533953", "0.6494861", "0.6460667", "0.6416913", "0.63804805", "0.6361935", "0.6307033", "0.628512", "0.6273841", "0.6226347", "0.62200624", "0.61977154", "0.61804706", "0.6178367", "0.61525095", "0.61036015", "0.60905117", "0.6083528...
0.0
-1
The list of parallel layers.
def layers(self) ->Optional[nn.ModuleList]: return self._layers
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def layers(self):\n return self['layers']", "def layers(self):\r\n return self._flc.layers", "def layer_names(self) -> List[str]:\n _all_layers = []\n if self.category == \"ML\":\n pass\n elif self.config['backend'] == 'tensorflow':\n for layer in self.l...
[ "0.69755846", "0.6856828", "0.6770275", "0.6664219", "0.66403", "0.64759725", "0.63526213", "0.6340863", "0.6281926", "0.6274042", "0.62188435", "0.6176646", "0.6153472", "0.6130182", "0.60983425", "0.6089973", "0.60828465", "0.60231495", "0.5991036", "0.5984364", "0.5980836"...
0.7041206
0
Converts `hparams` value into a list.
def _to_list(value: Union[Dict[str, Any], List, Tuple, int], name=None, list_length=None): if not isinstance(value, (list, tuple)): if list_length is not None: value = [value] * list_length else: value = [value] if list_length is not None and len(value) != list_length: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_params_to_list(self,params):\n result = {}\n for i in params:\n result_list = []\n result_list.append(params[i])\n result[i] = result_list\n return result", "def get_params(hf):\n plist = []\n for p in hf['/input/params']:\n val = hf[...
[ "0.70637614", "0.6902682", "0.6571548", "0.6500658", "0.6435092", "0.6218967", "0.6079537", "0.60396254", "0.60060585", "0.5918538", "0.590895", "0.5864389", "0.58227944", "0.577866", "0.57553655", "0.574345", "0.57264084", "0.5715251", "0.5706159", "0.56947213", "0.565961", ...
0.703456
1
Return a mask tensor representing the first N positions of each cell. If ``lengths`` has shape ``[d_1, d_2, ..., d_n]`` the resulting tensor ``mask`` has dtype ``dtype`` and shape ``[d_1, d_2, ..., d_n, maxlen]``, with ``` mask[i_1, i_2, ..., i_n, j] = (j < lengths[i_1, i_2, ..., i_n]) ```
def sequence_mask(lengths: Union[torch.LongTensor, List[int]], max_len: Optional[int]=None, dtype: Optional[torch.dtype]=None, device: Optional[torch.device]=None) ->torch.ByteTensor: if not isinstance(lengths, torch.Tensor): lengths = torch.tensor(lengths, device=device) elif device is None: de...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_mask(maxlen, lengths):\n lens = lengths.unsqueeze(0)\n ran = torch.arange(0, maxlen, 1, out=lengths.new()).unsqueeze(1)\n mask = ran < lens\n return mask", "def sequence_mask(lengths, max_len=None):\n batch_size = lengths.numel()\n max_len = max_len or lengths.max()\n return (torc...
[ "0.7323974", "0.7040619", "0.7036485", "0.70173013", "0.69374233", "0.67276675", "0.62948054", "0.6231007", "0.6192058", "0.60851383", "0.60154355", "0.5837902", "0.58338845", "0.58338845", "0.5819686", "0.5729318", "0.5710565", "0.5618136", "0.56000894", "0.5574304", "0.5546...
0.7442542
0
Returns the zero state for LSTMs as (h, c).
def zero_state(self, batch_size: int) ->LSTMState: state = self._param.new_zeros(batch_size, self.hidden_size, requires_grad=False) return state, state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_zero(cls, h):\n shapes = QuantizedCheckpoint.make_shaped_arrays(h)\n return jax.tree_util.tree_map(lambda s: np.zeros(s.shape, s.dtype), shapes)", "def init_zero(cls, h):\n shapes = Checkpoint.make_shaped_arrays(h)\n return jax.tree_util.tree_map(lambda s: np.zeros(s.shape, s.dtype), shapes)...
[ "0.6410604", "0.62623477", "0.620345", "0.61738455", "0.6122319", "0.60933435", "0.5960164", "0.594117", "0.5940279", "0.5808605", "0.5801793", "0.5746132", "0.570258", "0.56418085", "0.56201386", "0.554389", "0.5503873", "0.54750776", "0.5418754", "0.5418499", "0.54037756", ...
0.57910335
11
Internal implementation of Dynamic RNN.
def _dynamic_rnn_loop(cell: RNNCellBase[State], inputs: torch.Tensor, initial_state: State, sequence_length: torch.LongTensor) ->Tuple[torch.Tensor, State]: state = initial_state time_steps = inputs.shape[0] all_outputs = [] all_state = map_structure(lambda _: no_map(list), state) for i in range(tim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, num_policies: int, num_layers: int, \n hidden_dim: int, learning_rate: float, repetitions: int):\n super().__init__()\n\n self.input_size = num_policies * 2\n self.num_layers = num_layers\n self.hidden_dim = hidden_di...
[ "0.66677976", "0.65440017", "0.6478519", "0.64050144", "0.6329873", "0.63090026", "0.6286416", "0.6183975", "0.6180608", "0.6170397", "0.61547375", "0.6107966", "0.604121", "0.601837", "0.59975", "0.5976498", "0.5963985", "0.59586805", "0.594986", "0.5932652", "0.5909595", ...
0.0
-1
Sum a list of tensors with possible `None` values.
def sum_tensors(xs: List[Optional[torch.Tensor]]) ->Optional[torch.Tensor]: idx = next((idx for idx, tensor in enumerate(xs) if tensor is not None), -1) if idx == -1: return None ret = xs[idx] for tensor in xs[idx + 1:]: if tensor is not None: ret = ret + tensor return re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum(lists) -> list:\r\n return list(np.sum(lists, 0))", "def sum_node_list(node_list):\n node_list = [n for n in node_list if n is not None]\n if node_list == []:\n return None\n\n from operator import add\n from functools import reduce\n return reduce(add, node_list)", "def sum(cl...
[ "0.66326904", "0.65105075", "0.6487823", "0.64877594", "0.6404661", "0.62450856", "0.61337066", "0.6090988", "0.60879225", "0.6022219", "0.59632504", "0.5946418", "0.59236807", "0.5918507", "0.5863071", "0.58305854", "0.5793954", "0.5681076", "0.5680801", "0.5639611", "0.5606...
0.84486973
0
Construct the output layer for decoders. Based on the input, multiple
def _make_output_layer(layer: Optional[Union[nn.Module, torch.Tensor]], vocab_size: Optional[int], output_size: int, bias: bool) ->Tuple[nn.Module, Optional[int]]: if isinstance(layer, nn.Module): output_layer = layer elif layer is None: if vocab_size is None: raise ValueError('Eithe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decoder_model(self, input_shape, layers, filters, latent_dims):\n\n flat_dims = self.encoder.get_layer('Flatten_dims').output_shape\n pool_dims = self.encoder.get_layer('Flatten_dims').input_shape\n\n latent_inputs = Input(shape=(latent_dims,), name='z_sampling')\n latent_to_reshape...
[ "0.68438786", "0.6797545", "0.6795138", "0.6774239", "0.67450273", "0.6652517", "0.6643237", "0.66251934", "0.6595681", "0.659029", "0.65561587", "0.65364033", "0.6514978", "0.6474016", "0.64730227", "0.6458454", "0.64565337", "0.6455835", "0.6451083", "0.6428461", "0.6420045...
0.0
-1
Reshapes first two dimensions in to single dimension.
def _merge_beam_dim(tensor: Any) ->Any: if not isinstance(tensor, torch.Tensor): return tensor shape = list(tensor.size()) shape[0] *= shape[1] shape.pop(1) return tensor.view(tuple(shape))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resh(x):\r\n a = x.shape[0]\r\n b = x.shape[1]\r\n return x.reshape(a*b, 1), a, b", "def flatten(x):\n return reshape(x, (x.shape[0], -1))", "def reshape(x, shape):\n return Reshape(shape)(x)", "def numpyReshape(array):\n return np.array(array, dtype = float).reshape(1, len(array))"...
[ "0.7161712", "0.6992128", "0.6979306", "0.6692753", "0.6679103", "0.66787946", "0.662406", "0.6601484", "0.65690154", "0.6550847", "0.6534797", "0.6457269", "0.64296025", "0.6394419", "0.6382726", "0.6381504", "0.63779306", "0.63618654", "0.63511556", "0.62835413", "0.6271168...
0.0
-1
Computes the ith coordinate that contains the batch index for gathers. The batch index tensor is a tensor like `[[0,0,0,0,],[1,1,1,1],..]`. It says which batch the beam item is in. This will create the first dimension of the 2D coordinates needed for the gather.
def compute_batch_indices(batch_size: int, beam_size: int) ->torch.LongTensor: batch_pos = torch.arange(batch_size) batch_pos = batch_pos.view(-1, 1).expand(batch_size, beam_size) return batch_pos
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_batch_indices(batch_size, beam_size):\n batch_range = tf.range(batch_size * beam_size) // beam_size\n batch_index_matrix = tf.reshape(batch_range, [batch_size, beam_size])\n return batch_index_matrix", "def __getitem__(self, index):\n # get the indexs of each batch\n batch_inde...
[ "0.6617969", "0.65488803", "0.6271884", "0.6240554", "0.6240554", "0.6238017", "0.6182255", "0.6148879", "0.6125355", "0.60151905", "0.5988162", "0.59315735", "0.59269476", "0.58845836", "0.5881334", "0.5881334", "0.58509016", "0.5848212", "0.5840172", "0.5840172", "0.5839838...
0.6820383
0
Inner beam search loop. This function takes the current alive sequences, and grows them to topk sequences where `k = 2 beam`. We use `2 beam` because we could have `beam_size` number of sequences that might hit `` and there will be no alive sequences to continue. With `2 beam_size`, this will not happen. This relies on...
def grow_topk(i: int, alive_seq: torch.LongTensor, alive_log_probs: torch.Tensor, states: Optional[State]) ->Tuple[torch.LongTensor, torch.Tensor, torch.Tensor, torch.ByteTensor, Optional[State]]: flat_ids = alive_seq.view(batch_size * beam_size, -1) if states is not None: flat_states = map_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beam_search(model, images, beam_size, max_caption_len=20, \n store_alphas=False, store_beam=False, print_beam=False, image_retrieval=None, target_lookup=None):\n\n # the max beam size is the dictionary size - 1, since we never select pad\n beam_size = min(beam_size, model.decoder.vocab_siz...
[ "0.70174843", "0.6944386", "0.677953", "0.672946", "0.67252564", "0.6576051", "0.6539326", "0.65253574", "0.64776975", "0.6330448", "0.6317998", "0.62773734", "0.62502885", "0.6233995", "0.60848117", "0.6057357", "0.60504663", "0.6041789", "0.6041006", "0.6015194", "0.5966343...
0.6478405
8
Reverses variable length slices. This op first slices input along the dimension batch_axis, and for each slice i, reverses the first seq_lengths[i] elements along the dimension seq_axis. The elements of seq_lengths must obey seq_lengths[i] <= input.dims[seq_dim], and seq_lengths must be a vector of length input.dims[ba...
def reverse_sequence(inputs: torch.Tensor, seq_lengths: Union[torch.LongTensor, List[int]], time_major: bool) ->torch.Tensor: if time_major: inputs = inputs.permute(1, 0, 2) batch_size = inputs.shape[0] outputs = inputs.clone() for i in range(batch_size): outputs[i][0:seq_lengths[i]] = t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse_padded_sequence(inputs, lengths, batch_first=True):\n\n if not batch_first:\n inputs = inputs.transpose(0, 1)\n if inputs.size(0) != len(lengths):\n raise ValueError('inputs incompatible with lengths.')\n reversed_indices = [list(range(inputs.size(1)))\n fo...
[ "0.75962174", "0.7280839", "0.66457283", "0.5982434", "0.58175737", "0.5648734", "0.5644082", "0.5644082", "0.563861", "0.55824196", "0.5484033", "0.53989273", "0.53792703", "0.53227687", "0.5251801", "0.51728594", "0.5137741", "0.51356155", "0.51111305", "0.50666165", "0.502...
0.7554496
1
Add separator to string s unless s is empty.
def sep(s): return ' '+s if s else s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _handle_separator(sep):\n if sep is None or sep == \"\":\n return \",\"\n else:\n return str(sep)", "def robust_join(s, sep=','):\n return sep.join([str(e) for e in s])", "def join_link(s, separator):\n if s == empty:\n return ''\n elif rest(s) == empty:\n return ...
[ "0.6670447", "0.6244563", "0.6112085", "0.60593575", "0.6057293", "0.60459346", "0.59691995", "0.5958554", "0.56658715", "0.5567393", "0.5560497", "0.55166143", "0.54544437", "0.5405143", "0.5375599", "0.5342119", "0.533436", "0.533436", "0.5271891", "0.52673984", "0.52054685...
0.7836117
0
Renders the home page of the app.
def home(request): rel_sup_csv_form = RelationSupportCSVDatasetForm() queries_csv_form = QueriesCSVDatasetForm() text_file_form = TextDatasetForm() article_url_form = NewsArticleURLForm() ind_sent_form = IndividualSentenceForm() html_files_form = HTMLFilesForm() data = [] for i in result...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n\n return render_template('home_page.html')", "def home():\n\n return render_template(\"home.html\")", "def home():\n return render_template(\n 'index.html'\n )", "def home():\n return render_template('home...
[ "0.84844905", "0.83781946", "0.8198086", "0.8193231", "0.81694674", "0.8136743", "0.81289333", "0.8124271", "0.8124271", "0.8124271", "0.8124271", "0.8124271", "0.8124271", "0.8124271", "0.8124271", "0.8124271", "0.8124271", "0.8124271", "0.8124271", "0.8124271", "0.8124271",...
0.0
-1
Formating timezone for given location
def time_zone(self): g = geocoders.GoogleV3() #Gives the name of the timezone, ex: Africa/Luanda timezone_name = str(g.timezone((self.latitude_value(), self.longitude_value()))) #Returns the numeric value of the timezone, ex: +0100 return int(pytz.timezone(timezone_name).localize(datetime.datetime(2011,1,1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timezone():\n \n pass", "def _format_timezone_offset(converted_time):\n\n # Windows treats %z in the format string as %Z, so we compute the hour/minute offset\n # manually.\n if converted_time.tm_isdst == 1 and time.daylight:\n utc_offset_secs = time.altzone\n else...
[ "0.65743685", "0.64035714", "0.6288516", "0.6154839", "0.6121844", "0.5939017", "0.5897198", "0.58085614", "0.5798201", "0.5742948", "0.5707017", "0.55757976", "0.55653167", "0.5552474", "0.5550013", "0.55338913", "0.55255336", "0.5502818", "0.5491282", "0.5437359", "0.540808...
0.5451533
19
Opens a new database connection if there is none yet for the current application context.
def get_db(): if not hasattr(g, 'sqlite_db'): g.sqlite_db = connect_db() return g.sqlite_db
{ "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.7737639", "0.7582971", "0.73180443", "0.71693045", "0.70220166", "0.6966687", "0.6954785", "0.69486743", "0.6897534", "0.6842663", "0.68292314", "0.68191963", "0.680592", "0.67950195", "0.67697805", "0.6762173", "0.6751266", "0.6746273", "0.67316663", "0.670031", "0.668866...
0.640242
84
Gets all non abstract subclasses for a given base class
def get_subclasses(base_class: callable) -> list: all_subclasses = [] for subclass in base_class.__subclasses__(): if not inspect.isabstract(subclass): all_subclasses.append(subclass) all_subclasses.extend(get_subclasses(subclass)) return all_subclasses
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_subclasses(base_class: Type[T]) -> Set[Type[T]]:\n return set(base_class.__subclasses__()).union(s for c in base_class.__subclasses__() for s in get_all_subclasses(c))", "def get_all_subclasses(python_class):\n python_class.__subclasses__()\n\n subclasses = set()\n check_these = [python_c...
[ "0.77191186", "0.7561576", "0.75522846", "0.74162066", "0.7319827", "0.72425413", "0.7223953", "0.71469486", "0.71469486", "0.7049079", "0.7022888", "0.6994366", "0.69819957", "0.69585615", "0.6957567", "0.69060796", "0.69027966", "0.68605274", "0.6837855", "0.68349123", "0.6...
0.76843303
1
Configures and adds IP cores that are necessary for selected IP cores. No IP core is configured and added, so this just returns an empty list.
def add_ip_cores(self, scfg, ip_dir): return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cores(self):\n return int(self.get('cores'))", "def check_cores(self):\n\n cores = []\n # Execute command to check for cores\n header = [\"VDC\", \"Module\", \"Instance\",\n \"Process-name\", \"PID\", \"Date\\(Year-Month-Day Time\\)\"]\n\n if self.device.al...
[ "0.6136961", "0.6099519", "0.60178226", "0.5870127", "0.5865576", "0.5858968", "0.5801597", "0.5779346", "0.5767728", "0.5749139", "0.5705584", "0.5700442", "0.5538788", "0.54733014", "0.54590845", "0.54116845", "0.53729844", "0.532003", "0.52139765", "0.5193925", "0.51507235...
0.8007833
0
Method to split lists into chunks (number of items in each list = num_items_in_list).
def split_chunks(item_list, num_items_in_list): for item in range(0, len(item_list), num_items_in_list): # Create an index range for item_list of num_items_in_list items: yield item_list[item:item + num_items_in_list]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chunked(list_: List, chunksize: int=20) -> List[List]:\n chunks: List[List] = []\n for i in range(0, len(list_), chunksize):\n chunks.append(list_[i:i + chunksize])\n return chunks", "def ghetto_split(list_, chunk_size=100):\n logging.debug(f\"Splitting list of {len(list_)} length, chunk s...
[ "0.79190016", "0.7791639", "0.7788579", "0.7787102", "0.7778837", "0.7778699", "0.7651847", "0.76257414", "0.75488055", "0.7503553", "0.7502933", "0.7495385", "0.7446123", "0.7393485", "0.7378975", "0.72674", "0.72637486", "0.72533315", "0.7242202", "0.7212308", "0.7208103", ...
0.82889396
0
Convert the given length to this unit system.
def length(self, length: float | None, from_unit: str) -> float: if not isinstance(length, Number): raise TypeError(f"{length!s} is not a numeric value.") # type ignore: https://github.com/python/mypy/issues/7207 return DistanceConverter.convert( # type: ignore[unreachable] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_length(self, event):\n try:\n #Compare other unit to one unit(meters)\n current_value, current_unit = float(\"0\" + str(self.v.get())), self.dropdown.get()\n unit_comp = {\"angstroms\": 10 ** -10, \"au\": 149598550000.0, \"barleycorns\": 0.008467, \"cables\": 182...
[ "0.6670528", "0.66462547", "0.6538739", "0.65376264", "0.6306371", "0.6266917", "0.61862123", "0.60758966", "0.60726297", "0.57924855", "0.5782921", "0.5779073", "0.5777692", "0.57317674", "0.5725653", "0.57113177", "0.5657724", "0.56575876", "0.56210715", "0.56200486", "0.55...
0.62175375
6