query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
INTERNAL USE ONLY Get the fact in the KB that is the same as the fact argument | def _get_fact(self, fact):
for kbfact in self.facts:
if fact == kbfact:
return kbfact | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getFact(self, fact):\n for kbfact in self.kb.facts:\n if fact == kbfact:\n return True\n return False",
"def fact(self, name):\n facts = self.facts(name=name)\n return next(fact for fact in facts)",
"def get_furniture():",
"def parse_fact(self, factel... | [
"0.64909446",
"0.55313945",
"0.55220604",
"0.545844",
"0.54017186",
"0.5279208",
"0.526946",
"0.524799",
"0.5233914",
"0.5233914",
"0.5068595",
"0.50262606",
"0.4968205",
"0.4955512",
"0.49484053",
"0.4944101",
"0.49107435",
"0.48900303",
"0.4867359",
"0.4864705",
"0.4863232"... | 0.70821464 | 1 |
INTERNAL USE ONLY Get the rule in the KB that is the same as the rule argument | def _get_rule(self, rule):
for kbrule in self.rules:
if rule == kbrule:
return kbrule | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getRule(self, *args):\n return _libsbml.Model_getRule(self, *args)",
"def get_rule(self):\n\n return self.__rule_",
"def rule(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"rule\")",
"def rule(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"rule\")",
"def ru... | [
"0.7259204",
"0.6979758",
"0.69061136",
"0.69061136",
"0.69061136",
"0.6762193",
"0.6750241",
"0.6723889",
"0.6723889",
"0.6723889",
"0.6723889",
"0.6723889",
"0.6723889",
"0.6723889",
"0.6401456",
"0.63561714",
"0.632328",
"0.6286141",
"0.62767315",
"0.6198468",
"0.6169003",... | 0.792611 | 1 |
Add a fact or rule to the KB | def kb_add(self, fact_rule):
printv("Adding {!r}", 1, verbose, [fact_rule])
if isinstance(fact_rule, Fact):
if fact_rule not in self.facts:
self.facts.append(fact_rule)
for rule in self.rules:
self.ie.fc_infer(fact_rule, rule, self)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def kb_add(self, fact_rule):\n printv(\"Adding {!r}\", 1, verbose, [fact_rule])\n if isinstance(fact_rule, Fact):\n if fact_rule not in self.facts:\n self.facts.append(fact_rule)\n for rule in self.rules:\n self.ie.fc_infer(fact_rule, rule, ... | [
"0.7505879",
"0.67374545",
"0.66437805",
"0.6610317",
"0.6533513",
"0.6462202",
"0.6420638",
"0.6355225",
"0.6298753",
"0.6160027",
"0.61000496",
"0.6083963",
"0.6083963",
"0.6083963",
"0.60685813",
"0.59749174",
"0.59630376",
"0.5873471",
"0.58405834",
"0.58210415",
"0.57135... | 0.7504409 | 1 |
Assert a fact or rule into the KB | def kb_assert(self, fact_rule):
printv("Asserting {!r}", 0, verbose, [fact_rule])
self.kb_add(fact_rule) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def kb_assert(self, fact):\n if isinstance(fact, Fact): #check if it's an instance of fact\n if (fact.name is \"fact\"): #checking if it is a fact/ double check\n for x in self.facts:\n if (x == fact): #if the fact is already in the kb\n ... | [
"0.7594763",
"0.62535036",
"0.6135857",
"0.6124177",
"0.5977059",
"0.5977059",
"0.5968787",
"0.5905811",
"0.58380437",
"0.57631975",
"0.576085",
"0.5709365",
"0.56988823",
"0.56957656",
"0.56953454",
"0.5676461",
"0.5652195",
"0.5644657",
"0.56348133",
"0.5627622",
"0.5623301... | 0.78474134 | 1 |
Retract a fact from the KB | def kb_retract(self, fact_or_rule):
printv("Retracting {!r}", 0, verbose, [fact_or_rule])
####################################################
# Student code goes here
if isinstance(fact_or_rule, Fact):
if fact_or_rule not in self.facts:
#print("fact not in b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_retract_fact(self):\n fact = self.env.assert_string('(implied-fact)')\n\n self.assertTrue(fact in list(self.env.facts()))\n\n fact.retract()\n\n self.assertFalse(fact in list(self.env.facts()))",
"def kb_retract(self, fact_or_rule):\n\n\n\n printv(\"Retracting {!r}\", ... | [
"0.727828",
"0.6681995",
"0.65912074",
"0.59810776",
"0.58416426",
"0.58231294",
"0.5616457",
"0.5609143",
"0.55859274",
"0.55476034",
"0.5539376",
"0.552487",
"0.5508562",
"0.5497389",
"0.54940456",
"0.54730284",
"0.54665464",
"0.5444098",
"0.54123",
"0.5397507",
"0.5389879"... | 0.682836 | 1 |
Forwardchaining to infer new facts and rules | def fc_infer(self, fact, rule, kb):
printv('Attempting to infer from {!r} and {!r} => {!r}', 1, verbose,
[fact.statement, rule.lhs, rule.rhs])
####################################################
# Student code goes here
binds = match(fact.statement, rule.lhs[0])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fc_infer(self, fact, rule, kb):\n printv('Attempting to infer from {!r} and {!r} => {!r}', 1, verbose,\n [fact.statement, rule.lhs, rule.rhs])\n ####################################################\n # //--\n bindings = match(rule.lhs[0],fact.statement)\n if bindin... | [
"0.70787704",
"0.69899803",
"0.6104135",
"0.55863345",
"0.5577889",
"0.5527958",
"0.5431001",
"0.53820366",
"0.5337441",
"0.5298498",
"0.528125",
"0.51856583",
"0.5182772",
"0.5180679",
"0.5125635",
"0.50974715",
"0.50924104",
"0.507518",
"0.5050917",
"0.5037923",
"0.5030072"... | 0.69969773 | 1 |
Generate the websocket URI using the `plexapi` library. | def _get_uri(plex_server):
return plex_server.url(
"/:/websockets/notifications", includeToken=True
).replace("http", "ws") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_websocket_url(self):\n\n r = requests.get(constants.WS_HOST, headers=constants.HTTP_HEADERS)\n ws_info = r.json()\n ws_info[\"securePort\"] = str(ws_info[\"securePort\"])\n ws_uri = constants.WS_URI + ws_info[\"token\"]\n ws_url = f\"wss://{ws_info['ip']}:{ws_info['secu... | [
"0.71666175",
"0.6622976",
"0.6125216",
"0.60616696",
"0.5856358",
"0.579203",
"0.5745843",
"0.56943464",
"0.5631257",
"0.5631257",
"0.56206995",
"0.56157094",
"0.5614729",
"0.5576109",
"0.5549441",
"0.5510375",
"0.5458033",
"0.54460245",
"0.5430578",
"0.5421468",
"0.5416377"... | 0.7242611 | 0 |
Returns an array of size (qs_size x db_size) where arr[i,j] = similarity between ith image in queryset and jth image in database | def calc_similarities(measure, db, qs, show_progress=False):
def compute_one(hist):
result = [measure(hist, db_hist) for db_hist in db]
return result
generator = tqdm(qs) if show_progress else qs
return np.array([compute_one(hist) for hist in generator]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cal_similarity(query_feat, gallery_feat, q_pids, g_pids, q_camids, g_camids):\n # The larger the cosine distance, the more similar it is\n distmat = -np.matmul(query_feat, np.transpose(gallery_feat))\n num_q = query_feat.shape[0]\n num_g = gallery_feat.shape[0]\n max_rank = 10\n if num_g < ma... | [
"0.5653551",
"0.5572386",
"0.54423213",
"0.5344458",
"0.52369976",
"0.5171509",
"0.51144665",
"0.49501798",
"0.49103454",
"0.49080366",
"0.4880789",
"0.48398706",
"0.48380566",
"0.4837013",
"0.48156306",
"0.48109284",
"0.48108852",
"0.4808363",
"0.48001704",
"0.47815272",
"0.... | 0.57384986 | 0 |
Retorna el score de un robot dentro de la fase score es una nupla de la forma (jugados, triunfos, empates, derrotas, a favor, en contra, diferencia, puntos) | def score(self, robot):
scores = [grupo.score(robot) for grupo in self.get_grupos()]
return reduce(lambda acumulador, score: tuple([ a + b for a, b in zip(acumulador, score)]), scores, (0, 0, 0, 0, 0, 0, 0, 0)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def score(self):",
"def score(self):\n return None",
"def get_score(self, solution: np.array) -> float:\n pass",
"def disp_score():",
"def get_score(self):\r\n return None",
"def score( self ):\r\n result = 0.0\r\n for rr in self.ee.getRsrcs( ):\r\n value = s... | [
"0.66580105",
"0.652421",
"0.6523095",
"0.64862645",
"0.64183223",
"0.64089113",
"0.6405176",
"0.6404387",
"0.6373137",
"0.63261986",
"0.63217366",
"0.62929094",
"0.62760496",
"0.6270492",
"0.6247308",
"0.62346435",
"0.62326956",
"0.6218685",
"0.620278",
"0.6195971",
"0.61810... | 0.70274866 | 0 |
Sets the currently used cmd line argument string. This way the 'active' arguments can be changed at runtime. | def set_argv(self, string):
try:
self.argv = string.split(' ')
except AttributeError:
if string:
self.argv = string
else:
self.argv = [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_global_arg(self, key, value):\n self.args[key] = value",
"def _set_args(self, args):\n if not args:\n self.arg = None\n elif len(args) == 1:\n self.arg = args[0]\n else:\n self.arg = args",
"def set_run_arg(self, arg: str, value: t.Optional[s... | [
"0.6398117",
"0.6278355",
"0.6190461",
"0.6089219",
"0.5954714",
"0.5954714",
"0.5915421",
"0.5881312",
"0.5837537",
"0.58223873",
"0.58027214",
"0.5797664",
"0.576173",
"0.5737762",
"0.5712827",
"0.5708949",
"0.566581",
"0.56397635",
"0.5639744",
"0.5619758",
"0.5589225",
... | 0.6660602 | 0 |
Adds a molecule representing not a model compound to the DATA instance. DEPRECATED | def add_molecule(self, name, cell=None):
print 'DATA.add_molecule is deprecated. Please use DATA.give_molecule'
self[name] = MOLECULE(name=name, cell=cell) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addMetaMolecule (self,metaMolecule):\r\n self.metaMolecule = metaMolecule",
"def storeMolecule():\n pass",
"def add_mol(mol_file, prot, projects, lig_id=\"LIG\", chaind_id=\"Z\",\n occupancy=0.0, sdf_file=None):\n # create mol object from mol_sd\n rd_mol = Chem.MolFromMolFile... | [
"0.57977456",
"0.54273695",
"0.5298321",
"0.5292807",
"0.521872",
"0.51416546",
"0.5092652",
"0.50826263",
"0.49352372",
"0.4930784",
"0.4914075",
"0.48963335",
"0.4892085",
"0.4850923",
"0.48483384",
"0.48481646",
"0.48212925",
"0.4815544",
"0.47425723",
"0.47245008",
"0.470... | 0.6579702 | 0 |
Determines wether an atom is prochiral and determines the atom's side if necessary. | def _get_prochirality(self):
for atom in self.invarioms:
atom.get_prochirality()
atom.invariom.get_prochirality() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def in_side(self, side):\n if side == \"U\":\n return self.z() == 1\n if side == \"D\":\n return self.z() == -1\n if side == \"F\":\n return self.y() == -1\n if side == \"B\":\n return self.y() == 1\n if side == \"R\":\n retu... | [
"0.5870851",
"0.549886",
"0.54745865",
"0.54745865",
"0.54745865",
"0.5240374",
"0.52023584",
"0.51951754",
"0.51806056",
"0.5163453",
"0.5118514",
"0.5108549",
"0.5107531",
"0.5101734",
"0.5089172",
"0.50881255",
"0.50782305",
"0.5074325",
"0.50729144",
"0.50729144",
"0.5033... | 0.6024382 | 0 |
Transfers the ADP from the modelcompounds to the 'exp' molecule. | def _transfer_adp(self):
toleratedAtoms = []
for atom in self['exp'].atoms:
tolerated = atom.transfer_adp()
if tolerated:
toleratedAtoms.append(tolerated)
for atom in toleratedAtoms:
atom.averageADP() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def endexp(proj,exp):\n response=do_method(\"experiment.endexp\",{\"proj\":proj,\"exp\":exp})\n check_response(response)",
"def ADP (self):",
"def _update_H_ADP(self):\n # return\n for atom in self.invarioms:\n if (not 'cart_meas' in atom.adp.keys() or len(atom.adp['cart_meas']) == 1... | [
"0.56986284",
"0.55589163",
"0.54671466",
"0.51983416",
"0.51245904",
"0.50352955",
"0.49165294",
"0.4898234",
"0.48855984",
"0.48367348",
"0.48196968",
"0.47925165",
"0.47516146",
"0.47162148",
"0.47145146",
"0.46556628",
"0.4649988",
"0.46429923",
"0.46218288",
"0.46155545",
... | 0.5790026 | 0 |
Determines the orientation vectors of all atoms in self.invarioms. | def _get_orientations(self):
for atom in self.invarioms:
atom.get_orientation() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_invariom_list(self):\n self.invariom_list = []\n for molecule in self.values():\n for atom in molecule.atoms:\n for invariom in atom.invarioms:\n if not invariom in self.invariom_list:\n self.invariom_list.append(invariom)",... | [
"0.60233694",
"0.59645724",
"0.5886588",
"0.5836681",
"0.5766795",
"0.5615393",
"0.56075054",
"0.55799407",
"0.5570654",
"0.5558884",
"0.5493693",
"0.54617745",
"0.54250467",
"0.5405588",
"0.5403019",
"0.5402334",
"0.53985435",
"0.53955144",
"0.5393566",
"0.5385733",
"0.53767... | 0.7996412 | 0 |
Links all atoms in 'exp' to their invarioms. | def _link(self):
for exp_atom in self['exp'].atoms:
if exp_atom.isTolerated():
continue
for model_atom in self[exp_atom.model_compound.name].atoms:
inv = exp_atom.get_active_invariom()
if inv in model_atom.invarioms.keys():
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ins(self):\n for i in self.name:\n self.str_in.append(i.get())\n for i in self.comb:\n self.act.append(i.current())\n self.destroy()",
"def _get_atoms(self):\n atoms = []\n invarioms = []\n\n for molecule in self.values():\n atoms += ... | [
"0.541973",
"0.53397936",
"0.5284878",
"0.49863306",
"0.49830613",
"0.4794765",
"0.47942436",
"0.47504792",
"0.46436095",
"0.4643061",
"0.4632869",
"0.4616352",
"0.46023867",
"0.45933336",
"0.45813257",
"0.45780787",
"0.45734018",
"0.45569727",
"0.45248002",
"0.44818586",
"0.... | 0.73596907 | 0 |
Calculates all intramolecular distances for all molecules and sortes the distances by length. | def _get_distances(self):
for molecule in self.values():
molecule.get_distances()
# for atom in self.atoms:
# atom.get_distances() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _calculate_distances(self):\n all_dists = []\n for ref in range(len(self.atoms)):\n if self.atoms[ref].symbol in self.exclude:\n continue\n indices = list(range(ref+1, len(self.atoms)))\n indices = self._filter_excluded(indices)\n if len(... | [
"0.70918673",
"0.6886079",
"0.6615046",
"0.6477235",
"0.6361456",
"0.63012576",
"0.6217487",
"0.61508644",
"0.6087151",
"0.5873806",
"0.58574456",
"0.5850111",
"0.58409035",
"0.5768633",
"0.5729397",
"0.56856877",
"0.56661415",
"0.56504864",
"0.55670995",
"0.55209035",
"0.551... | 0.7280398 | 0 |
Generates the attributes self.atoms and self.invarioms containing lists of all atoms in all molecules and a list of all atoms that are part of the 'exp' molecules and their invarioms respectively. | def _get_atoms(self):
atoms = []
invarioms = []
for molecule in self.values():
atoms += [atom for atom in molecule.atoms]
invarioms += [atom for atom in molecule.atoms if atom.invariom_name is not None]
self.atoms = atoms
self.invarioms = invarioms | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _build_atoms(self) -> None:\n self.atoms, self._id_to_index = list(), dict()\n atom_index = 0\n for residue in self.residues:\n self.topology_files.add(residue.rtf_file_name)\n for atom_data in residue.atoms:\n atom_name, atom_type, charge = atom_data\n... | [
"0.5979062",
"0.5950942",
"0.59240586",
"0.5919259",
"0.5848627",
"0.5789247",
"0.5768656",
"0.574016",
"0.57362163",
"0.57235104",
"0.56867",
"0.56828165",
"0.5646537",
"0.5611254",
"0.5593348",
"0.5579131",
"0.55567074",
"0.5510399",
"0.5472553",
"0.5467937",
"0.5436091",
... | 0.7037206 | 0 |
Sets the temperature used for ADP calculation. | def set_temperature(self, temperature):
self.Temp = temperature | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_temperature(self, temperature):\n pass",
"def set_temperature(self, temperature):\n self.temperature = temperature",
"def set_temperature(self, **kwargs):\n temperature = kwargs.get(ATTR_TEMPERATURE)\n _LOGGER.debug(f\"setting new temperature to {temperature}\")\n if ... | [
"0.8155636",
"0.80366653",
"0.792995",
"0.78690845",
"0.7823147",
"0.78194255",
"0.7810723",
"0.77003706",
"0.7661519",
"0.7580711",
"0.7564575",
"0.7564575",
"0.7445223",
"0.7406419",
"0.7399133",
"0.73462975",
"0.73459667",
"0.7320701",
"0.7290953",
"0.7290085",
"0.7190759"... | 0.80695283 | 1 |
Strips the GENERATOR instance of all unnecessary data to minimize the size of the serialized file. all attributes specified in the 'self.keep' list will be preserved. | def strip(self):
types = [type(self.strip),
type(self.values),
type(self.__ne__),
type(self.__class__)]
for attr in dir(self):
if not type(getattr(self, attr)) in types:
if any(i in attr for i in self.keep) or attr[0:2] == '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dumpme(self) :\n fileName = \"./data/oP4_ModelBuilder.dump\"\n with open(fileName,\"wb\") as dumpedFile:\n oPickler = pickle.Pickler(dumpedFile)\n oPickler.dump(self)",
"def compact(self):\n raise NotImplementedError",
"def uncleanable():\n data = attrdict.AttrDict... | [
"0.5517517",
"0.53878444",
"0.5364876",
"0.5337854",
"0.5335257",
"0.52688074",
"0.5249227",
"0.52312374",
"0.52293843",
"0.5205078",
"0.51930815",
"0.5172202",
"0.51568234",
"0.5114455",
"0.5080875",
"0.50779104",
"0.50628",
"0.50586104",
"0.5053403",
"0.5049718",
"0.5048329... | 0.60514945 | 0 |
Generates a unique list of all invariom names in all model compounds. | def _get_invariom_list(self):
self.invariom_list = []
for molecule in self.values():
for atom in molecule.atoms:
for invariom in atom.invarioms:
if not invariom in self.invariom_list:
self.invariom_list.append(invariom) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_var_names(self):\n\n if hasattr(self, \"all_var_names\"):\n return self.all_var_names\n\n # Append all variables in model (defined in YAML).\n aux_all_var_names = []\n aux_all_var_names.extend(self.sim_config_params)\n aux_all_var_names.extend(self.sim_inpu... | [
"0.5935138",
"0.5899702",
"0.5870949",
"0.58270997",
"0.5800687",
"0.57968426",
"0.57945836",
"0.5717853",
"0.56956416",
"0.5641676",
"0.5614754",
"0.5599243",
"0.55519074",
"0.55495614",
"0.554797",
"0.55261004",
"0.5491208",
"0.5490519",
"0.54870087",
"0.54511154",
"0.54508... | 0.6483959 | 0 |
Maps the invariom names to the 'smallest' model compound containing that invariom. | def _map_invarioms(self):
self.map = {}
for invariom in self.invariom_list:
kill = False
for molecule in self.sorted_molecules:
for atom in molecule.atoms:
if invariom in atom.invarioms:
self.map[invariom] = molecule.nam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def choose_least(me, ifcs, proj):\n \n eqrep = me._eqrep\n eqset = me._eqset\n subs = me._ifc_subs\n m = {}\n for i in ifcs:\n i = eqrep[i]\n x = None\n for i1 in eqset[i]:\n x1 = proj(i)\n if x is None:\n x = x1\n elif x1 is not None and x != x1:\n ... | [
"0.54021895",
"0.53657544",
"0.5184208",
"0.51669145",
"0.5119766",
"0.50906694",
"0.5089363",
"0.5087902",
"0.50121814",
"0.4940796",
"0.4928112",
"0.4924258",
"0.47782204",
"0.47626966",
"0.47597772",
"0.47292352",
"0.47291523",
"0.4717612",
"0.46685687",
"0.46684626",
"0.4... | 0.5379679 | 1 |
Closes the error log filepointer and removes the reference. This step is necessary for pickling the GENERATOR instance. | def release(self):
self.errorlog.close()
del self.errorlog
del self.printer | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __del__(self):\n\n self.logfd.close()",
"def __del__(self):\n if logging is not None:\n pass\n self.close()",
"def cleanup(self):\n if self.log_fo:\n self.log_fo.close()",
"def __exit__(self, type, value, traceback):\n self.fhandle.close()\n ... | [
"0.70596945",
"0.6801224",
"0.6655074",
"0.6626885",
"0.65862125",
"0.65738463",
"0.65405995",
"0.65217805",
"0.65072125",
"0.6497446",
"0.6469861",
"0.64552826",
"0.64364713",
"0.63524765",
"0.63439804",
"0.6339629",
"0.6338671",
"0.63215274",
"0.6311696",
"0.6311696",
"0.63... | 0.6812305 | 1 |
Creates a sorted list of all molecules. The sorting criterion is the molecule.criterion attribute defining the 'size' of an modelcompound. | def _sort_compounds(self):
self.sorted_molecules = sorted(self.values(), key=operator.attrgetter('criterion')) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sort(self):\n self.model_list.sort()\n for model in self.model_list:\n model.sort()",
"def mols(self) -> List[Chem.Mol]:\n return []",
"def sort(self):\n sorted_entries = [] # type: list[MSBModel]\n for entry_subtype in MSBModelSubtype:\n sorted_ent... | [
"0.57980996",
"0.5592937",
"0.5590203",
"0.5557706",
"0.5467723",
"0.5348508",
"0.5344725",
"0.5305589",
"0.5286833",
"0.5274443",
"0.52707136",
"0.52707136",
"0.5252042",
"0.5249811",
"0.522772",
"0.5211144",
"0.5192573",
"0.51706994",
"0.5163287",
"0.51485795",
"0.5130694",... | 0.7338805 | 0 |
Recalculates the ADP from theoretical data. | def _update_adp_calculation(self, Temp):
from sys import stdout
self.printer('\n ...calculating ADPs...\n')
import time
start = time.time()
daba_counter = 0.
max_counter = float(len(self.keys()))
for molecule in self.keys():
daba_counter += 1.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ADP (self):",
"def R_adp(data):\n printer('S_adp = ?')\n printer('R_adp = | (U_iso_xxx - U_iso_obs) / U_iso_obs |')\n printer('mean = sum((U_iso_xxx - U_iso_obs) / U_iso_obs) / n')\n printer('abs = sum(R_adp) / n\\n')\n printer('(geometric mean is used)\\n')\n\n printer(' | ADP_cal... | [
"0.703709",
"0.62606466",
"0.62515944",
"0.58362263",
"0.5532432",
"0.548112",
"0.5407811",
"0.54046524",
"0.53984034",
"0.53925973",
"0.53761053",
"0.53629196",
"0.5347173",
"0.53265536",
"0.5291258",
"0.5285795",
"0.5259309",
"0.52580225",
"0.5248812",
"0.5248812",
"0.52393... | 0.68125516 | 1 |
Writes the 'APD_DABA.txt' file. | def _update_database_file(self, Temp, path):
from datetime import datetime
if path:
filename = path + '/APD_DABA_{:.1f}_.txt'.format(Temp)
else:
filename = 'APD_DABA_{:.1f}_.txt'.format(Temp)
self.printer('\n ...Writing database file: {}...\n'.format(filename))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def writeAD(self):\n ofname = self.ad_file\n ofh = open(ofname,'w')\n\n for line in self.lines_ad:\n f = line.strip().split()\n if (len(f) > 1 and f[1] == 'WindFile'):\n if (self.wind_file != None):\n f[0] = \"\\\"\"+self.wind_file+\"\\\"... | [
"0.6898489",
"0.638768",
"0.61901206",
"0.59896845",
"0.5963897",
"0.5942247",
"0.5889682",
"0.5881464",
"0.5861139",
"0.5838272",
"0.58081174",
"0.5775084",
"0.5774635",
"0.5743053",
"0.5739529",
"0.57126856",
"0.56943107",
"0.5683161",
"0.5669955",
"0.5662301",
"0.5643661",... | 0.6970043 | 0 |
Writes the 'APD_MAP.txt' file. | def _update_database_map(self, path):
if path:
filename = path + '/APD_MAP.txt'
else:
filename = 'APD_MAP.txt'
filepointer = open(filename, 'w')
for invariom, molecule in self.map.items():
filepointer.write(invariom + ':' + molecule + '\n')
fil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_apap(data_map):\n pickle.dump(data_map, open(\"save.p\", \"wb\"))",
"def __write_mapping(encrypted_metadata: dict) -> None:\n with open(\".mapping\", \"w\") as file:\n json.dump(encrypted_metadata, file, indent=2)",
"def saveMapping(self, mapfile=\"./mapping.json\"):\n\t\tmappings... | [
"0.6786831",
"0.63023126",
"0.6298333",
"0.62859595",
"0.627232",
"0.6219311",
"0.6126577",
"0.6105255",
"0.6086898",
"0.5986891",
"0.59851414",
"0.5951216",
"0.5882506",
"0.5881549",
"0.5851176",
"0.5835068",
"0.5834187",
"0.58045644",
"0.5774004",
"0.5770709",
"0.57558894",... | 0.6891111 | 0 |
a == sqrt(b); a2 == b >>> from euler44 import isqrt, findRoot >>> all( 2 == findRoot( isqrt, i, 1, i ) for i in range(4,9) ) True >>> all( 3 == findRoot( isqrt, i, 1, i ) for i in range(9,16) ) True >>> findRoot( isqrt, 16, 1, 16 ) 4 | def isqrt( a, b ):
return a*a - b | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sqrt(a):",
"def sqrt(number):\n if number==0 or number==1:\n return number\n \n start=1\n end=number\n\n while start<=end:\n mid=(start+end)//2\n if mid*mid==number:\n return mid\n elif mid*mid<number:\n start=mid+1\n sqrt=mid\n ... | [
"0.7847661",
"0.7298881",
"0.7298663",
"0.72715324",
"0.71890485",
"0.70394206",
"0.70191634",
"0.70149946",
"0.6992221",
"0.6951971",
"0.6940846",
"0.69188535",
"0.68934363",
"0.68488145",
"0.6839583",
"0.6767884",
"0.6761538",
"0.6756976",
"0.67373306",
"0.67267865",
"0.672... | 0.75269425 | 1 |
Return a list of the class names for all registered node types. | def list_node_types(self):
return list(nodelist.all_nodes.keys()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_all_classes(self):\n classes = list(self.extended_class_only_graph.nodes())\n classes = [SchemaClass(_cls, self) for _cls in classes]\n return classes",
"def classes(self):\n if self.classname:\n return [self.classname]\n return []",
"def node_types(self) ... | [
"0.76043874",
"0.75571",
"0.7486333",
"0.73700047",
"0.7265125",
"0.722512",
"0.7188917",
"0.71785164",
"0.7157799",
"0.7075929",
"0.7029695",
"0.70166206",
"0.70144534",
"0.69509727",
"0.69480455",
"0.6933195",
"0.6906513",
"0.68456304",
"0.6805688",
"0.6789788",
"0.67743427... | 0.7948197 | 0 |
Register a Node subclass with this NodeGroup. This allows custom Node subclasses to be instantiated in this NodeGroup | def register_node_type_from_module(self, modname, classname):
nodelist.register_node_type_from_module(modname, classname) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def register_node(self, node):\n self.nodes.add(node)",
"def add(cls, node_class, prefix, profile, **kwargs):\n\n name = '%s%s%dp' % (PREFIX, prefix, cls._n + 1)\n capabilities = {\n 'node': cls.node_name(profile=profile, index=cls._n),\n 'profile': profile,\n 'boot_option': 'local',\... | [
"0.6703087",
"0.64938897",
"0.6346478",
"0.62396884",
"0.6208921",
"0.6097564",
"0.6002546",
"0.59809417",
"0.5953529",
"0.5938755",
"0.59153646",
"0.59024847",
"0.586348",
"0.5820507",
"0.572404",
"0.5722621",
"0.5717216",
"0.57122415",
"0.5709089",
"0.5704247",
"0.5691083",... | 0.6894145 | 0 |
Call `Node.start()` for all Nodes in this group. | def start_all_nodes(self):
for node in self.nodes:
node.start() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_peers(self):\n for i in self.nodes:\n i.start()",
"def start(self):\n for task in self._tasks:\n task.start()",
"def start(self, wait=False):\n start_nodes = self._get_start_nodes()\n\n for node in start_nodes:\n if not node.init_generator:\n ... | [
"0.7144954",
"0.6593965",
"0.65576595",
"0.63109046",
"0.62410855",
"0.62389797",
"0.6222382",
"0.6148808",
"0.61434156",
"0.61009496",
"0.6039568",
"0.6039351",
"0.6038319",
"0.6026459",
"0.60192704",
"0.6004787",
"0.5999228",
"0.5992591",
"0.59338474",
"0.58907723",
"0.5880... | 0.8726577 | 0 |
Call `Node.stop()` for all Nodes in this group. | def stop_all_nodes(self):
for node in self.nodes:
if node.running():
node.stop() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stopall(self):\n\n for i in self.bots:\n try:\n i.stop()\n except:\n pass",
"def stop_all():\n\twhile _running:\n\t\t_running[0].stop(noerror=True)",
"def stop(self):\n for task in self._tasks:\n task.stop()",
"def stop(self) ->... | [
"0.7056731",
"0.68594295",
"0.68265426",
"0.6773231",
"0.6770613",
"0.6725835",
"0.6671355",
"0.66479725",
"0.6595374",
"0.65937144",
"0.65125805",
"0.6502522",
"0.64977527",
"0.64745724",
"0.6467649",
"0.64254826",
"0.6417368",
"0.6412646",
"0.6362748",
"0.63499236",
"0.6348... | 0.8487234 | 0 |
Return True if any of the Nodes in this group are running. | def any_node_running(self):
return any(node.running() for node in self.nodes) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_is_running(self):\r\n return all(p.running for p in self._platforms.values())",
"def is_running(self):\n return all(p.status == 'running' for p in self.values())",
"def is_running(self):\n\t\treturn self in _running",
"def is_alive(self) -> bool:\n return any(thread.is_alive() fo... | [
"0.7181627",
"0.69876546",
"0.66471493",
"0.66151536",
"0.657981",
"0.65182644",
"0.64811367",
"0.64698195",
"0.6464478",
"0.64501935",
"0.64423984",
"0.64370716",
"0.6434919",
"0.64177716",
"0.6411656",
"0.6397197",
"0.63295305",
"0.63278043",
"0.63208324",
"0.6316322",
"0.6... | 0.88064504 | 0 |
Create contextawareness by giving a callback to handle the user's next message. Raises self.ValueError if timeout_time is not a positive time or None. | def _register_context_callback(self, user, callback=None,
noresponse_callback=None, timeout_time=0):
# architecture: self.response_callbacks is a dict with key "j@i.d"
# and entry [callback_when_response]. If a timeout_time is given
# then we call noresponse_c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def request_timeout(self, timeout: typing.Union[int, float, aiohttp.ClientTimeout]):\n timeout = self._prepare_timeout(timeout)\n token = self._ctx_timeout.set(timeout)\n try:\n yield\n finally:\n self._ctx_timeout.reset(token)",
"def _handle_context_timeout(self... | [
"0.5819177",
"0.5794947",
"0.5567117",
"0.5527478",
"0.5373538",
"0.53067803",
"0.52827483",
"0.5256898",
"0.524223",
"0.5235269",
"0.5155419",
"0.5153702",
"0.5123256",
"0.5106993",
"0.50320387",
"0.50249285",
"0.5018058",
"0.5014221",
"0.5005548",
"0.49986047",
"0.49974704"... | 0.58760834 | 0 |
Register a function to be called on receipt of a message of type 'typ' (muc/chat), category 'cat' (recv, send, unhandled, _self, _filter) sent from user or room 'name'. | def _register_callback(self, name, typ, cat, callback,
including_self=False, priority=Priority.NORMAL):
logging.info("Registering callback: %s", name)
# self._handlers is a dictionary of form:
# { type : { category : { room/groupname : [Handler objects]}}}
typh... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def register_msgtype_callback(self, path, msg_type, callback_func):",
"def register(self, msg_type, handler):\n # Should check type is valid\n if not handler and msg_type in self.handlers.keys():\n del self.handlers[msg_type]\n return\n self.handlers[msg_type] = handler... | [
"0.6526357",
"0.58372074",
"0.57269675",
"0.56671005",
"0.5650206",
"0.56276596",
"0.55985624",
"0.5523802",
"0.5477497",
"0.5349744",
"0.53214157",
"0.5311579",
"0.53042716",
"0.53040284",
"0.52488166",
"0.52416384",
"0.521168",
"0.5184961",
"0.5133385",
"0.511265",
"0.50967... | 0.6567319 | 0 |
Send muc message to room. The message will be run through any registered filters before it is sent. | def send_muc(self, room, body, source=None, priority=Priority.NORMAL):
# Verify this is a room EnDroid knows about
if source is None:
source = self.wh.my_emails[0]
msg = Message('muc', source, body, self, recipient=room)
# when sending messages we check the filters registe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def message(message):\n\troom = session.get('room')\n\tprint('%s : message : %s' % (session, message['message']))\n\temit('_message', {'user_name': session.get('name'), 'message' : message['message']}, room=room, include_self=False)",
"def send(self, mtype, **kwargs):\n\n self.transport.write(Message(mtyp... | [
"0.62623614",
"0.6257434",
"0.6152846",
"0.60893035",
"0.6083043",
"0.6083043",
"0.6083043",
"0.6071105",
"0.6041862",
"0.60169464",
"0.5973827",
"0.59564495",
"0.59492695",
"0.59089607",
"0.5880997",
"0.5878602",
"0.58781844",
"0.5874096",
"0.586596",
"0.58650565",
"0.584781... | 0.7051224 | 0 |
Send chat message to person with address user. The message will be run through any registered filters before it is sent. response_cb is an optional callback to be called to handle the next message received from the user. (Note that only the latest such callback | def send_chat(self, user, body, source=None, priority=Priority.NORMAL,
response_cb=None, no_response_cb=None, timeout=None):
if source is None:
source = self.wh.my_emails[0]
# Verify user is known to EnDroid
msg = Message('chat', source, body, self, recipient=user... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def send_to_user(self, user: User, msg: Msg, address: str = None):\n if address is None:\n address = user.current_address\n\n await self.send(msg, address)",
"def send_message_to_chat(channel, response):\n\n web_client.chat_postMessage(\n channel=channel,\n text=re... | [
"0.61190623",
"0.5966307",
"0.5925006",
"0.57993126",
"0.5759001",
"0.57468516",
"0.57205373",
"0.5711928",
"0.5685533",
"0.5677655",
"0.56522495",
"0.5634426",
"0.5630803",
"0.559529",
"0.55644375",
"0.55612963",
"0.55248874",
"0.55136245",
"0.54950726",
"0.5493706",
"0.5490... | 0.642642 | 0 |
Notify the message that the caller hasn't handled it. This should only be called by plugins that have registered as a handler (and thus have incremented the handler count for this message). This method takes arbitrary arguments so it can be used as deferred callback or errback. | def unhandled(self, *args):
if self._context_response:
# we asked a context-aware plugin to deal with the message, but it
# did not
self._context_dealt_with = False
else:
self.dec_handlers() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def handler(signum, frame):\n logging.warning(\"Got a {} signal. Doing nothing\".format(signum))",
"def empty_signal(self, *args, **kwargs):\n pass",
"def dontNotifyOnDeath(self, cb):\r\n try:\r\n self.__cbs.remove(cb)\r\n except AttributeError:\r\n pass",
"def don... | [
"0.6017005",
"0.5783303",
"0.5750087",
"0.5737227",
"0.5737227",
"0.57265854",
"0.5677071",
"0.5653484",
"0.5647474",
"0.55275637",
"0.5464947",
"0.5339304",
"0.53339237",
"0.53164816",
"0.52942014",
"0.5285929",
"0.5273072",
"0.5270213",
"0.5266438",
"0.5241145",
"0.5241145"... | 0.5977935 | 1 |
Get all root nodes of techanim setups using an attr from config | def get_all_setups_roots():
ta_roots = cmds.ls("*.{}".format(CONFIG["config_attr"]), r=True, o=True)
return ta_roots | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_setups_nodes():\n ta_roots = get_all_setups_roots()\n ta_nodes = [TechAnim_Setup(x) for x in ta_roots]\n return ta_nodes",
"def get_nodes():\n return conf.config.get_nodes(RELATIVE_PATH_FIXTURES_HOST)",
"def TreeInit(tree):\n \"\"\" Settings/NI_6133 \"\"\"\n tree.addNode('.SETTING... | [
"0.7208831",
"0.61220306",
"0.56705815",
"0.537438",
"0.52967745",
"0.5231642",
"0.52255195",
"0.51747537",
"0.5157228",
"0.51014113",
"0.50996614",
"0.50432366",
"0.5015624",
"0.501502",
"0.49732387",
"0.4972308",
"0.49577618",
"0.49529248",
"0.4951716",
"0.49492452",
"0.490... | 0.7142351 | 1 |
This returns instantiated Techanim_setups | def get_all_setups_nodes():
ta_roots = get_all_setups_roots()
ta_nodes = [TechAnim_Setup(x) for x in ta_roots]
return ta_nodes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setups():\n setups = []\n\n # If you run this in detailed mode, you need to set --t8 to 1e8\n kotani2017_F2 = dict()\n kotani2017_F2['name'] = 'kotani2017_F2'\n kotani2017_F2['piltemplate'] = kotani2017_F2_pil\n kotani2017_F2['pilparams'] = [None]\n kotani2017_F2['pepperargs'] = {'condense... | [
"0.6211832",
"0.6009244",
"0.5941721",
"0.59060365",
"0.574932",
"0.57420564",
"0.57420564",
"0.57246387",
"0.5696068",
"0.56334925",
"0.5631356",
"0.5623042",
"0.5623042",
"0.5623042",
"0.5623042",
"0.56154937",
"0.5609515",
"0.56038594",
"0.5599391",
"0.5599391",
"0.5599391... | 0.66217065 | 0 |
Get all of the namespaces | def get_all_namespaces():
cmds.namespace(setNamespace=':')
return cmds.namespaceInfo(listOnlyNamespaces=True, recurse=True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _fetch_all_namespaces():\n response = _fetch_herd_session() \\\n .get('{}://{}/{}/{}'.format(HERD_REST_PROTOCOL, HERD_BASE_URL,\n HERD_REST_BASE_PATH, 'namespaces')) \\\n .json()\n\n namespaces = []\n for namespaceKey in response['namespaceKeys']:\n ... | [
"0.81904817",
"0.8007075",
"0.79862326",
"0.79856735",
"0.7942555",
"0.7839778",
"0.778981",
"0.77599716",
"0.7723261",
"0.7660381",
"0.7635021",
"0.7620192",
"0.75957614",
"0.7449754",
"0.73884666",
"0.73257643",
"0.726505",
"0.722762",
"0.72076756",
"0.713455",
"0.71209013"... | 0.8430505 | 0 |
Add two dictionaries together, return new dictionary. if key in B already exists in A, do not override. None destructive. | def get_added_dicts(a, b):
tmp = copy.deepcopy(a)
for key, val in b.iteritems():
if key not in tmp:
tmp[key] = val
return tmp | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge_dicts(a, b):\n new_dict = defaultdict(list)\n add_to_dict(a, new_dict)\n add_to_dict(b, new_dict)\n return new_dict",
"def merge(a: dict, b: dict) -> dict:\n return __merge(a, b)",
"def merge_two_dicts(self, x, y):\n z = x.copy()\n z.update(y)\n return z",
"def a... | [
"0.7166191",
"0.7126028",
"0.7118499",
"0.70914936",
"0.70337975",
"0.70064807",
"0.69760185",
"0.69561565",
"0.6943505",
"0.6943505",
"0.6943505",
"0.6943505",
"0.6943505",
"0.6943505",
"0.6943505",
"0.6943505",
"0.6943324",
"0.6938591",
"0.6845912",
"0.68164074",
"0.6814673... | 0.7173503 | 0 |
when the target namespace is set, make any changes or prep | def set_target_namespace(self, namespace):
# do shit
self.target_namespace = namespace.strip(":") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_patch_net_namespace(self):\n pass",
"def test_replace_namespaced_build(self):\n pass",
"def update():\n for namespace in metadata.get_namespaces():\n logging.info('Switching namespace: \\'%s\\'', namespace)\n namespace_manager.set_namespace(namespace)\n update_per_namespace()\n... | [
"0.6370611",
"0.6276846",
"0.62628406",
"0.61864984",
"0.6106596",
"0.6099077",
"0.6053464",
"0.6043747",
"0.5988443",
"0.598453",
"0.59674436",
"0.5817213",
"0.58015937",
"0.57748",
"0.57406586",
"0.5737932",
"0.56638044",
"0.56638044",
"0.5653155",
"0.5627065",
"0.5623854",... | 0.73758805 | 0 |
convenience function, wrap any node belonging to this setup in the namespace retrieved when initialized | def _wrap_ns(self, node):
return "{}{}".format(self.techanim_ns, node) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prepare_node_attrs(self):",
"def __init__ (self,\n dom_node=None,\n parent_context=None,\n including_context=None,\n recurse=True,\n default_namespace=None,\n target_namespace=None,\n in_sco... | [
"0.58853745",
"0.5837881",
"0.57972276",
"0.57664067",
"0.57116795",
"0.5650769",
"0.56253606",
"0.55969733",
"0.5591787",
"0.5581034",
"0.5578944",
"0.55435365",
"0.55327046",
"0.55195075",
"0.5514189",
"0.5514189",
"0.5503622",
"0.54934144",
"0.54820234",
"0.5479178",
"0.54... | 0.6878026 | 0 |
set config on this setup. Decide if it will merge with stored, or follow env variable one. TODO | def set_config(self):
str_config = cmds.getAttr("{}.{}".format(self.root_node,
CONFIG["config_attr"]))
try:
# THIS NEEDS TO BE REVISTED. I am adding shit from file
stored_config = ast.literal_eval(str_config)
self.setup... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _setConfig(self,config):\n if config:\n self.config = config\n else:\n from layman import config\n self.config = config",
"def setup_config():\n global config\n config = modConfig.Config(cmdline.config)",
"def setup_config():\n if CONFIG.get(\"enviro... | [
"0.6941208",
"0.6849249",
"0.65873843",
"0.6582052",
"0.65714914",
"0.64592344",
"0.6450961",
"0.63880736",
"0.63829035",
"0.63737935",
"0.63686424",
"0.63665205",
"0.6343429",
"0.63144976",
"0.6306932",
"0.62977314",
"0.62961626",
"0.6292013",
"0.6285962",
"0.62824595",
"0.6... | 0.7382266 | 0 |
refresh the info dict on setup with all new information | def refresh_info(self):
if not self.is_setup_connected() and not self.target_namespace:
return
self.get_association_info()
self.create_techanim_connections() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reload_info(self):\n self.__loop.run_until_complete(self.__reload_info())",
"def manage_info():",
"def __init__(self):\n self.info = dict()",
"def info(self, dict):\n self._info.update(dict)",
"def _populate(self):\n self.addDemographics()\n self.addLabs()\n se... | [
"0.6798639",
"0.66361994",
"0.65892935",
"0.6536816",
"0.64429975",
"0.64253914",
"0.63728034",
"0.6372783",
"0.632948",
"0.6291547",
"0.62864524",
"0.61641616",
"0.6162921",
"0.6162668",
"0.61300963",
"0.6112092",
"0.61017853",
"0.6096668",
"0.60732424",
"0.6063539",
"0.6032... | 0.6833059 | 0 |
Nuclei, get them shits. Belonging to this setup. | def get_nuclei(self):
sim_layer = self._wrap_ns(self.setup_config["sim_layer"])
return cmds.listRelatives(sim_layer, ad=True, type="nucleus") or [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def makeSetup(self):\n startingRanks = [FLAG, SPY, SCOUT, SCOUT, MINER, MINER, GENERAL, MARSHALL, BOMB, BOMB]\n startingSpots = random.sample(self.getStartSpots(), len(startingRanks))\n pieces = []\n for i in range(len(startingRanks)):\n pieces += [Piece(startingRanks[i], sta... | [
"0.5485214",
"0.5339821",
"0.5337926",
"0.53157675",
"0.52279735",
"0.5175094",
"0.51567364",
"0.51133513",
"0.5091936",
"0.5054665",
"0.5046047",
"0.50431526",
"0.50192505",
"0.50033313",
"0.49893093",
"0.49704874",
"0.4956246",
"0.49343416",
"0.49327284",
"0.492501",
"0.491... | 0.58988076 | 0 |
Displays the desired nodes and any parent nodes that may be hidden | def show_nodes(self, nodes, select_second=None, isolate=False, select=False):
cmds.hide(cmds.listRelatives(self.root_node,
ad=True,
type="transform"))
cmds.showHidden(nodes, a=True)
if select or isolate:
cmds.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_nodes(self) -> None:\n\n def display_decision_node(node):\n txt = []\n txt.append(\" Type: \" + node.get(\"type\"))\n txt[-1] += (\n \" - Maximum Payoff\" if node.get(\"max\") is True else \" - Minimum Payoff\"\n )\n txt.ap... | [
"0.6349015",
"0.6229476",
"0.6135827",
"0.600242",
"0.5974837",
"0.5942266",
"0.5935858",
"0.5925196",
"0.5898088",
"0.5886632",
"0.5858014",
"0.585518",
"0.5829189",
"0.5826975",
"0.58202547",
"0.5811204",
"0.58080244",
"0.5799753",
"0.5799306",
"0.5780397",
"0.5740065",
"... | 0.6451546 | 0 |
delete input layer on any nodes | def delete_input_layer_cache(self):
# deleteGeometryCache;
# performDeleteGeometryCache 0;
# deleteCacheFile 3 { "delete", "", "geometry" };
input_nodes = self.get_layer_nodes_info([self.input_layer])
cached_nodes = self.is_node_cached(input_nodes.values()[0])
if cached_n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteLayer(self, event):\n pass",
"def delete_layer(LayerId=None):\n pass",
"def delete(self):\n\t\tself.canvas.delete('node_'+self.identifier)\n\t\tself.canvas.tag_unbind('node_'+self.identifier,\"<Any>\")",
"def _clearLayer(self, layer=0):\n for i in self._existingLayerItems(layer):\n ... | [
"0.68880415",
"0.6622255",
"0.6580619",
"0.6490028",
"0.6478339",
"0.6456869",
"0.6450924",
"0.6428652",
"0.6331932",
"0.6240476",
"0.62220305",
"0.62094",
"0.61441034",
"0.61148894",
"0.6104527",
"0.6062016",
"0.6057576",
"0.6055965",
"0.60501283",
"0.60500336",
"0.602163",
... | 0.7287271 | 0 |
does the input layer have any nodes with caches on them | def is_input_layer_cached(self):
input_nodes = self.get_layer_nodes_info([self.input_layer])
return self.is_node_cached(input_nodes.values()[0]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_sim_layer_cached(self):\n layers = [self._wrap_ns(self.setup_config[\"sim_layer\"])]\n input_nodes = self.get_layer_nodes_info(layers)\n return self.is_node_cached(input_nodes.values()[0])",
"def is_node_cached(self, nodes):\n nodes_with_cache = []\n for node in nodes:\n... | [
"0.71547115",
"0.6552685",
"0.6383641",
"0.6322636",
"0.62381244",
"0.6178652",
"0.6148858",
"0.614296",
"0.6093954",
"0.60319155",
"0.59813863",
"0.5979752",
"0.597249",
"0.5933869",
"0.5905113",
"0.5882537",
"0.5822555",
"0.5820204",
"0.5807152",
"0.57988673",
"0.57917595",... | 0.7696694 | 0 |
are there any nodes in the sim layer that have cache nodes on them | def is_sim_layer_cached(self):
layers = [self._wrap_ns(self.setup_config["sim_layer"])]
input_nodes = self.get_layer_nodes_info(layers)
return self.is_node_cached(input_nodes.values()[0]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_node_cached(self, nodes):\n nodes_with_cache = []\n for node in nodes:\n for shape in cmds.listRelatives(node, shapes=True) or []:\n if cmds.listConnections(shape, type=\"historySwitch\"):\n nodes_with_cache.extend([node, shape])\n el... | [
"0.74096215",
"0.6431553",
"0.6076142",
"0.59499705",
"0.5904763",
"0.5865617",
"0.58130735",
"0.58011806",
"0.57959205",
"0.5768705",
"0.57121915",
"0.5710528",
"0.5692879",
"0.5688217",
"0.56739545",
"0.56519747",
"0.5650705",
"0.56494015",
"0.5648412",
"0.5637805",
"0.5629... | 0.6923229 | 1 |
are the specific nodes supplied cached in anyway | def is_node_cached(self, nodes):
nodes_with_cache = []
for node in nodes:
for shape in cmds.listRelatives(node, shapes=True) or []:
if cmds.listConnections(shape, type="historySwitch"):
nodes_with_cache.extend([node, shape])
elif cmds.listC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cache_nodes(request, queryset):\n if queryset:\n lang = get_language()\n site_id = Site.objects.get_current().pk\n prefix = getattr(settings, \"CMS_CACHE_PREFIX\", \"menu_cache_\")\n key = \"%smenu_nodes_%s_%s\" % (prefix, lang, site_id)\n parent_node = None\n\n # b... | [
"0.60622096",
"0.6050869",
"0.59982425",
"0.5852416",
"0.58429915",
"0.5796666",
"0.57962185",
"0.5762169",
"0.5758461",
"0.57575",
"0.57567614",
"0.5745204",
"0.56507015",
"0.56245947",
"0.5616977",
"0.55513483",
"0.5549979",
"0.55220014",
"0.55181414",
"0.5501497",
"0.54987... | 0.80672336 | 0 |
cons = con_ceq(x,project) Equality Constraint Functions SU2 Project interface to scipy.fmin_slsqp | def con_ceq(x,project):
cons = project.con_ceq(x)
if cons: cons = array(cons)
else: cons = zeros([0])
return cons | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def con_cieq(x,project):\n \n cons = project.con_cieq(x)\n \n if cons: cons = array(cons)\n else: cons = zeros([0])\n \n return -cons",
"def con_dcieq(x,project):\n \n dcons = project.con_dcieq(x)\n \n dim = project.n_dv\n if dcons: dcons = array(dcons)\n else: dcons... | [
"0.7528679",
"0.68966097",
"0.64936393",
"0.63502675",
"0.6200292",
"0.6164727",
"0.6058329",
"0.5997618",
"0.58617955",
"0.58326924",
"0.5822845",
"0.5820209",
"0.5777782",
"0.5767721",
"0.5706345",
"0.5689243",
"0.5685516",
"0.5673068",
"0.56587446",
"0.5616506",
"0.5603018... | 0.7227023 | 1 |
dcons = con_dceq(x,project) Equality Constraint Gradients SU2 Project interface to scipy.fmin_slsqp | def con_dceq(x,project):
dcons = project.con_dceq(x)
dim = project.n_dv
if dcons: dcons = array(dcons)
else: dcons = zeros([0,dim])
return dcons | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def con_dcieq(x,project):\n \n dcons = project.con_dcieq(x)\n \n dim = project.n_dv\n if dcons: dcons = array(dcons)\n else: dcons = zeros([0,dim])\n \n return -dcons",
"def con_cieq(x,project):\n \n cons = project.con_cieq(x)\n \n if cons: cons = array(cons)\n else: ... | [
"0.6876892",
"0.6313536",
"0.5966093",
"0.59547573",
"0.593399",
"0.5798913",
"0.57779044",
"0.57319784",
"0.5714527",
"0.56840825",
"0.56496346",
"0.5642808",
"0.56285393",
"0.55715144",
"0.5562137",
"0.5539712",
"0.55006355",
"0.5498496",
"0.5492077",
"0.5485834",
"0.547655... | 0.70619506 | 0 |
cons = con_cieq(x,project) Inequality Constraints SU2 Project interface to scipy.fmin_slsqp | def con_cieq(x,project):
cons = project.con_cieq(x)
if cons: cons = array(cons)
else: cons = zeros([0])
return -cons | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def con_dcieq(x,project):\n \n dcons = project.con_dcieq(x)\n \n dim = project.n_dv\n if dcons: dcons = array(dcons)\n else: dcons = zeros([0,dim])\n \n return -dcons",
"def con_ceq(x,project):\n \n cons = project.con_ceq(x)\n \n if cons: cons = array(cons)\n else: c... | [
"0.6888078",
"0.66649",
"0.6464208",
"0.6351813",
"0.6206831",
"0.60521054",
"0.597832",
"0.58663636",
"0.5807768",
"0.5805301",
"0.57720006",
"0.56627506",
"0.56544656",
"0.5611465",
"0.5606307",
"0.55969894",
"0.55888957",
"0.5571727",
"0.557074",
"0.55692005",
"0.55666167"... | 0.75770557 | 0 |
dcons = con_dcieq(x,project) Inequality Constraint Gradients SU2 Project interface to scipy.fmin_slsqp | def con_dcieq(x,project):
dcons = project.con_dcieq(x)
dim = project.n_dv
if dcons: dcons = array(dcons)
else: dcons = zeros([0,dim])
return -dcons | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def con_dceq(x,project):\n \n dcons = project.con_dceq(x)\n\n dim = project.n_dv\n if dcons: dcons = array(dcons)\n else: dcons = zeros([0,dim])\n \n return dcons",
"def con_cieq(x,project):\n \n cons = project.con_cieq(x)\n \n if cons: cons = array(cons)\n else: cons =... | [
"0.68788576",
"0.6659862",
"0.6102606",
"0.6082875",
"0.59833056",
"0.59575295",
"0.58176064",
"0.5788114",
"0.5746452",
"0.57218665",
"0.5715761",
"0.56980413",
"0.5688782",
"0.5683125",
"0.56423855",
"0.56221676",
"0.5609677",
"0.5604227",
"0.5598951",
"0.55865896",
"0.5583... | 0.70946693 | 0 |
Convert dictionary into data frame and tokenize inputs given queries. | def prepare_inputs(data, queries, tokenizer):
# Prepare inputs
table = pd.DataFrame.from_dict(data)
inputs = tokenizer(table=table, queries=queries,truncation=True, padding=True,return_tensors="pt").to(device)
# Return things
return table, inputs | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def query2df(query):\n df = pd.DataFrame(data = list(itertools.product([0, 1], repeat=len(query.variables))), columns=query.variables)\n df['p'] = query.values.flatten()\n return df",
"def _convert_tags_to_df(text_dict_tags):\n\n return DataFrame({u'tag' :[item[0] for item in text_dict_tags.items()]... | [
"0.61354715",
"0.6041458",
"0.5932817",
"0.5880666",
"0.58784735",
"0.58620197",
"0.57131207",
"0.57031405",
"0.56906503",
"0.5584784",
"0.5552426",
"0.5551126",
"0.54895955",
"0.54824334",
"0.5455758",
"0.5451413",
"0.5435663",
"0.5399078",
"0.5368841",
"0.5356269",
"0.53465... | 0.70211875 | 0 |
Generate predictions for some tokenized input. | def generate_predictions(inputs, model, tokenizer):
# Generate model results
outputs = model(**inputs)
# Convert logit outputs into predictions for table cells and aggregation operators
predicted_table_cell_coords, predicted_aggregation_operators = tokenizer.convert_logits_to_predictions(
input... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def predict_tokens(self, tokens):\n return",
"def predict(self, x):\n \n\n return predictions",
"def predict(self, X):",
"def predict(self, X):",
"def predict(self, X, pred_batch_size=None):",
"def predict(self, X):\n ...",
"def predict(self, X):\n ...",
"def predic... | [
"0.79723036",
"0.6973789",
"0.67691654",
"0.67691654",
"0.6746224",
"0.67373574",
"0.67373574",
"0.67373574",
"0.67362213",
"0.6723646",
"0.6671686",
"0.6671686",
"0.6671686",
"0.66637105",
"0.66271496",
"0.662548",
"0.6617756",
"0.6610556",
"0.65489364",
"0.6543912",
"0.6541... | 0.7250516 | 1 |
Convert the filename to lon and lat | def fn2lonlat(filename):
tokens = filename.split("/")[-1].rsplit(".", 1)[0].split("x")
return [0 - float(tokens[0]), float(tokens[1])] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parseFilename(self, filename):\r\n match = self.filename_regex.match(filename)\r\n if match is None:\r\n # TODO?: Raise exception?\r\n '''print \"Filename\", filename, \"unrecognized!\"'''\r\n return None\r\n lat = int(match.group(2))\r\n lon = int(m... | [
"0.71627367",
"0.66961354",
"0.65344346",
"0.63881433",
"0.6325108",
"0.6299822",
"0.6186765",
"0.6139761",
"0.6127387",
"0.612301",
"0.608886",
"0.6052462",
"0.603562",
"0.60113597",
"0.59936994",
"0.599359",
"0.5977271",
"0.58730197",
"0.58690715",
"0.58296925",
"0.5804964"... | 0.78115535 | 0 |
Checks if a function is a stub. | def is_stub(node: AnyFunctionDef) -> bool:
function_has_docstring = (
isinstance(node.body[0], Expr) and
isinstance(node.body[0].value, Str)
)
if function_has_docstring:
return _is_stub_with_docstring(node)
return _is_stub_without_docstring(node) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def checkfuncname(b, frame):\n if not b.funcname:\n # Breakpoint was set via line number.\n if b.line != frame.f_lineno:\n # Breakpoint was set at a line with a def statement and the function\n # defined is called: don't break.\n return False\n return True\n... | [
"0.64216495",
"0.62877226",
"0.61045533",
"0.61021316",
"0.6044252",
"0.59142053",
"0.5792307",
"0.5735392",
"0.5662762",
"0.5607523",
"0.5607523",
"0.5607523",
"0.5607523",
"0.5607523",
"0.5607523",
"0.5607523",
"0.5607523",
"0.5607523",
"0.5607523",
"0.5605979",
"0.55551064... | 0.80507183 | 0 |
Run the Player's Turn | def runPlayerTurn(self, player):
self.runController(PlayerTurnController(player, self.game)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_turn(self):\n\n # Here is where you'll want to code your AI.\n\n # We've provided sample code that:\n # 1) prints the board to the console\n # 2) prints the opponent's last move to the console\n # 3) prints how much time remaining this AI has to calculate moves\n... | [
"0.7863275",
"0.78043693",
"0.75185335",
"0.7398283",
"0.7391936",
"0.73395026",
"0.7335434",
"0.7319197",
"0.72278273",
"0.71580124",
"0.71224135",
"0.71224135",
"0.7108509",
"0.7106105",
"0.7100893",
"0.7085581",
"0.70275223",
"0.69233596",
"0.68968654",
"0.68851405",
"0.68... | 0.79113436 | 0 |
This function prints the initialization dict to a .yml file. | def print_dict(init_dict, file_name="test"):
ordered_dict = collections.OrderedDict()
order = ["SIMULATION", "PARAMS", "DIST"]
for key_ in order:
ordered_dict[key_] = init_dict[key_]
with open("{}.boupy.yml".format(file_name), "w") as outfile:
yaml.dump(ordered_dict, outfile, explicit_s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write(self):\n print yaml.dump(self._config, default_flow_style=False),",
"def print_settings(self, title=None):\n if title:\n print(title)\n print('Contents of imagenode.yaml:')\n pprint.pprint(self.config)\n print()",
"def run_print_dict_examples():\n prin... | [
"0.65080845",
"0.64796907",
"0.6353056",
"0.6353056",
"0.63266784",
"0.6285428",
"0.60634816",
"0.6058118",
"0.59881467",
"0.58612686",
"0.58471906",
"0.583021",
"0.5826344",
"0.5800831",
"0.5791433",
"0.5777567",
"0.573899",
"0.56998134",
"0.5677084",
"0.56634957",
"0.566245... | 0.794408 | 0 |
Get a list of Panchayats based on the furnished parameters. If names of state, district or block are given, they are used as filters. Accepts any part of the name of any parameter. | def getPanchayats(request):
if request.method == 'GET':
inName=request.GET.get('panchayat', '')
ptid=request.GET.get('ptid', '')
blockName=request.GET.get('block', '')
bid = request.GET.get('bid', '')
districtName = request.GET.get('district', '')
stateName = request.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filters():\n states = list(storage.all('State').values())\n states.sort(key=lambda state: state.name)\n cities = list(storage.all('City').values())\n cities.sort(key=lambda city: city.name)\n amenities = list(storage.all('Amenity').values())\n amenities.sort(key=lambda amenity: amenity.name)\... | [
"0.5446263",
"0.54331565",
"0.54278535",
"0.54069376",
"0.53428894",
"0.53145933",
"0.530204",
"0.528885",
"0.5281124",
"0.52221125",
"0.5209056",
"0.5203987",
"0.5186986",
"0.51299626",
"0.51225525",
"0.51199484",
"0.5101006",
"0.51000977",
"0.509962",
"0.5093136",
"0.508405... | 0.5442545 | 1 |
This function gets the active jobcards in the Panchayat by getting jobcards from the workdetail table. I could have taken them from the jobcard register, but it leads to a lot of inactive jobcards with no data, which could be frustrating on the ground. If the feedback is that it is frustrating to not find other jobcard... | def getJobcards(request):
if request.method == 'GET':
jcEnd=request.GET.get('jobend', '')
jcContains=request.GET.get('vcode', '')
ptid=request.GET.get('ptid', '')
limit=request.GET.get('limit', '')
if limit == '':
limit=50
else:
limit=int(limit)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getJobcardsAll(request):\n #GOLITODO add the extra field in models for the village and use it here for filtring\n if request.method == 'GET':\n jcEnd=request.GET.get('jobend', '')\n jcContains=request.GET.get('vcode', '')\n ptid=request.GET.get('ptid', '')\n limit=request.GET.... | [
"0.61555177",
"0.60655046",
"0.56507695",
"0.5639974",
"0.56018996",
"0.5505278",
"0.54436624",
"0.53932875",
"0.5357025",
"0.52322507",
"0.51705587",
"0.51705587",
"0.51705587",
"0.51705587",
"0.51695013",
"0.51682216",
"0.5164083",
"0.5161287",
"0.5131279",
"0.5130795",
"0.... | 0.6682958 | 0 |
This function gets all the jobcards and does not look at whether the jobcard is active or not. From api.ai, I might get two numbers for the jobcard intent. One will correspond to the last numbers of a jobcard and the other is likely to be a village code. There are challenges in putting them together. Right now, I am go... | def getJobcardsAll(request):
#GOLITODO add the extra field in models for the village and use it here for filtring
if request.method == 'GET':
jcEnd=request.GET.get('jobend', '')
jcContains=request.GET.get('vcode', '')
ptid=request.GET.get('ptid', '')
limit=request.GET.get('limit'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getJobcards(request):\n if request.method == 'GET':\n jcEnd=request.GET.get('jobend', '')\n jcContains=request.GET.get('vcode', '')\n ptid=request.GET.get('ptid', '')\n limit=request.GET.get('limit', '')\n if limit == '':\n limit=50\n else:\n limit... | [
"0.6787217",
"0.591344",
"0.5796052",
"0.5646304",
"0.5595721",
"0.5541078",
"0.5486718",
"0.54824233",
"0.5439394",
"0.5391062",
"0.5365205",
"0.532518",
"0.5300418",
"0.52938884",
"0.5289031",
"0.52841777",
"0.5217173",
"0.51558715",
"0.5155734",
"0.5146772",
"0.5144197",
... | 0.6821691 | 0 |
This returns the number of jobcard holders that are there in a Panchayat. | def getNumberJobcards(request):
if request.method == 'GET':
ptid=request.GET.get('ptid', '')
noJobcards=Jobcard.objects.filter(panchayat__id=ptid).count()
return JsonResponse(noJobcards, safe=False) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_amount(self): \n return len(self.get_cards())",
"def count(self):\n return(len(self.cards))",
"def count_deck(deck):\n return reduce(lambda x, y: x + y['quantity'], deck['cards'], 0)",
"def count(self):\n return len(self.deck)",
"def num_pickets(self) -> int:\n ... | [
"0.60021937",
"0.5992913",
"0.5883917",
"0.5817642",
"0.5797351",
"0.57820237",
"0.5736743",
"0.5722063",
"0.5722063",
"0.570059",
"0.5676025",
"0.56711",
"0.5660784",
"0.56473535",
"0.5602817",
"0.55662674",
"0.5559584",
"0.55508757",
"0.5543493",
"0.5535949",
"0.553483",
... | 0.64593506 | 0 |
Get Details about each Jobcard | def jobcardInfo(request):
if request.method=='GET':
jobcard = request.GET.get('jobcard', '')
status = request.GET.get('status','')
if status == '':
wds=WorkDetail.objects.filter(worker__jobcard__jobcard=jobcard).order_by("-muster__dateTo")
else:
wds=WorkDetail.objects.filter(worker__jobcard__jobca... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_job_detail():\n\n return JobDetail.query.all()",
"def getJobcards(request):\n if request.method == 'GET':\n jcEnd=request.GET.get('jobend', '')\n jcContains=request.GET.get('vcode', '')\n ptid=request.GET.get('ptid', '')\n limit=request.GET.get('limit', '')\n if l... | [
"0.6944616",
"0.6637235",
"0.64818615",
"0.6460041",
"0.6347296",
"0.63427395",
"0.6316288",
"0.6256089",
"0.6211995",
"0.6149777",
"0.6142114",
"0.6084757",
"0.6041112",
"0.5999263",
"0.5968722",
"0.59016544",
"0.58351755",
"0.58351755",
"0.57786083",
"0.5735937",
"0.5732301... | 0.68875575 | 1 |
Gives Method to get FTOs | def getFTO(request):
if request.method=='GET':
ftoNo = request.GET.get('ftoNo', '')
myftos=FTO.objects.filter(ftoNo=ftoNo)
serializer = FTOSerializer(myftos,many=True)
return JsonResponse(serializer.data, safe=False) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_fns(self):\n return self.key_to_fn",
"def getTPF(object_name, radius = \".02 deg\", P = None, t0 = None, tdur = None):\n obs_table = Observations.query_object(object_name,radius=radius)\n for i in range(len(obs_table['dataURL'])):\n\n print(obs_table['dataURL'][i])",
"def funcs(self... | [
"0.5726694",
"0.56815",
"0.5662285",
"0.56486565",
"0.5567002",
"0.5453947",
"0.5252427",
"0.5251691",
"0.52370286",
"0.51712966",
"0.5141205",
"0.5135869",
"0.5132043",
"0.5101745",
"0.5100468",
"0.50944066",
"0.5084453",
"0.5077421",
"0.50739354",
"0.5072735",
"0.5039575",
... | 0.61372083 | 0 |
Gives Method to retrieve Wagelists | def getWagelists(request):
if request.method=='GET':
bcode = request.GET.get('bcode', '')
limit = request.GET.get('limit', '')
if limit == '':
limit=50
else:
limit=int(limit)
if bcode == '':
wagelists=Wagelist.objects.filter(id__gt=0)[:limit]
else:
wagelists=Wagelist.objects.filter(blo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_list(self, *args, **kwargs):\n pass",
"def get_list(self, *args, **kwargs):\n pass",
"def getListingLists(**kwargs):",
"def getList(self):\n\treturn self.list",
"def getListItem(*args):",
"def getListItem(*args):",
"def getListItem(*args):",
"def list(self):",
"def list(self):... | [
"0.65967137",
"0.65967137",
"0.64436364",
"0.6152923",
"0.613323",
"0.613323",
"0.613323",
"0.611995",
"0.6115142",
"0.6060212",
"0.5982941",
"0.5982941",
"0.590789",
"0.58899873",
"0.58244634",
"0.5802797",
"0.57927644",
"0.57927644",
"0.5580013",
"0.55771846",
"0.5558972",
... | 0.69987917 | 0 |
Print out all non private methods and attributes of an abject | def print_attr(obj):
for attr in dir(obj):
if attr.startswith('__'):
continue
else:
print attr
print getattr(obj, attr)
print '\n' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_attributes(obj: object) -> None:\n all_attributes = set(dir(obj))\n names_of_methods = set(\n filter(lambda atrr_name: callable(getattr(obj, atrr_name)), all_attributes)\n )\n attributes_excluding_methods = all_attributes - names_of_methods\n attributes_names_and_values = [(name... | [
"0.7736313",
"0.73893696",
"0.73167443",
"0.7201287",
"0.7176234",
"0.70063275",
"0.70063275",
"0.69342005",
"0.679622",
"0.673759",
"0.665611",
"0.6648955",
"0.6603623",
"0.65756196",
"0.6476417",
"0.6459934",
"0.6450412",
"0.6440855",
"0.6412955",
"0.63543135",
"0.6326145",... | 0.77793 | 0 |
Write a file containing gnuplot data for the profile. | def write_plot(self):
with open(self._graph_data_path, "w+") as f:
run_time = self.start_time
f.write("Time, Temperature\n")
temperature = 0
for step in self.profile["steps"]:
keys = list(step)
if len(keys) > 0:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def writeProfile(fname,prof):\n t = np.linspace(0,1,prof.shape[0],endpoint=False)\n fh = open(fname,'w')\n for x in range(prof.shape[0]):\n fh.write('%.7e %.7e\\n' % (t[x],prof[x]))\n fh.close()",
"def write_profile(emission, p, q):\n motif_profile = open(\"motif_profile.txt\", \"a\")\n ... | [
"0.68901074",
"0.63481456",
"0.6307651",
"0.62658185",
"0.58080333",
"0.57305706",
"0.5724658",
"0.5712738",
"0.57025903",
"0.5680378",
"0.5676074",
"0.56745946",
"0.5672304",
"0.5670648",
"0.5664575",
"0.56485194",
"0.5642001",
"0.56390333",
"0.5610832",
"0.5596206",
"0.5595... | 0.63626695 | 1 |
Get a list of objects describing all the profiles in the profiles_folder. | def get_list(profiles_folder, logger):
profile_list = []
with scandir(profiles_folder) as it:
for entry in it:
if entry.is_file():
filepath = profiles_folder + entry.name
profile = json_from_file(filepath, logger)
if... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list(self):\n # List is to be extended (directories should not have a trailing slash)\n paths_to_ignore = ['.DS_Store']\n\n profiles = []\n cache = ClientCache(self._conan_api.cache_folder)\n profiles_path = cache.profiles_path\n if os.path.exists(profiles_path):\n ... | [
"0.7975866",
"0.7672995",
"0.7630292",
"0.75405186",
"0.7483673",
"0.7224287",
"0.7224287",
"0.7110166",
"0.7038022",
"0.6998707",
"0.6927667",
"0.6896615",
"0.68367654",
"0.6836556",
"0.68084115",
"0.67887545",
"0.6754678",
"0.6714723",
"0.66816616",
"0.66602075",
"0.6617536... | 0.78291523 | 1 |
Este es un documento. La primera linea termina en punto(.) Despues un espacio Y el resto del documento Llamarla con la extencion __doc__ y agregar un pass como se muestra a continuacion | def documento():
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fini_doc(self):\n raise NotImplementedError()",
"def document(self):\n ...",
"def __call__(self, doc):\n return doc",
"def __call__(self, doc: Doc) -> Doc:\n return doc",
"def __call__(self, doc: Doc) -> Doc:\n return doc",
"def DocString():\n return",
"def doc(sel... | [
"0.72456473",
"0.71379364",
"0.7027148",
"0.68183947",
"0.68183947",
"0.6812812",
"0.6761985",
"0.67226505",
"0.67039376",
"0.65652484",
"0.6519353",
"0.65028083",
"0.64711565",
"0.6408702",
"0.63678837",
"0.6320934",
"0.6317584",
"0.6311161",
"0.63048005",
"0.6292803",
"0.62... | 0.78449184 | 0 |
This method takes the land use data and multiplies various columns of the land use data by coefficients from the spec table in order to yield a size term (a linear combination of land use variables). | def size_term(land_use, destination_choice_coeffs):
coeffs = destination_choice_coeffs
# first check for missing column in the land_use table
missing = coeffs[~coeffs.index.isin(land_use.columns)]
if len(missing) > 0:
logger.warn("%s missing columns in land use" % len(missing.index))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def terrain_multiplier(self):\n #Hardcode table of terrain multipliers\n self.terrain_table = pd.DataFrame({\n 'height': [0.00, 3.00, 5.00, 10.0, 15.0, 20.0, 30.0, 40.0, 50.0, 75.0, 100., 150., 200.],\n '1': [0.99, 0.99, 1.05, 1.12, 1.16, 1.19, 1.22, 1.2... | [
"0.5220687",
"0.5179846",
"0.51362896",
"0.5045918",
"0.4980863",
"0.49152452",
"0.48880452",
"0.4884857",
"0.48674676",
"0.48118976",
"0.47994998",
"0.47926778",
"0.4782915",
"0.4778444",
"0.47679746",
"0.4735372",
"0.47118768",
"0.47097036",
"0.46936688",
"0.4686071",
"0.46... | 0.6629432 | 0 |
Operator for performing a keyadd keyadd is additive so you will end up with more entries in the resulting dictionary This will append a the version specied by the primary_key migrator field. Additionally all dependencies specified by zip_keys will be updated with additional entries from v2. If an ordering reorders the ... | def op_variant_key_add(v1: dict, v2: dict):
primary_key = v2["__migrator"]["primary_key"]
ordering = v2["__migrator"].get("ordering", {})
if primary_key not in v2:
return v1
if primary_key not in v1:
raise RuntimeError("unhandled")
result = v1.copy()
for pkey_ind, pkey_val in en... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def variant_add(v1: dict, v2: dict) -> Dict[str, Any]:\n left = set(v1.keys()).difference(v2.keys())\n right = set(v2.keys()).difference(v1.keys())\n joint = set(v1.keys()) & set(v2.keys())\n\n # deal with __migrator: ordering\n if \"__migrator\" in v2:\n ordering = v2[\"__migrator\"].get(\"o... | [
"0.54264426",
"0.5189846",
"0.50703347",
"0.5009525",
"0.48770958",
"0.48572582",
"0.476982",
"0.47462156",
"0.47306025",
"0.47150078",
"0.47108722",
"0.46986473",
"0.46836758",
"0.46437734",
"0.46123767",
"0.46076378",
"0.45737725",
"0.4539636",
"0.4538721",
"0.45177102",
"0... | 0.6422469 | 0 |
Inverse of op_variant_key_add Will remove a given value from the field identified by primary_key and associated zip_keys | def op_variant_key_remove(v1: dict, v2: dict):
primary_key = v2["__migrator"]["primary_key"]
ordering = v2["__migrator"].get("ordering", {})
if primary_key not in v2:
return v1
assert len(v2[primary_key]) == 1
result = v1.copy()
if primary_key not in v1:
return v1
if v2[prima... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove(self, key):",
"def delete(self, key):",
"def decrease_key(self, old_item, new_item):",
"def removeKey(self, time, attributeIndex, view) -> None:\n ...",
"def deletefield_serialized(self, serialized_dict_fieldname, keyname):\n # create on first use\n sdict = self.getcreate_se... | [
"0.63070697",
"0.618828",
"0.6028015",
"0.5932477",
"0.57927865",
"0.57927865",
"0.5791122",
"0.5726361",
"0.5716535",
"0.5685274",
"0.5669556",
"0.56588787",
"0.56340647",
"0.562843",
"0.56010383",
"0.56010383",
"0.5578622",
"0.5577739",
"0.55693454",
"0.55656815",
"0.555638... | 0.6951808 | 0 |
Adds the two variants together. Present this assumes mostly flat dictionaries. | def variant_add(v1: dict, v2: dict) -> Dict[str, Any]:
left = set(v1.keys()).difference(v2.keys())
right = set(v2.keys()).difference(v1.keys())
joint = set(v1.keys()) & set(v2.keys())
# deal with __migrator: ordering
if "__migrator" in v2:
ordering = v2["__migrator"].get("ordering", {})
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __iadd__(self, other):\n if not isinstance(other, dict):\n msg = 'Can not concatenate Dict and {}'.format(type(other))\n raise TypeError(msg)\n for key, val in other.items():\n if key in self:\n self._append_key(key, val)\n else:\n ... | [
"0.71016604",
"0.6687375",
"0.6671997",
"0.6645548",
"0.65807945",
"0.6534333",
"0.6532504",
"0.6514086",
"0.642365",
"0.63931966",
"0.6333451",
"0.632827",
"0.631578",
"0.63134897",
"0.63060707",
"0.6288282",
"0.6281028",
"0.624485",
"0.6204847",
"0.6193211",
"0.6169858",
... | 0.71381205 | 0 |
returns the top 10 hot posts of a subreddit | def top_ten(subreddit):
req = get(
"https://www.reddit.com/r/{}/hot.json".format(subreddit),
headers={
"User-Agent": "alx_app"},
params={
"limit": 10},
allow_redirects=False)
if req.status_code != 200:
print(None)
else:
posts = req.json... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def top_ten(subreddit):\n # Set the Default URL strings\n base_url = 'https://www.reddit.com'\n api_uri = '{base}/r/{subreddit}/hot.json'.format(base=base_url,\n subreddit=subreddit)\n\n # Set an User-Agent\n user_agent = {'User-Agent': 'Python/req... | [
"0.87740755",
"0.8551153",
"0.8530817",
"0.8520363",
"0.8515481",
"0.8493739",
"0.84725714",
"0.846851",
"0.8451546",
"0.83947957",
"0.83192",
"0.82772213",
"0.82679176",
"0.8231291",
"0.8152542",
"0.8084891",
"0.79385006",
"0.66534495",
"0.65862656",
"0.65706605",
"0.6566728... | 0.8756562 | 1 |
copies memory region to target | def transfer_mem_to_target(ava, addr, length):
memory = ava.get_emulator().read_untyped_memory(addr, length)
# is this file needed ?
f = open("/tmp/ava_memory", "wb")
f.write(memory)
f.close()
ava.get_target().write_untyped_memory(addr, memory) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copyToMemory(self):\n self.chip8.execute(0xA200)\n self.chip8.execute(0xF355)\n \n memory = self.chip8.get_memory()\n \n self.assertEquals(0x64, memory[0x200])\n self.assertEquals(0x27, memory[0x201])\n self.assertEquals(0x12, memory[0x202])\n self... | [
"0.70634645",
"0.65543485",
"0.6542874",
"0.65159744",
"0.6494028",
"0.6074958",
"0.59726983",
"0.59609324",
"0.5838958",
"0.5825447",
"0.5791971",
"0.5775147",
"0.574704",
"0.5732286",
"0.56587934",
"0.5639653",
"0.561292",
"0.55937195",
"0.5586571",
"0.5575065",
"0.5549883"... | 0.6598923 | 1 |
Normalise `data` with `method`. | def normalise(data, method='robust'):
if method == 'none':
return data
X_train, y_train = data['train']
X_test, y_test = data['test']
if method == 'l2':
trans = Normalizer('l2')
elif method == 'l1':
trans = Normalizer('l1')
elif method == 'max':
trans = Normaliz... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normalizeData(self, data):\n return _normalizeData(data)",
"def normalizeData(self, data):\n return _normalizeData(data)",
"def _normalize_data(self, method='median'):\n pos = np.unique(self.pos.values())\n if hasattr(self, '_raw_data'):\n # data has been already norm... | [
"0.664215",
"0.664215",
"0.66214716",
"0.645304",
"0.6414288",
"0.59048855",
"0.5894692",
"0.579599",
"0.5795024",
"0.57588947",
"0.5736198",
"0.5692712",
"0.56588334",
"0.56385547",
"0.55809",
"0.5575806",
"0.55684525",
"0.55614847",
"0.5551331",
"0.5532262",
"0.5529146",
... | 0.719362 | 0 |
Add item to antecedent. The item is referred by its integer index in the Dataset's class item_map. | def add_item(self, item: int) -> None:
self._antecedent.add(item)
self._is_updated = False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_item(self, item: _T) -> None:\n if item not in self.item_to_index:\n self.item_to_index[item] = len(self.index_to_item)\n self.index_to_item.append(item)",
"def insert(self, index, item, **data):\n self._items.insert(index, item)\n if data:\n self._da... | [
"0.7285183",
"0.721489",
"0.69845754",
"0.6951152",
"0.69472486",
"0.69015056",
"0.68756527",
"0.68270767",
"0.6778824",
"0.6686906",
"0.66840726",
"0.66775227",
"0.667459",
"0.66699153",
"0.666135",
"0.6648642",
"0.66188776",
"0.66167444",
"0.6610533",
"0.6567288",
"0.654718... | 0.75221163 | 0 |
Set the rule cover. A rule's cover is defined as the set of tx where each tx contain, at least, every item of the antecedent. | def set_cover(self) -> None:
self._cover = self.Dataset.get_tx(self.antecedent)
self._is_updated = True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_cover():\n # D corresponds to the items and the transactions in which they appear, it is the standard code table\n D = {\n \"B\": Bitmap([0, 1, 2]),\n \"A\": Bitmap([0, 1]),\n \"C\": Bitmap([0, 2]),\n \"D\": Bitmap([2])\n }\n # ct corresponds to the itemsets on whic... | [
"0.63607657",
"0.5506088",
"0.53575146",
"0.5009679",
"0.49268153",
"0.4916378",
"0.49098012",
"0.49074882",
"0.4712941",
"0.468891",
"0.46558678",
"0.46091798",
"0.46064308",
"0.45859864",
"0.45858896",
"0.4548548",
"0.45357782",
"0.45056817",
"0.45021358",
"0.44778836",
"0.... | 0.6475326 | 0 |
Return size of a Rule's cover. | def get_cover_size(self) -> int:
if self._is_updated:
return len(self._cover)
else:
self.set_cover()
return len(self._cover) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rule_size(self):\n # Subclasses must implement\n raise NotImplementedError()",
"def size(img):\n\treturn img.size",
"def calculate_size_of_face(face):\n face_rectangle = face['faceRectangle']\n return face_rectangle['height'] * face_rectangle['width']",
"def estimate_size(self, metric... | [
"0.66422546",
"0.6323344",
"0.6314126",
"0.6312078",
"0.62824315",
"0.611819",
"0.6046611",
"0.60433245",
"0.601714",
"0.6008915",
"0.5959957",
"0.59395593",
"0.59051675",
"0.5896375",
"0.5878652",
"0.58603823",
"0.5841926",
"0.5839459",
"0.58292717",
"0.5829262",
"0.5829262"... | 0.7512899 | 0 |
Calculate rule's quality based on population comparison. | def __population_quality(self) -> float:
population_identifier = np.zeros(shape=self.Dataset.size)
subgroup_identifier = np.ones(shape=len(self.get_cover()))
group = np.concatenate((population_identifier,
subgroup_identifier))
subgroup_times = self.Datase... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quality(self) -> float:\n if self.get_cover_size() == 0:\n return 0\n else:\n if self.baseline == Baseline.COMPLEMENT:\n return self.__complement_quality()\n else:\n return self.__population_quality()",
"def quality(self):\n retu... | [
"0.66970223",
"0.5953626",
"0.5884621",
"0.5861454",
"0.5777613",
"0.57635385",
"0.56831676",
"0.56635755",
"0.5660936",
"0.5660121",
"0.56468016",
"0.55824685",
"0.55530643",
"0.5549114",
"0.55027944",
"0.5470385",
"0.54665667",
"0.54642165",
"0.54304343",
"0.54241496",
"0.5... | 0.6649643 | 1 |
Return m unique elements from seq. This differs from random.sample which can return repeated elements if seq holds repeated elements. | def _random_subset(seq,m):
targets=set()
while len(targets)<m:
x=random.choice(seq)
targets.add(x)
return targets | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _random_subset(seq, m, seed):\n targets = set()\n random.seed(seed)\n\n while len(targets) < m:\n x = random.choice(seq)\n targets.add(x)\n return targets",
"def _random_subset(seq,m):\n targets=random.sample(seq,m)\n return targets",
"def uniq(seq):\r\n #TODO: consider b... | [
"0.6833673",
"0.67812353",
"0.66714054",
"0.6639743",
"0.66018486",
"0.6498079",
"0.64757186",
"0.63902223",
"0.63586974",
"0.6340857",
"0.6323978",
"0.62420183",
"0.6149607",
"0.60836285",
"0.5988587",
"0.59662473",
"0.59365505",
"0.5886765",
"0.58522433",
"0.5841388",
"0.58... | 0.70336443 | 0 |
creates a PA_Graph on total_nodes where each vertex is iteratively connected to a number of existing nodes equal to out_degree | def make_PA_Graph(total_nodes, out_degree):
# initialize graph by creating complete graph and trial object
pa_graph = make_complete_graph(out_degree)
trial = PATrial(out_degree)
# total_nodes - out_degree new nodes
for vertex in range(out_degree, total_nodes):
# add edges from vertex to nei... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_PA_Graph(total_nodes, out_degree):\n #initialize graph by creating complete graph and trial object\n PA_graph = make_complete_graph(out_degree)\n trial = PATrial(out_degree)\n \n for vertex in range(out_degree, total_nodes):\n neighbours = trial.run_trial(out_degree)\n\n for x... | [
"0.85271704",
"0.76810724",
"0.6371219",
"0.6120834",
"0.5941079",
"0.5823242",
"0.5688106",
"0.56852865",
"0.5631199",
"0.56268394",
"0.562076",
"0.5590116",
"0.55806994",
"0.5578974",
"0.55785924",
"0.5535074",
"0.55113244",
"0.5499018",
"0.54967934",
"0.54768217",
"0.54536... | 0.83586967 | 1 |
Return a json list of Temperature Observations (tobs) for the previous year | def prior_year_temp():
tobs_data = session.query(Measurements.tobs).all()
return jsonify (tobs_data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tobsdata():\n # query for the dates and temperature observations from a year from the last data point.\n # * Return a JSON list of Temperature Observations (tobs) for the previous year.\n # as this should be a list, I'm just grabbing the station name\n session = Session(engine)\n results = ses... | [
"0.7804016",
"0.77074",
"0.76585793",
"0.7623904",
"0.74057007",
"0.73627263",
"0.73342705",
"0.7327496",
"0.72380286",
"0.71261024",
"0.70932883",
"0.705637",
"0.7048202",
"0.69966257",
"0.6834264",
"0.6800696",
"0.6793342",
"0.671503",
"0.66767067",
"0.665408",
"0.6603448",... | 0.8164726 | 0 |
The address prefix for the subnet. | def address_prefix(self) -> Optional[str]:
return pulumi.get(self, "address_prefix") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subnet_prefix(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"subnet_prefix\")",
"def address(self):\n return f'Address = {self._peer.address}/{self._peer.subnet.prefixlen}'",
"def ip_address_prefix(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"ip_address_pr... | [
"0.8456444",
"0.73371416",
"0.73144144",
"0.70593494",
"0.68268055",
"0.68268055",
"0.67546654",
"0.66836154",
"0.6676087",
"0.6676087",
"0.6676087",
"0.6659034",
"0.66367656",
"0.6625999",
"0.6592486",
"0.6561303",
"0.6558842",
"0.6558842",
"0.6553532",
"0.65478146",
"0.6540... | 0.7860963 | 1 |
List of address prefixes for the subnet. | def address_prefixes(self) -> Optional[Sequence[str]]:
return pulumi.get(self, "address_prefixes") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def address_space_prefixes(self) -> pulumi.Output[Sequence[str]]:\n return pulumi.get(self, \"address_space_prefixes\")",
"def prefixes_ipv4(self):\n with open(self.ixpfx) as f:\n ixpfx = json.load(f)\n return [item['prefix'] for item in ixpfx['data'] if item['protocol'] == 'IPv4'... | [
"0.7217134",
"0.68598527",
"0.6699628",
"0.6594995",
"0.6529257",
"0.63090855",
"0.63026154",
"0.6236474",
"0.6188097",
"0.6143286",
"0.6110135",
"0.6016452",
"0.5978344",
"0.59678084",
"0.5959655",
"0.59477854",
"0.5937565",
"0.5923453",
"0.5920298",
"0.5900372",
"0.58760345... | 0.73914975 | 0 |
Application gateway IP configurations of virtual network resource. | def application_gateway_ip_configurations(self) -> Optional[Sequence['outputs.ApplicationGatewayIPConfigurationResponse']]:
return pulumi.get(self, "application_gateway_ip_configurations") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def config_networking(\n self, network_obj, ip, netmask, gateway, domain, dns, guest_hostname\n ):\n\n global_ip = vim.vm.customization.GlobalIPSettings()\n adapter_map = vim.vm.customization.AdapterMapping()\n adapter_map.adapter = vim.vm.customization.IPSettings()\n adapter_... | [
"0.6793302",
"0.6702352",
"0.66525227",
"0.64904726",
"0.62177926",
"0.62097025",
"0.6145779",
"0.6093355",
"0.60801107",
"0.60752237",
"0.6043739",
"0.6042491",
"0.6042491",
"0.60020685",
"0.60009557",
"0.5995659",
"0.5987026",
"0.5980703",
"0.597368",
"0.5965468",
"0.593742... | 0.69225484 | 0 |
An array of references to the delegations on the subnet. | def delegations(self) -> Optional[Sequence['outputs.DelegationResponse']]:
return pulumi.get(self, "delegations") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_addrs(self) -> List[Multiaddr]:",
"def address(self):\n addrlist = []\n for s in self.srv_socks:\n addrlist.append(s.getsockname())\n return addrlist",
"def delegations(self) -> Optional[Sequence['outputs.AssessmentDelegation']]:\n return pulumi.get(self, \"delega... | [
"0.6074407",
"0.5993793",
"0.59192604",
"0.57772666",
"0.5720409",
"0.57160467",
"0.571128",
"0.5668905",
"0.56133896",
"0.5596342",
"0.5543248",
"0.55366886",
"0.5515544",
"0.5511527",
"0.54806215",
"0.5442743",
"0.5406457",
"0.5404429",
"0.54037637",
"0.53865397",
"0.536239... | 0.6553395 | 0 |
Array of IpAllocation which reference this subnet. | def ip_allocations(self) -> Optional[Sequence['outputs.SubResourceResponse']]:
return pulumi.get(self, "ip_allocations") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subnetting(self):\n ip = netaddr.IPNetwork(addr=self.subnet)\n subnets = list(ip.subnet(prefixlen=24))\n list_subnets = [str(subnet) for subnet in subnets]\n return list_subnets",
"def get_allocations(self):\n cursor = self.cur()\n cursor.execute('SELECT {col1}, {col... | [
"0.58909863",
"0.5784412",
"0.5724429",
"0.5680787",
"0.5672744",
"0.5654617",
"0.55980235",
"0.55237967",
"0.5511028",
"0.5415864",
"0.53783077",
"0.53783077",
"0.5366475",
"0.5286154",
"0.52718145",
"0.52589434",
"0.52510357",
"0.52501637",
"0.52343416",
"0.52343416",
"0.52... | 0.65951353 | 0 |
Array of IP configuration profiles which reference this subnet. | def ip_configuration_profiles(self) -> Sequence['outputs.IPConfigurationProfileResponse']:
return pulumi.get(self, "ip_configuration_profiles") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def available_profiles(cls) -> List[str]:\n return list(cfg.get(\"profiles\"))",
"def profiles(self):\n return self._profiles",
"def profiles(self):\n return self._profiles",
"def ip_configurations(self) -> Sequence['outputs.IPConfigurationResponse']:\n return pulumi.get(self, \"i... | [
"0.6466335",
"0.64325786",
"0.64325786",
"0.6285409",
"0.6014145",
"0.59605086",
"0.5923912",
"0.5909064",
"0.59021586",
"0.58062845",
"0.5709881",
"0.56835115",
"0.56835115",
"0.56638646",
"0.5645613",
"0.5598191",
"0.5572112",
"0.55718476",
"0.5570511",
"0.5556854",
"0.5547... | 0.7485992 | 0 |
Nat gateway associated with this subnet. | def nat_gateway(self) -> Optional['outputs.SubResourceResponse']:
return pulumi.get(self, "nat_gateway") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_nat_gateway(self, name, subnet):\n eip_name = \"{}ElasticIP\".format(name)\n\n self.template.add_resource(EIP(\n eip_name,\n Domain=\"vpc\"\n ))\n\n self.template.add_resource(NatGateway(\n name,\n AllocationId=GetAtt(eip_name, 'Alloca... | [
"0.7185118",
"0.6676875",
"0.6669561",
"0.6644688",
"0.6621967",
"0.6566101",
"0.65514493",
"0.64287084",
"0.6345615",
"0.61693203",
"0.6044162",
"0.594309",
"0.59395903",
"0.5921957",
"0.59191823",
"0.58555955",
"0.5849569",
"0.5844909",
"0.5825161",
"0.58167374",
"0.5816054... | 0.74195427 | 0 |
The reference to the NetworkSecurityGroup resource. | def network_security_group(self) -> Optional['outputs.NetworkSecurityGroupResponse']:
return pulumi.get(self, "network_security_group") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def security_group(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"security_group\")",
"def security_group_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"security_group_id\")",
"def security_group_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"secu... | [
"0.61486256",
"0.5980633",
"0.5980633",
"0.5957386",
"0.5957386",
"0.58578396",
"0.5758829",
"0.5758829",
"0.5742902",
"0.5718561",
"0.5653038",
"0.56506914",
"0.5594251",
"0.55926985",
"0.55347663",
"0.55164385",
"0.54995966",
"0.54956484",
"0.548954",
"0.54870534",
"0.54159... | 0.7118084 | 0 |
An array of references to private endpoints. | def private_endpoints(self) -> Sequence['outputs.PrivateEndpointResponse']:
return pulumi.get(self, "private_endpoints") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private_endpoints(self) -> Optional[Sequence['outputs.AiEndpointDeployedModelPrivateEndpoint']]:\n return pulumi.get(self, \"private_endpoints\")",
"def endpoints(self):\n return self[\"endpoints\"]",
"def private_endpoint_connections(self) -> Sequence['outputs.PrivateEndpointConnectionRespon... | [
"0.7397926",
"0.73414296",
"0.70065004",
"0.6999438",
"0.68656933",
"0.6818611",
"0.6810438",
"0.67498505",
"0.67267257",
"0.6717912",
"0.6583228",
"0.64902496",
"0.6381035",
"0.62989557",
"0.61985457",
"0.61612767",
"0.6137386",
"0.6120038",
"0.6120038",
"0.6050902",
"0.6024... | 0.7767238 | 0 |
The reference to the RouteTable resource. | def route_table(self) -> Optional['outputs.RouteTableResponse']:
return pulumi.get(self, "route_table") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def route_table_id(self):\n return self._route_table_id",
"def table_reference(self) -> 'outputs.TableReferenceResponse':\n return pulumi.get(self, \"table_reference\")",
"def table_ref(self):\n return self._table_ref",
"def table(self):\n return self.reference.table",
"def get(... | [
"0.7157897",
"0.7102249",
"0.657457",
"0.6428238",
"0.61176395",
"0.6112945",
"0.60934347",
"0.60783446",
"0.604512",
"0.58873767",
"0.5856369",
"0.576922",
"0.576922",
"0.5754943",
"0.5753837",
"0.57489276",
"0.57415915",
"0.57415915",
"0.57292205",
"0.5700971",
"0.5676525",... | 0.7583651 | 0 |
An array of service endpoint policies. | def service_endpoint_policies(self) -> Optional[Sequence['outputs.ServiceEndpointPolicyResponse']]:
return pulumi.get(self, "service_endpoint_policies") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_policies():\r\n policy = policies.values()\r\n return policy",
"def policies(self):\n return self._policies",
"def policies(self):\n return self._data.get('policies')",
"def list_policies(profile=None, api_key=None):\n return salt.utils.pagerduty.list_items(\n \"escalati... | [
"0.6886451",
"0.6881124",
"0.6874453",
"0.66307586",
"0.6422492",
"0.63475406",
"0.63140595",
"0.6261505",
"0.623031",
"0.6116548",
"0.60943675",
"0.6058576",
"0.6055934",
"0.60507774",
"0.60311985",
"0.597425",
"0.59084076",
"0.5894807",
"0.58671844",
"0.5864386",
"0.5844417... | 0.8085833 | 0 |
Gets the specified subnet by virtual network and resource group. | def get_subnet(expand: Optional[str] = None,
resource_group_name: Optional[str] = None,
subnet_name: Optional[str] = None,
virtual_network_name: Optional[str] = None,
opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSubnetResult:
__args__ = dict... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def subnet(self) -> pulumi.Output[Optional['outputs.ResourceIdResponse']]:\n return pulumi.get(self, \"subnet\")",
"def subnet_get(auth=None, **kwargs):\n cloud = get_operator_cloud(auth)\n kwargs = _clean_kwargs(**kwargs)\n return cloud.get_subnet(**kwargs)",
"def subnet(self) -> Optional[pulu... | [
"0.7312933",
"0.7148066",
"0.710691",
"0.70535386",
"0.70116264",
"0.68666935",
"0.68608004",
"0.6636804",
"0.65658665",
"0.6514931",
"0.6431516",
"0.6405462",
"0.6330611",
"0.63169676",
"0.63135105",
"0.6246402",
"0.6246402",
"0.6231587",
"0.6222032",
"0.6215549",
"0.6205137... | 0.7260748 | 1 |
Detuning envelope for e>f DRAG. | def detuning_envelope_ef(t, args):
anharms = args['anharms']
couplings = args['couplings']
e = args['e']
g = args['g']
couplings = [c/g for c in couplings]
coeff = (couplings[e-1]**2 \
- (anharms[e+2]**2/anharms[e-1]**2) \
* couplings[e+1]) / (4*anharms[e+2])
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_constant_detuning_DRAG_envelopes(sample_rate,\n gate_time,\n envelope_args,\n modulation_args=None,\n quantization_args=None,\n ... | [
"0.5720977",
"0.53673065",
"0.5162663",
"0.51391846",
"0.51150006",
"0.50175667",
"0.49186143",
"0.48840868",
"0.487227",
"0.4864288",
"0.48613483",
"0.48129016",
"0.48019576",
"0.47641316",
"0.47349223",
"0.4726761",
"0.47200078",
"0.4700241",
"0.469693",
"0.46690148",
"0.46... | 0.5676101 | 1 |
Remove a user from the admins. | def admins_remove(request):
if len(models.User.admins()) > 1:
username = request.params['remove']
user = models.User.get_by_username(username)
user.admin = False
return httpexceptions.HTTPSeeOther(
location=request.route_url('admin_admins')) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_user(self):\n User.user_list.remove(self)",
"def delete_user(self):\n User.user_list.remove(self)",
"def delete_user(self):\n User.user_list.remove(self)",
"def delete_user(self):\n\n User.user_list.remove(self)",
"async def rmadmin(self, ctx, user: discord.Member):\n... | [
"0.76677775",
"0.76677775",
"0.76677775",
"0.7574518",
"0.7236373",
"0.7231852",
"0.7179078",
"0.71135014",
"0.7095625",
"0.7061543",
"0.7059603",
"0.7029014",
"0.7025965",
"0.7008685",
"0.69443625",
"0.6942618",
"0.69400847",
"0.69287014",
"0.69026935",
"0.68940604",
"0.6882... | 0.78273076 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.