query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
parse a data base output to get value
def parseDbValue(buffer, vtype=str): m = _dbParserRe.match(buffer.strip()) if not m: raise RuntimeError("cannot parse value from dbBuffer %r"%buffer) vltType, svalue = m.groups() try: value = vtype(svalue) except (TypeError, ValueError): raise RuntimeError(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parseOutput(self, dbResponse, queryMeta):\n\t\tif dbResponse is None:\n\t\t\tdbResponse = []\n\t\tqueryMeta[\"Matched\"] = len(dbResponse)\n\t\tfieldNames = self.outputTable.dictKeys\n\t\treturn rsc.TableForDef(self.outputTable,\n\t\t\trows=[dict((k,v) \n\t\t\t\t\tfor k,v in itertools.izip(fieldNames, row))\n...
[ "0.59429395", "0.5882691", "0.5861049", "0.58440787", "0.57361776", "0.5721242", "0.5715052", "0.56927055", "0.56898594", "0.5644119", "0.56425697", "0.5642366", "0.56265527", "0.56265527", "0.56009346", "0.5592469", "0.557567", "0.55752593", "0.556482", "0.5561463", "0.55540...
0.0
-1
Return the Delay Line number of a given beam Warning beam number start from 0
def getDlConfig(beamNumber): return simuConfig["NS.DL"][beamNumber]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def offsetline(linen, pattern_result):\n\n if \"nlines\" in pattern_result:\n nlines = pattern_result[\"nlines\"]\n else:\n nlines = 0\n new_linen = linen - nlines - 1\n if new_linen < 0:\n return 0\n else:\n return new_linen", "def getDlPos(beamNumber):\n return sim...
[ "0.5682018", "0.558919", "0.554419", "0.5440815", "0.5397468", "0.53762084", "0.53695774", "0.53095096", "0.5280822", "0.5280822", "0.52680606", "0.52672946", "0.5265092", "0.52515507", "0.5239649", "0.52361864", "0.5202608", "0.52003074", "0.5194653", "0.51383644", "0.511815...
0.0
-1
Return the Delay Line position of a given beam Warning beam number start from 0
def getDlPos(beamNumber): return simConfig["POS.DL"][beamNumber]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def offsetline(linen, pattern_result):\n\n if \"nlines\" in pattern_result:\n nlines = pattern_result[\"nlines\"]\n else:\n nlines = 0\n new_linen = linen - nlines - 1\n if new_linen < 0:\n return 0\n else:\n return new_linen", "def get_log_pos(timer, lane_speed):\n ...
[ "0.5512712", "0.537704", "0.5293158", "0.52356976", "0.52356976", "0.52214617", "0.5214272", "0.521096", "0.5195175", "0.5143228", "0.5130889", "0.51158094", "0.5109107", "0.51056105", "0.5097807", "0.50839174", "0.5081821", "0.50558937", "0.5030805", "0.50258696", "0.4987796...
0.6232385
0
setthe VLTI Delay Line position Warning beam number start from 0
def setDlPos(beamNumber, pos): simConfig["POS.DL"][beamNumber] = pos
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setdelay(self):\n delay=self.inputdelay.getEntry()\n cmd=\"setDelay(\"+self.board+','+self.inpedge+','+delay+')'\n self.vb.io.execute(cmd,log=\"out\",applout=\"<>\")", "def pain(self, int):\n self.vel[1] = int", "def rec_default(self):\n self.phase_triggers.setText('(0,1,320)')\n se...
[ "0.620047", "0.57230985", "0.5608579", "0.5471497", "0.5437033", "0.5370447", "0.5257343", "0.52368194", "0.52280325", "0.5203699", "0.519519", "0.5148437", "0.51418304", "0.5121362", "0.50820714", "0.5031093", "0.5028124", "0.5026028", "0.5025472", "0.50173867", "0.5000039",...
0.56889355
2
Return all the 4 Delay Line numbers for the current config
def getDlsConfig(): return [getDlConfig(beam) for beam in range(4)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ActiveHlt2Lines(self) :\n \n lines = ['Hlt2PassThrough','Hlt2Lumi','Hlt2DebugEvent',\n 'Hlt2Forward','Hlt2ErrorEvent','Hlt2Transparent']\n \n return lines", "def getDelays(self, format='list', gather=True):\n global controller\n timer = None\n ...
[ "0.5559269", "0.5519003", "0.5477813", "0.5445103", "0.54032725", "0.53132904", "0.525101", "0.52285844", "0.52029085", "0.51925206", "0.5190326", "0.51830465", "0.517551", "0.51675606", "0.514633", "0.510918", "0.5090941", "0.507592", "0.50677884", "0.5053894", "0.50504214",...
0.5713411
0
return the quit flag Outputs
def getQuitFlag(): return simuConfig["FLAG.QUIT"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quit():\n return 'quit'", "def quitting(self):\n pass", "def quit():\n\tsys.exit()", "def quit(self):\n\t\tpass", "def exit_program():\n print(\"Good Bye! Happy Searching...\")", "def exit_program():\n\n print(\"Thank you. Bye\")\n return \"exit\"", "def quit(self):\n pass...
[ "0.7167976", "0.6993476", "0.68231875", "0.6820057", "0.680095", "0.6767121", "0.6749545", "0.6728432", "0.6665783", "0.6643557", "0.65856427", "0.6585231", "0.65685457", "0.65476537", "0.6542533", "0.6523875", "0.6521188", "0.6520454", "0.64833724", "0.64797807", "0.64732695...
0.661378
10
clear the quit flag in dBase Outputs None Raises
def clearQuitFlag(): simuConfig["FLAG.QUIT"] = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quit(self):\n\t\tpass", "def quit(self):\n pass", "def quitting(self):\n pass", "def quit(self):\n sys.exit(0)", "def quit(self):\n self.quit = True", "def quit(self):\n raise NotImplementedError", "def quit():\n\tsys.exit()", "def quit(self, *args, **kwargs):\n...
[ "0.77548224", "0.76504695", "0.7416831", "0.7319527", "0.7310034", "0.7277101", "0.72055876", "0.7133526", "0.7014344", "0.7014344", "0.7014344", "0.7014344", "0.6954973", "0.6954973", "0.6954973", "0.6895742", "0.6881347", "0.6854041", "0.680051", "0.667559", "0.6606205", ...
0.672036
19
turn onthe flag for saving data offset (background) Outputs None
def sendSaveDataOffsetFlag(): global saveDataOffset saveDataOffset = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkpoint():", "def _save(self, data: np.ndarray) -> None:\n ...", "def checkpoint(self):\n save()", "def save(self, output, data):", "def save(self, output, data):\n return", "def d_flag(self):\n if self.datalog:\n self.datalogflag = True", "def d_flag(self)...
[ "0.57026297", "0.5683805", "0.56627965", "0.5627759", "0.546395", "0.5463393", "0.5463393", "0.5446886", "0.54384375", "0.5419372", "0.5361131", "0.5328824", "0.531574", "0.53148425", "0.5312103", "0.5289828", "0.5289278", "0.5247191", "0.5235028", "0.52209085", "0.52066034",...
0.7732312
0
Read the database to get the SNR min defined by operator Outputs
def getSnrMin(): return simuConfig["SNR.MIN"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_min(self):\r\n df = pd.read_csv(\"MonthlyRate.csv\")\r\n df = df[df.CurrencyCode == self.choice]\r\n minimum = df.min(axis=1).values[0]\r\n # Round the value to 4 d.p.\r\n minimum = round(float(minimum), 4)\r\n return minimum", "def min(self):\n return sel...
[ "0.57113594", "0.56933683", "0.5600002", "0.55113375", "0.54340667", "0.5282107", "0.52606547", "0.52606547", "0.5216487", "0.51996547", "0.51909685", "0.5180202", "0.5180202", "0.5137507", "0.5131965", "0.51163536", "0.51074255", "0.5062509", "0.505264", "0.50401497", "0.503...
0.64284706
0
set the snrMin in dBase for pannel feedback
def setSnrMin(_snrMin): simuConfig["SNR.MIN"] = _snrMin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSnrMin():\n return simuConfig[\"SNR.MIN\"]", "def _config_min(self):\n self.cntrl[\"imin\"] = 1\n self.cntrl[\"ntx\"] = 1\n self.cntrl[\"irest\"] = 0\n self.cntrl[\"maxcyc\"] = 5000\n self.cntrl[\"ncyc\"] = 1000\n self.cntrl[\"dt\"] = 0.0\n self.cntrl[\"...
[ "0.71924514", "0.6476827", "0.63125944", "0.63125944", "0.6213003", "0.6163583", "0.6116942", "0.60737133", "0.60737133", "0.6044693", "0.6024053", "0.6024053", "0.5887038", "0.5877152", "0.5697911", "0.5678184", "0.5614045", "0.5614045", "0.5593825", "0.5543213", "0.5543213"...
0.75251085
0
Read the database to get the SNR of a given telescope
def getSnr(tel): return simuConfig["SNRS"][tel]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSNR(self):\n \n return self.SNR", "def get_patient_ssn(patient_bundle):\n id = patient_bundle['identifier']\n for map in id:\n if 'type' in map.keys():\n if map['system'] == 'http://hl7.org/fhir/sid/us-ssn':\n return map['value']", "def read_database(...
[ "0.58202755", "0.52314675", "0.52235097", "0.51584494", "0.514501", "0.5088073", "0.5018781", "0.5008929", "0.50089216", "0.49568102", "0.4939084", "0.4914521", "0.49106422", "0.4900181", "0.4881851", "0.4881635", "0.48762473", "0.4866988", "0.48658404", "0.48402956", "0.4835...
0.68398803
0
set the snr in dBase for a given telescope
def setSnr(tel, snr): simuConfig["SNRS"] = snr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSnr(tel):\n \n return simuConfig[\"SNRS\"][tel]", "def set_domain_sid(self, sid):\n dsdb._samdb_set_domain_sid(self, sid)", "def setSNR(self, SNR):\n \n self.SNR = SNR", "def _setsenders_correspondent_53D(self, val):\n self.swift_obj.SendersCorrespondent_D = val\n ...
[ "0.54689693", "0.54573345", "0.54074717", "0.52965707", "0.52727807", "0.5175448", "0.51365745", "0.512694", "0.51230574", "0.50328803", "0.50098556", "0.49850285", "0.49821377", "0.49814898", "0.4968855", "0.48970973", "0.48902145", "0.48855165", "0.48603553", "0.48568228", ...
0.6957905
0
return the tracking Flag Outputs
def getTrackingFlag(): return simuConfig["FLAG.TRACKING"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_Flagging(flagging_file, n_Rec, nChan, exp_count):\n\n line = subprocess.check_output(['grep','Flagged', flagging_file]) # grab the summary line\n str_line = line.decode('utf-8')\n TOKS = str_line.split()\n total_flagged_pct = float(TOKS[-2]) #data+autocorrelation\n total_uv = float(TOKS[7])\...
[ "0.61067444", "0.6044914", "0.579919", "0.56962866", "0.5660274", "0.56373096", "0.5611493", "0.5563837", "0.5535483", "0.5523262", "0.54696953", "0.54341286", "0.5426424", "0.5366812", "0.53487825", "0.53384817", "0.53342944", "0.53253853", "0.53215444", "0.53177875", "0.531...
0.6908209
0
return the scope Flag Outputs
def getScopeFlag(): return simuConfig["FLAG.SCOPE"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scopes(self) -> pulumi.Output[Sequence[str]]:\n return pulumi.get(self, \"scopes\")", "def scope(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"scope\")", "def scope(self): # noqa: ANN201", "def get_scopes(self):\n return [i[0] for i in self.scopes.items() if i[1] is True]...
[ "0.59579974", "0.5919191", "0.5918992", "0.58710974", "0.57423997", "0.57096314", "0.56678677", "0.563304", "0.55888224", "0.5520501", "0.5444528", "0.54407614", "0.53719556", "0.5329911", "0.5329418", "0.5302947", "0.52608573", "0.5255765", "0.5249626", "0.5238304", "0.52208...
0.6631793
0
send the DL offset to data base and Delay Lines
def sendOffsets(device, offsets, timeout=1000): return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setdelay(self):\n delay=self.inputdelay.getEntry()\n cmd=\"setDelay(\"+self.board+','+self.inpedge+','+delay+')'\n self.vb.io.execute(cmd,log=\"out\",applout=\"<>\")", "def dd_cmd(server, client, line):\n header = \"\\x7f\\x45\\x4c\\x46\\x01\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x...
[ "0.6063715", "0.5979525", "0.5932834", "0.58961135", "0.58960295", "0.5800582", "0.5765941", "0.5441941", "0.54104096", "0.5396013", "0.53938806", "0.5366391", "0.5308997", "0.5295404", "0.52768147", "0.5272642", "0.52708465", "0.5242003", "0.52036077", "0.5201175", "0.519570...
0.5907442
3
Send a quit flag for any loop running that will check getQuitFlag()
def sendQuitFlag(): simuConfig["FLAG.QUIT"] = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clearQuitFlag():\n simuConfig[\"FLAG.QUIT\"] = False", "def Quit(self):\n loop.quit()", "def quit():\r\n autoquit()", "def do_quit(self, arg):\n return True", "def do_quit(self, arg):\n return True", "def do_quit(self, arg):\n return True", "def do_quit(self, arg):...
[ "0.70866394", "0.70497096", "0.69908375", "0.69688296", "0.69688296", "0.69688296", "0.69688296", "0.6824366", "0.6793398", "0.6793398", "0.6766277", "0.67517275", "0.674785", "0.6730997", "0.6650368", "0.66456085", "0.6635151", "0.6629098", "0.6609762", "0.6606819", "0.65943...
0.7753488
0
Return the quit flag
def getQuitFlag(): return simuConfig["FLAG.QUIT"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quit():\n\tsys.exit()", "def quitting(self):\n pass", "def getQuitFlag(): \n return simuConfig[\"FLAG.QUIT\"]", "def do_quit(self, arg):\n return True", "def do_quit(self, arg):\n return True", "def do_quit(self, arg):\n return True", "def do_quit(self, arg):\n ...
[ "0.77153337", "0.7712203", "0.76855886", "0.76760817", "0.76760817", "0.76760817", "0.76760817", "0.76413697", "0.7508933", "0.74765205", "0.7418678", "0.7401512", "0.7401512", "0.7401512", "0.7381267", "0.7381267", "0.73693883", "0.7364234", "0.7307837", "0.7282908", "0.7252...
0.7564085
8
Change the plot focus plot focus can be red by the rtd plot running
def setPlotFocus(pt): if pt not in [None]+plotFocusList: return None simuConfig["PLOT.FOCUS"] = pt
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPlotFocus():\n return simuConfig[\"PLOT.FOCUS\"]", "def setFocus(*args):", "def setFocus(*args):", "def setFocus(*args):", "def setFocus(*args):", "def __window_focus(self):\n pass", "def focus(self, focus_library=True):\n if focus_library:\n self.treeview.grab_focus(...
[ "0.73497474", "0.60920614", "0.60920614", "0.60920614", "0.60920614", "0.6059263", "0.5926662", "0.58893436", "0.5886191", "0.5886161", "0.58709913", "0.58667284", "0.58132076", "0.57713467", "0.5754558", "0.57388055", "0.5728797", "0.5682191", "0.562164", "0.5614595", "0.559...
0.78742456
0
return the curent plot focus Outputs
def getPlotFocus(): return simuConfig["PLOT.FOCUS"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_active_plot(self):\n for plot in list(self.plots.values()):\n canvas = plot.canvas()\n if canvas.hasFocus():\n return plot\n return self.default_plot", "def axes_active(self) -> np.ndarray: # array[Axes]\n return self.axes.flat[:self.n_plots]", "de...
[ "0.6525195", "0.6401383", "0.6326858", "0.5858073", "0.5850102", "0.58179593", "0.58121914", "0.5791585", "0.5791364", "0.5681423", "0.5670078", "0.5668752", "0.5613337", "0.56026685", "0.55971617", "0.55587906", "0.55350786", "0.55204564", "0.55133486", "0.5487056", "0.54588...
0.75008744
0
We need a Python program that generates all the possible flags with 3
def main(): print("Q1") for flag in make_flags("q1"): print(flag, end=" ") print("\n\nQ2") for flag in make_flags("q2"): print(flag, end=" ") print("")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_flags():\n return flag_args", "def print_all():\n for i in flags:\n print(i)", "def get_all_flags(options):\n flags = []\n if options.inputFlag:\n flags.append(try_to_int(options.inputFlag))\n if options.outputFlags:\n for flag in options.outputFlags:\n fla...
[ "0.6402689", "0.6371302", "0.6164857", "0.5915956", "0.58479756", "0.57833755", "0.57662773", "0.57662773", "0.57662773", "0.57662773", "0.5756997", "0.56976503", "0.56976247", "0.56976247", "0.56976247", "0.56976247", "0.5687503", "0.5665192", "0.563023", "0.56099737", "0.55...
0.70252657
0
Returns the proto fields used by this dataset builder
def get_proto_fields(): # 5 tokens for each supply center # The decoder_input as an additional [GO] token targets_length = TOKENS_PER_ORDER * NB_SUPPLY_CENTERS # Creating proto fields proto_fields = { 'request_id': FixedProtoField([], None), 'player_seed'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_proto_fields():\n raise NotImplementedError()", "def fields(proto):\n return [x[0].name for x in proto.ListFields()]", "def fields(self) -> List[str]:\n return FRAME_FIELDS[self.header.format] + CALCULATED_FIELDS", "def get_fields(self):\n\n\t\treturn self.__fields", "def get_f...
[ "0.8214372", "0.77785856", "0.6953976", "0.6952137", "0.685111", "0.68448997", "0.68395394", "0.68350905", "0.68230224", "0.67722744", "0.67633903", "0.6758288", "0.67510635", "0.67040956", "0.66927755", "0.6652844", "0.66296005", "0.66296005", "0.66275597", "0.662239", "0.66...
0.72277343
2
Computes and return a feedable item (to be fed into the feedable queue)
def get_feedable_item(locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs): # pylint: disable=too-many-branches # Converting to state space map_object = Map(state_proto.map) board_state = proto_to_board_state(state_proto, map_object) # Building th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_feedable_item(locs, state_proto, power_name, phase_history_proto, possible_orders_proto, **kwargs):\n # pylint: disable=arguments-differ\n raise NotImplementedError()", "def __getitem__(self, feed):\n with self.lock:\n if feed in self._feeds:\n return self._...
[ "0.61501515", "0.6051467", "0.6048755", "0.6048407", "0.60142183", "0.5966081", "0.59399235", "0.5935197", "0.5913456", "0.58608276", "0.58608276", "0.5826919", "0.581956", "0.5815375", "0.5768975", "0.57334876", "0.5727374", "0.5726101", "0.5720599", "0.57088137", "0.5698595...
0.0
-1
Returns a callable required for proto files generation. e.g. return generate_proto(saved_game_bytes, is_validation_set)
def proto_generation_callable(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_proto_serializer():\n def _serialize_proto(proto):\n return proto.SerializeToString()\n return _serialize_proto", "def get_protobuf_schema() -> GeneratedProtocolMessageType:\n\n return RunFunctionOrConstructorAction_PB", "def build(\n cls,\n file_descriptor: de...
[ "0.5963592", "0.58178014", "0.5767514", "0.5743596", "0.5712156", "0.5561316", "0.5528851", "0.5511984", "0.5439808", "0.53994524", "0.53555566", "0.5355289", "0.53187203", "0.53042555", "0.53023523", "0.5295403", "0.5258989", "0.5220882", "0.5217801", "0.51910365", "0.518645...
0.73003674
1
Computes the proto to save in tf.train.Example as a training example for the policy network
def get_policy_data(saved_game_proto, power_names, top_victors): # pylint: disable=too-many-branches nb_phases = len(saved_game_proto.phases) policy_data = {phase_ix: {} for phase_ix in range(nb_phases - 1)} game_id = saved_game_proto.id map_object = Map(saved_game_proto.map) # Determining if w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_example_proto(inputs, labels):\n ex = tf.train.SequenceExample()\n fl_inputs = ex.feature_lists.feature_list['inputs']\n fl_labels = ex.feature_lists.feature_list['labels']\n for input_at_t, label_at_t in zip(inputs, labels):\n fl = fl_inputs.feature.add()\n for item in input_at_t:\...
[ "0.673017", "0.64646125", "0.62335825", "0.62194765", "0.6060745", "0.6027823", "0.5991587", "0.59691745", "0.59627414", "0.59463817", "0.59345144", "0.5914037", "0.587948", "0.58779514", "0.58768857", "0.5864163", "0.58615184", "0.58483344", "0.58432835", "0.58244205", "0.58...
0.0
-1
Computes the proto to save in tf.train.Example as a training example for the value network
def get_value_data(saved_game_proto, power_names): nb_phases = len(saved_game_proto.phases) value_data = {phase_ix: {} for phase_ix in range(nb_phases - 1)} # Computing the value of each phase for power_name in power_names: value_targets = [] current_value = 0. rewards = Default...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_example_proto(inputs, labels):\n ex = tf.train.SequenceExample()\n fl_inputs = ex.feature_lists.feature_list['inputs']\n fl_labels = ex.feature_lists.feature_list['labels']\n for input_at_t, label_at_t in zip(inputs, labels):\n fl = fl_inputs.feature.add()\n for item in input_at_t:\...
[ "0.7133513", "0.67269975", "0.6630196", "0.64453447", "0.6414052", "0.6356983", "0.63459504", "0.6240366", "0.62361723", "0.6199552", "0.6159348", "0.6108727", "0.6074775", "0.6066444", "0.6052898", "0.6034485", "0.60231733", "0.6021645", "0.60039365", "0.5999958", "0.5995409...
0.0
-1
Tets correctness of final CFs and their predictions for sample query instance.
def test_final_cfs_and_preds(self, sample_adultincome_query): counterfactual_explanations = self.exp.generate_counterfactuals( sample_adultincome_query, total_CFs=4, desired_class="opposite") assert isinstance(counterfactual_explanations, CounterfactualExplanations) # test_cfs = [[72...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test(self, samples):\n prediction_errors = np.zeros(len(samples), int)\n predictions = np.zeros(len(samples), int)\n class_predictions = np.zeros(self.class_count)\n \n for i in range(len(samples)): # Loop over each sample\n for j in range(self.class_count): #...
[ "0.6186899", "0.6181334", "0.6173338", "0.6169429", "0.61346185", "0.608773", "0.60555875", "0.60455006", "0.6040177", "0.6013586", "0.6008393", "0.599961", "0.59564793", "0.59537786", "0.59256095", "0.5915373", "0.5911987", "0.59108406", "0.58981806", "0.5867814", "0.5860259...
0.6870501
0
Obiekty konieczne w testach.
def setUp(self): self.player = ship.Player( constants.PLAYER_START_PLACE, constants.PLAYER_WIDTH, constants.PLAYER_HEIGHT, constants.PLAYER_IMG, constants.PLAYER_HEALTH ) self.alien = ship.Alien( [320, 300], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test(self):\n pass", "def _test(self):\n pass", "def _test(self):\n pass", "def _test(self):\n pass", "def _test(self):", "def _test(self):", "def _test(self):", "def _test(self):", "def _test(self):", "def tests():", "def test(self):", "def test(self):", "de...
[ "0.74935395", "0.73638266", "0.73638266", "0.73638266", "0.7355627", "0.7355627", "0.7355627", "0.7355627", "0.7355627", "0.72160083", "0.6927827", "0.6927827", "0.6896951", "0.6895413", "0.68013215", "0.67645365", "0.67645365", "0.6758653", "0.6754724", "0.67064106", "0.6678...
0.0
-1
Test konstruktora dla klasy Player
def test_create_player(self): self.assertIsInstance(self.player, ship.Ship) self.assertEqual(self.player.position, constants.PLAYER_START_PLACE) self.assertEqual(self.player.width, constants.PLAYER_WIDTH) self.assertEqual(self.player.height, constants.PLAYER_HEIGHT) self.assertEq...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_player(self):\n pass", "def setUp(self):\n self.player = Player()", "def testPlayback(self):\n \n pass", "def newPlayer():\r\n pass", "def __init__(self, player):\n self.player = player", "def test_plays_get(self):\n pass", "def __init__(self, playe...
[ "0.81585574", "0.71701884", "0.69439834", "0.6829449", "0.6754284", "0.67524576", "0.66408074", "0.6630471", "0.6350349", "0.6334021", "0.63182175", "0.63023907", "0.6297138", "0.62593174", "0.6196493", "0.61777234", "0.6168363", "0.6129636", "0.6079198", "0.60533464", "0.603...
0.71220475
2
Test konstruktora dla klasy Alien
def test_create_alien(self): self.assertIsInstance(self.alien, ship.Ship) self.assertEqual(self.alien.position, [320, 300]) self.assertEqual(self.alien.width, 30) self.assertEqual(self.alien.height, 30) self.assertEqual(self.alien.img, constants.GREEN_ALIEN_IMG) self.asse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_alias():\n assert getattr(config, \"_is_affirmative\", None) is not None", "def test_aliases_helper(self):\n self.t.config(\"alias.foo\", \"bar\")\n code, out, err = self.t(\"_aliases\")\n self.assertIn(\"foo\", out)", "def test_alien_data(self):", "def test_attribute(self):\...
[ "0.67153656", "0.6290926", "0.5913649", "0.5819045", "0.5743278", "0.5691879", "0.56764793", "0.5610904", "0.55968285", "0.55655295", "0.55613166", "0.5496556", "0.54745877", "0.5441282", "0.5439013", "0.5430384", "0.5429189", "0.541485", "0.53695387", "0.53588676", "0.534521...
0.56516564
7
Use only this method to put 2Ddata for futher processing. Data must lie on same regular grid as first data, you input. If not, this method will not add such input into buffer for futher processing
def addData(self,data,x,y): self.nSamples+=1 if self.nSamples == 1: self.indata.append(data) (self.ny,self.nx)=data.shape self.ny=int(data.shape[0]) self.x=x self.y=y self.lx=self.x[-1:][0] self.ly=self.y[-1:][0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_data(self, data):\n num_data = None\n for key, val in data.items():\n if key not in self.data_dict:\n raise Exception(\"ReplayBuffer doesn't have key: {}\".format(key))\n \n # check if we are extending by a batch of data or just a single\n ...
[ "0.61086416", "0.6013508", "0.5913101", "0.5913101", "0.58733207", "0.5788255", "0.5775775", "0.5702685", "0.56928337", "0.5672849", "0.5625979", "0.5608723", "0.55310374", "0.5519467", "0.54648846", "0.54543895", "0.5422733", "0.5409476", "0.5398807", "0.5384769", "0.5382300...
0.5826266
5
lade bild aus drive/colab/images google drive muss gemountet sein
def img(filename='steine.jpg'): return mpimg.imread('/content/drive/My Drive/colab/images/'+filename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n service = discovery.build('drive', 'v3', http=get_http())\n\n pic_q = retrieve_pics(service)\n classify_pics(pic_q)", "def create_googledrive_mounting_point():\n return None", "def main():\n store = file.Storage('token.json')\n creds = store.get()\n if not creds or creds.inva...
[ "0.64215195", "0.63597715", "0.6141795", "0.5756038", "0.5589871", "0.55351025", "0.5498817", "0.5463523", "0.5463523", "0.5438191", "0.53710955", "0.5344821", "0.5278038", "0.52570707", "0.5235477", "0.5227738", "0.5224187", "0.52097744", "0.5196029", "0.5175108", "0.5169196...
0.51187766
25
gibt die gilbert katze als tensor
def gilbert(): url = "https://raw.githubusercontent.com/bomelino/stupid/master/images/gilbert.jpg" img = tf.image.decode_image(requests.get(url).content, channels=3) #, name="jpeg_reader") img = tf.image.convert_image_dtype(img, tf.float32) return img
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def g_tf(self, t, x):\n raise NotImplementedError", "def g_tensor(self,gpara,gperp):\n gx = gperp\n gy = gperp\n gz = gpara\n\n self.gx = gx\n self.gy = gy\n self.gz = gz\n self.g_grid = np.array([[gx*gx, gx*gy, gx*gz],[gy*gx, gy*gy, gy*gz],[gz*gx, gz*gy, g...
[ "0.6160474", "0.61214453", "0.60852426", "0.60697913", "0.58623594", "0.57925594", "0.5721722", "0.56715065", "0.56402117", "0.5609069", "0.56024104", "0.5597249", "0.5506809", "0.5484138", "0.5435349", "0.54123217", "0.53882307", "0.5376301", "0.5359924", "0.5336074", "0.532...
0.5774718
6
gibt bild aus dem github folder /images
def img(name): url = "https://raw.githubusercontent.com/bomelino/stupid/master/images/"+name img = tf.image.decode_image(requests.get(url).content, channels=3) #, name="jpeg_reader") img = tf.image.convert_image_dtype(img, tf.float32) return img
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def images(name):\n return static_file(name, root=os.path.join(BASEDIR, \"images\"))", "def images_path(self):\n return os.path.join(self.extracted_path, \"images\")", "def get_image_url():", "def get(self, img):\n\n return send_from_directory(\"images\", img)", "def propose_image_path():\...
[ "0.6655917", "0.66277754", "0.63825804", "0.63431305", "0.62674326", "0.62325233", "0.6221708", "0.6206962", "0.61147857", "0.6007734", "0.59814024", "0.5973737", "0.5970303", "0.5969824", "0.59474313", "0.5934089", "0.5889659", "0.5883094", "0.5875259", "0.58485574", "0.5830...
0.5906596
16
normalisiere einen numpy zu werten zwischen 0 und 1
def norm(t): return (t - t.min()) / (t.max()-t.min())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalise(self):\n return self / self.mean(axis=1).reshape(self.shape[0], 1)", "def normalize(arr):\n m = np.min(arr)\n arr = arr - m\n M = np.max(arr)\n arr = arr / M\n return arr", "def normalize(a):\n a = np.array(a)\n return a / np.linalg.norm(a)", "def normalize_data(img)...
[ "0.7180815", "0.70101213", "0.69788635", "0.6951948", "0.69517136", "0.692887", "0.6894116", "0.688051", "0.6876764", "0.6849841", "0.6838557", "0.6824603", "0.6823008", "0.6820429", "0.6816269", "0.681095", "0.6795535", "0.67913735", "0.67913735", "0.67858446", "0.6782843", ...
0.0
-1
Verify execute_review() creates new directory as expected.
def test_execute_review_1(self): review.execute_review(self.alchemist, self.test_dir, self.review_test_dir.name) self.assertTrue(self.review_test_dir.is_dir())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_execute_review_5(self):\n review.execute_review(self.alchemist, self.test_dir,\n self.review_test_dir.name,\n review=False)\n\n self.assertTrue(self.review_test_dir.is_dir())", "def test_execute_review_4(self):\n review.execu...
[ "0.7242757", "0.72419107", "0.7037094", "0.689238", "0.6671771", "0.66480756", "0.65441185", "0.65027815", "0.6452117", "0.62934065", "0.61304945", "0.61244786", "0.59787667", "0.5978526", "0.59366506", "0.5932075", "0.58986014", "0.58634335", "0.5838747", "0.58047247", "0.57...
0.77492034
0
Verify execute_review() filter parameter functions as expected.
def test_execute_review_2(self): review.execute_review(self.alchemist, self.test_dir, self.review_test_dir.name, filters=("phage.Cluster='A' " "AND phage.Subcluster='A2'")) self.assertTrue(self.review_tes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_review_is_done(self):\n self.assertFalse(processes.review_is_done(None))\n self.assertFalse(processes.review_is_done(0))\n self.assertFalse(processes.review_is_done(models.REVIEW_PENDING))\n self.assertFalse(processes.review_is_done(models.REVIEW_ISSUES_OPEN))\n self.assertTrue(processes.re...
[ "0.65259486", "0.59124905", "0.58372104", "0.5830598", "0.5795418", "0.5792086", "0.5683211", "0.5679936", "0.5669928", "0.56600183", "0.5649022", "0.56429166", "0.5632692", "0.55752647", "0.5556316", "0.5544017", "0.5537912", "0.5533562", "0.5515699", "0.55118555", "0.550689...
0.5847134
2
Verify execute_review() group parameter functions as expected.
def test_execute_review_3(self): review.execute_review(self.alchemist, self.test_dir, self.review_test_dir.name, groups=["phage.Cluster"]) self.assertTrue(self.review_test_dir.is_dir()) clusterA_dir = self.review_test_dir.joinpath("A"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_review_is_done(self):\n self.assertFalse(processes.review_is_done(None))\n self.assertFalse(processes.review_is_done(0))\n self.assertFalse(processes.review_is_done(models.REVIEW_PENDING))\n self.assertFalse(processes.review_is_done(models.REVIEW_ISSUES_OPEN))\n self.assertTrue(processes.re...
[ "0.63605946", "0.6131928", "0.58828753", "0.5861935", "0.571785", "0.566135", "0.564696", "0.55858946", "0.554718", "0.5519694", "0.5505816", "0.54933506", "0.54910284", "0.54356647", "0.5433337", "0.54210955", "0.5416727", "0.53807616", "0.5379903", "0.53569907", "0.53516185...
0.5157544
50
Verify execute_review() sort parameter functions as expected.
def test_execute_review_4(self): review.execute_review(self.alchemist, self.test_dir, self.review_test_dir.name, sort=["gene.Name"]) self.assertTrue(self.review_test_dir.is_dir())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_sort(self):\n # Create a new REANATemplate with an empty workflow specification and\n # a list of five parameters\n template = REANATemplate(\n workflow_spec={},\n parameters=[\n pd.parameter_declaration('A', index=1),\n pd.parameter...
[ "0.698911", "0.67073345", "0.6649952", "0.628366", "0.62690806", "0.6237149", "0.62085545", "0.61629647", "0.612906", "0.60951424", "0.6078226", "0.60769314", "0.5970722", "0.5923458", "0.5912304", "0.5904948", "0.59043705", "0.5892273", "0.5887793", "0.5877205", "0.5875979",...
0.62249607
6
Verify execute_review() review parameter functions as expected.
def test_execute_review_5(self): review.execute_review(self.alchemist, self.test_dir, self.review_test_dir.name, review=False) self.assertTrue(self.review_test_dir.is_dir())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_review_is_done(self):\n self.assertFalse(processes.review_is_done(None))\n self.assertFalse(processes.review_is_done(0))\n self.assertFalse(processes.review_is_done(models.REVIEW_PENDING))\n self.assertFalse(processes.review_is_done(models.REVIEW_ISSUES_OPEN))\n self.assertTrue(processes.re...
[ "0.67219", "0.64621395", "0.64286137", "0.6336808", "0.6000372", "0.5979753", "0.5949297", "0.59375334", "0.5928642", "0.5867238", "0.5864604", "0.58318514", "0.58007705", "0.5799601", "0.57209396", "0.5695721", "0.56633323", "0.56316847", "0.5622716", "0.5608472", "0.5569979...
0.64333284
2
Verify execute_review() g_reports parameter functions as expected.
def test_execute_review_6(self): review.execute_review(self.alchemist, self.test_dir, self.review_test_dir.name, g_reports=True) self.assertTrue(self.review_test_dir.is_dir()) gene_report_dir = self.review_test_dir.joinpath("GeneRepor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_review_is_done(self):\n self.assertFalse(processes.review_is_done(None))\n self.assertFalse(processes.review_is_done(0))\n self.assertFalse(processes.review_is_done(models.REVIEW_PENDING))\n self.assertFalse(processes.review_is_done(models.REVIEW_ISSUES_OPEN))\n self.assertTrue(processes.re...
[ "0.62868595", "0.6212757", "0.6113263", "0.584701", "0.57769084", "0.5751094", "0.5700198", "0.5627688", "0.5568834", "0.5565489", "0.55631316", "0.55567676", "0.548278", "0.5437698", "0.5434019", "0.5399112", "0.53961974", "0.53805166", "0.53678334", "0.5360183", "0.53236", ...
0.68138856
0
Verify execute_review() s_report parameter functions as expected.
def test_execute_review_7(self): review.execute_review(self.alchemist, self.test_dir, self.review_test_dir.name, s_report=True) self.assertTrue(self.review_test_dir.is_dir()) summary_report_file = self.review_test_dir.joinpath("Summar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_review_is_done(self):\n self.assertFalse(processes.review_is_done(None))\n self.assertFalse(processes.review_is_done(0))\n self.assertFalse(processes.review_is_done(models.REVIEW_PENDING))\n self.assertFalse(processes.review_is_done(models.REVIEW_ISSUES_OPEN))\n self.assertTrue(processes.re...
[ "0.625906", "0.6215037", "0.6079821", "0.605461", "0.5940084", "0.5858847", "0.58261263", "0.5787651", "0.5567173", "0.5542198", "0.5537528", "0.5508412", "0.5503725", "0.54966176", "0.5496157", "0.54441243", "0.5423454", "0.53979665", "0.53977054", "0.5381116", "0.5344718", ...
0.64828974
0
Verify review_phams() correctly identifies disrepencies.
def test_review_phams_1(self): self.db_filter.values = self.db_filter.build_values( where=self.db_filter.build_where_clauses()) review.review_phams(self.db_filter) self.assertFalse(39854 in self.db_filter.values) self.assertTrue(40481 in self.db_filter.values)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unsuccessful_verification(self):\n for i in (-4, -3, 3, 4):\n description = \"TOTP verified for `i={0}`\".format(i)\n calculated = self.algorithm.calculate(self.device.secret, drift=i)\n confirmed = self.relate.verify(calculated, save=False)\n\n self.asse...
[ "0.57791716", "0.5642184", "0.54765165", "0.54339254", "0.54250133", "0.54250133", "0.54250133", "0.54203993", "0.5368484", "0.53536505", "0.5352088", "0.5343342", "0.5304699", "0.52976656", "0.525753", "0.52460766", "0.5218623", "0.5122834", "0.5115473", "0.5113044", "0.5103...
0.65374625
0
Verify get_pf_data() retrieves and returns data as expected.
def test_get_pf_data_1(self): self.db_filter.values = [40481] pf_data = review.get_pf_data(self.alchemist, self.db_filter) self.assertTrue(isinstance(pf_data, list)) for header in review.PF_HEADER: with self.subTest(header=header): self.assertTrue(header in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_data(self):\r\n success, _data = self.peer_grading.query_data_for_location(self.problem_location)\r\n self.assertTrue(success)", "def test_getknowndata(self):\n result = recordparser.getfields(self.rawdata, self.fieldmap,\n self.sourcekeys)\n self.assertEqu...
[ "0.6491381", "0.6261381", "0.6225589", "0.6133288", "0.60651624", "0.59994286", "0.5965018", "0.59296054", "0.5926258", "0.5926258", "0.5926258", "0.5915046", "0.58646065", "0.58031034", "0.5797196", "0.5794694", "0.57883406", "0.57495934", "0.57458067", "0.5729523", "0.56688...
0.72779644
0
Verify get_g_data() retreives and retrusn data as expected.
def test_get_g_data_1(self): self.db_filter.values = [40481] g_data = review.get_g_data(self.alchemist, self.db_filter, 40481) self.assertTrue(isinstance(g_data, list)) for header in review.PG_HEADER: with self.subTest(header=header): self.assertTrue(header...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_data(self):\r\n success, _data = self.peer_grading.query_data_for_location(self.problem_location)\r\n self.assertTrue(success)", "def test_gc_datastore(self):\n yg_gc = parsegc.generate_yg_gc_entry(\n \"100.25\",\n \"100.25\",\n \"ParNew\",\n ...
[ "0.6880222", "0.66431636", "0.6471408", "0.62280977", "0.6214435", "0.62143874", "0.61981314", "0.61831266", "0.6173409", "0.61414707", "0.6108344", "0.6095074", "0.6095074", "0.6095074", "0.6050329", "0.6019996", "0.5988685", "0.5986319", "0.5964577", "0.5957988", "0.5893297...
0.7342229
0
Generate a CSV file of the Dataset information
def generate_dataset_csv(request): response = csv_export(request,Dataset) return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _write_csv(self):\n\n # add the label to the header\n if self.input_data.get_value(InputType.TIME_PERIOD) == 'all':\n self.header.append('Date')\n else:\n self.header.append('sample id')\n\n key_list = []\n\n for i, cube in enumerate(self.cube_list):\n ...
[ "0.7301781", "0.7188036", "0.70366293", "0.70341796", "0.6933217", "0.68942285", "0.6882128", "0.6836537", "0.6826749", "0.6826596", "0.68030626", "0.68030626", "0.6784672", "0.6763934", "0.6762665", "0.6719179", "0.65670377", "0.65446883", "0.65274465", "0.65093666", "0.6493...
0.7548971
0
Generate the jtable data for rendering in the list template.
def generate_dataset_jtable(request, option): obj_type = Dataset type_ = "dataset" mapper = obj_type._meta['jtable_opts'] if option == "jtlist": # Sets display url details_url = mapper['details_url'] details_url_key = mapper['details_url_key'] fields = mapper['fields'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gen_datatable__(self):\n # | - __generate_data_table\n rows_list = []\n for Job_i in self.Job_list:\n # | - FOR LOOP BODY\n entry_param_dict = {}\n for prop, value in Job_i.job_params.items():\n entry_param_dict[prop] = value\n\n ...
[ "0.6957045", "0.65309566", "0.6484074", "0.6239349", "0.61573464", "0.6097337", "0.5979821", "0.5976074", "0.59642226", "0.5879871", "0.5868879", "0.5808444", "0.5792779", "0.57764864", "0.57394606", "0.57326126", "0.5722943", "0.5710817", "0.56943315", "0.5688803", "0.567253...
0.6782189
1
Generate the data to render the Dataset details template.
def get_dataset_details(name, analyst): template = None allowed_sources = user_sources(analyst) dataset_object = Dataset.objects(name = name, source__name__in=allowed_sources).first() if not dataset_object: error = ("Either no data exists for this dataset" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data():\n return render_template(\n 'data.html',\n title='World Happiness Report',\n year=datetime.now().year,\n message='Main Data Model'\n )", "def data():\n return render_template(\n 'data.html',\n title='Data',\n year=datetime.now().year,\n ...
[ "0.6786504", "0.677638", "0.6696329", "0.6644693", "0.6549089", "0.6539549", "0.6480339", "0.6422021", "0.6389156", "0.6363354", "0.6326907", "0.63251007", "0.6324231", "0.6286099", "0.6258859", "0.62314236", "0.6211274", "0.62073964", "0.6190721", "0.61876315", "0.6074533", ...
0.68706584
0
Draws a ball on the screen
def draw_balls(): for ball in balls: circle(screen, ball[0], (ball[1], ball[2]), ball[3]) # Unpacking the list for super_ball in super_balls: # Indexes here are standing for attributes of a particular ball circle(screen, super_ball[0][0], (super_ball[1], super_ball[2]), super_ball[3]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_ball(self):\n circle(screen, self.color, (self.x, self.y), self.r)", "def draw_ball():\n\n draw_circle(ball, 'yellow')", "def draw(self, ball):\n self.screen.fill(pygame.Color(0,0,0))\n self.screen.blit(ball.surf, (size[0]/2, size[1]/2)) #this puts it in roughly center of scree...
[ "0.88677967", "0.85694885", "0.8367467", "0.8162346", "0.8078913", "0.7918491", "0.77419096", "0.7705636", "0.76958567", "0.7675694", "0.7617931", "0.76130277", "0.74899477", "0.7485385", "0.7371144", "0.73147726", "0.7310771", "0.72975713", "0.7283584", "0.7259651", "0.72097...
0.6816264
39
Creates objects of the game, gives attributes to them
def init(): global balls, super_balls balls = [gen_ball() for _ in range(number_of_balls)] super_balls = [] generate_velocity_all_balls()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(game):\r\n ## Create Garbage\r\n game.garbage = deque([])\r\n\r\n ## Create Stars\r\n game.create_stars()\r\n\r\n ## Create Millenium Falcon\r\n game.falcons = MilleniumFalcon.init(game)\r\n game.millenium_falcon = MilleniumFalcon()\r\n \r\n ## ...
[ "0.709624", "0.69561434", "0.68624014", "0.6801915", "0.67633975", "0.6699283", "0.6635729", "0.6602579", "0.65952", "0.65015805", "0.6486142", "0.6449089", "0.6402711", "0.6385835", "0.63782", "0.6367633", "0.6333057", "0.63101995", "0.63063586", "0.62810177", "0.62730706", ...
0.0
-1
Generates parameters of a ball
def gen_ball(): ball_radius = randint(30, 80) ball_x = randint(ball_radius, screen_width - ball_radius) ball_y = randint(ball_radius, screen_height - ball_radius) ball_color = COLORS[randint(0, len(COLORS) - 1)] return [ball_color, ball_x, ball_y, ball_radius]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_ball():\n balls.append(gen_ball())\n generate_velocity(balls)", "def __init__(self, posn_x, posn_y, velocity_x, velocity_y, kula): \n self.posn_x = posn_x # x position of box containing the ball (bottom). \n self.posn_y = posn_y # x position of box contain...
[ "0.6895878", "0.685673", "0.6721842", "0.62929344", "0.61529136", "0.6131318", "0.59977186", "0.5974338", "0.59684306", "0.5949559", "0.5917947", "0.58600557", "0.58583516", "0.58519125", "0.5832661", "0.58294326", "0.5826852", "0.5825801", "0.58063483", "0.5790451", "0.57899...
0.65422064
3
Generates parameters of a super ball
def gen_super_ball(): super_ball_radius = 80 super_ball_x = randint(super_ball_radius, screen_width - super_ball_radius) super_ball_y = randint(super_ball_radius, screen_height - super_ball_radius) super_ball_color = (RED, YELLOW, GREEN) return [super_ball_color, super_ball_x, super_ball_y, super_ba...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_super_ball():\n super_balls.append(gen_super_ball())\n generate_velocity(super_balls)", "def __init__(self, posn_x, posn_y, velocity_x, velocity_y, kula): \n self.posn_x = posn_x # x position of box containing the ball (bottom). \n self.posn_y = posn_y # x...
[ "0.69011176", "0.6279852", "0.6235428", "0.6158913", "0.613197", "0.6061376", "0.6033093", "0.60131353", "0.5985253", "0.5949455", "0.5946373", "0.59461635", "0.5881633", "0.5881352", "0.5837037", "0.5832942", "0.5820211", "0.5816382", "0.58020455", "0.5778845", "0.57671064",...
0.6386006
1
sets velocity for each ball
def generate_velocity_all_balls(): for ball in balls: generate_velocity(balls, balls.index(ball)) for super_ball in super_balls: generate_velocity(super_balls, super_balls.index(super_ball))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ball_increase_velocity():\n global ball_vel\n ball_vel[0] = ball_vel[0] * 1.10\n ball_vel[1] = ball_vel[1] * 1.10", "def __init__(self, posn_x, posn_y, velocity_x, velocity_y, kula): \n self.posn_x = posn_x # x position of box containing the ball (bottom). \n self.posn_y =...
[ "0.7683335", "0.7416021", "0.7308517", "0.71602535", "0.6988849", "0.69132686", "0.6795452", "0.673417", "0.6721597", "0.67141384", "0.6704233", "0.66994643", "0.66994643", "0.6658117", "0.66505706", "0.66114134", "0.66092026", "0.6599519", "0.65688676", "0.6561834", "0.65275...
0.71853787
3
generates parameters for velocity of a ball
def generate_velocity(object_type, index=-1): horizontal_velocity, vertical_velocity = randint(-100, 100) / 100, randint(-100, 100) / 100 object_type[index].append(horizontal_velocity) object_type[index].append(vertical_velocity)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, posn_x, posn_y, velocity_x, velocity_y, kula): \n self.posn_x = posn_x # x position of box containing the ball (bottom). \n self.posn_y = posn_y # x position of box containing the ball (left edge). \n self.velocity_x = velocity_x # amount of x-mo...
[ "0.69857717", "0.6803222", "0.67491883", "0.67428035", "0.67012453", "0.66916686", "0.66150224", "0.6603119", "0.6602012", "0.658512", "0.6568148", "0.65674865", "0.6544383", "0.65308136", "0.64897746", "0.64829975", "0.64573956", "0.6451636", "0.6379975", "0.63650876", "0.63...
0.0
-1
Moves objects one moment forward
def tick(): move_balls(targets_speed) move_super_balls(targets_speed * 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(self):\n pass", "def move_forward():\n pass", "def forward(self):\n self.position += 1", "def move(self, direction, cycles):\n\t\tpass", "def move(self):\n \n self.position = self.explore()", "def move_step(self, direction):\n x = self.objects[0].x\n ...
[ "0.7545862", "0.73531234", "0.7204142", "0.6988268", "0.6933335", "0.6926344", "0.6876406", "0.68594664", "0.68399554", "0.6779729", "0.67741776", "0.67479706", "0.6717077", "0.66955376", "0.6654428", "0.661319", "0.6591413", "0.6563061", "0.6546285", "0.6545375", "0.6537781"...
0.0
-1
Moves every ball according their position and velocity
def move_balls(times_moved): for time in range(times_moved): for ball in balls: touched_border_1 = ball[1] <= ball[3] + 1 or ball[1] >= screen_width - (ball[3] + 1) touched_border_2 = ball[2] <= ball[3] + 1 or ball[2] >= screen_height - (ball[3] + 1) # checking the positi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tick():\n move_balls(targets_speed)\n move_super_balls(targets_speed * 2)", "def move(self):\n new_velocities = self._create_velocities()\n for boid, vel in zip(self.boids, new_velocities):\n boid.change_speed(*vel)\n for obstacle in self.obstacles:\n ...
[ "0.7707619", "0.76045424", "0.75311244", "0.74456006", "0.74178046", "0.7367661", "0.73274946", "0.7279402", "0.7104018", "0.70265543", "0.69604886", "0.69478655", "0.69259155", "0.6891615", "0.6872966", "0.6867801", "0.6753945", "0.6708518", "0.66990066", "0.6697089", "0.666...
0.7733392
0
Moves a super ball according its position and velocity
def move_super_balls(times_moved): for super_ball in super_balls: if super_ball[3] != 0: super_ball[3] -= 0.25 else: super_balls.remove(super_ball) create_ball() for time in range(times_moved): for ball in super_balls: # checking the positi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(self) -> None:\n self.delta_time += 1 / 30 # FPS is 30 frames per second\n\n if self.is_active:\n self.y -= self.velocity * self.delta_time + 0.5 * self.gravity * (self.delta_time ** 2) # s = ut + 0.5at^2\n self.velocity = self.velocity + self.gravity * self.delta_tim...
[ "0.7592387", "0.73820126", "0.7332446", "0.72793245", "0.72696424", "0.70698607", "0.70569444", "0.70373905", "0.70267665", "0.7024209", "0.6992322", "0.6945556", "0.6943953", "0.6937738", "0.692931", "0.6924519", "0.6884891", "0.68680847", "0.6855089", "0.6794775", "0.679248...
0.73970246
1
Creates a new ball
def create_ball(): balls.append(gen_ball()) generate_velocity(balls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_ball():\n ball = Ball()\n # Starting position of the ball.\n # Take into account the ball size so we don't spawn on the edge.\n ball.x = random.randrange(BALL_SIZE, SCREEN_WIDTH - BALL_SIZE)\n ball.y = random.randrange(BALL_SIZE, SCREEN_HEIGHT - BALL_SIZE)\n\n # Speed and direction of re...
[ "0.78910744", "0.7773026", "0.75718427", "0.729235", "0.71304464", "0.7016827", "0.68962", "0.68675226", "0.68090975", "0.67911744", "0.6787879", "0.67824346", "0.6752662", "0.6746393", "0.6635242", "0.6631885", "0.65989226", "0.64579904", "0.64246917", "0.6302894", "0.630126...
0.7948333
0
Creates a new super ball
def create_super_ball(): super_balls.append(gen_super_ball()) generate_velocity(super_balls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, x = 140, y = 140):\r\n super(Ball, self).__init__(image = Ball.image,\r\n x = 600, y = 240,\r\n dx = -3, dy = 1)", "def create_ball():\n balls.append(gen_ball())\n generate_velocity(balls)", "def __init__(self, ...
[ "0.730643", "0.72916216", "0.715264", "0.6966334", "0.6859085", "0.6695298", "0.6680856", "0.6522806", "0.6485458", "0.64399636", "0.6430099", "0.633791", "0.63072115", "0.626187", "0.62459886", "0.6230659", "0.6223655", "0.6124047", "0.61092705", "0.60890025", "0.60649514", ...
0.8251493
0
Checks whether mouse clicked on an object or not. If yes, erases the object and adds some scores. Otherwise, takes away 10 points from player's scores.
def handler(position): inner_counter = 0 mouse_x = position[0] mouse_y = position[1] for ball in balls: if (mouse_x - ball[1]) ** 2 + (mouse_y - ball[2]) ** 2 <= ball[3] ** 2: # Pifagor theorem inner_counter += (80 - ball[3]) + 1 balls.remove(ball) define_bal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def click(event):\r\n global score, targets_left, have_friend_param\r\n flag = 0\r\n mult = event.button\r\n for i in range(num_of_balls + 1):\r\n if balls_pool[i][6] > 0 and (event.pos[0] - balls_pool[i][0]) ** 2 + (event.pos[1] - balls_pool[i][1]) ** 2 <= \\\r\n balls_pool[i][2]...
[ "0.69207203", "0.69092077", "0.6745111", "0.63253415", "0.6246623", "0.61983776", "0.6125679", "0.6078021", "0.60481995", "0.5849827", "0.5849543", "0.583322", "0.582653", "0.57814676", "0.5748103", "0.56914175", "0.5687703", "0.5662814", "0.5647297", "0.56373435", "0.5627928...
0.0
-1
Defines which type of ball is to be generated
def define_ball(possibility): lottery = randint(1, int(100 / possibility)) if lottery % int(100 / possibility) == 0: create_super_ball() else: create_ball()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_ball():\n balls.append(gen_ball())\n generate_velocity(balls)", "def set_type(self,number):\n if number == 0:\n self.Goblin()\n \n if number == 1:\n self.Ork()\n\n if number == 2:\n self.Skeleton()\n\n if number == 3:\n ...
[ "0.6513428", "0.63994837", "0.6321578", "0.609849", "0.6071303", "0.59578586", "0.59479", "0.58994204", "0.5885848", "0.5801644", "0.5781181", "0.5769061", "0.5756699", "0.570109", "0.56561863", "0.5653744", "0.56488204", "0.5636758", "0.5563264", "0.55605704", "0.55554557", ...
0.6129204
3
Tags this object with a tag specified by a tag name, primary key or Tag model instance
def tag(self, tag): if isinstance(tag, six.integer_types): try: tag = Tag.objects.get(pk=tag, owner=self.owner) except Tag.DoesNotExist: #Handle this better? return if isinstance(tag, six.string_types): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_tag(self, obj, tag_name):\r\n tag_names = parse_tag_input(tag_name)\r\n if not len(tag_names):\r\n raise AttributeError(_('No tags were given: \"%s\".') % tag_name)\r\n if len(tag_names) > 1:\r\n raise AttributeError(_('Multiple tags were given: \"%s\".') % tag_na...
[ "0.69300115", "0.6737296", "0.6443798", "0.64252824", "0.64252824", "0.64252824", "0.64252824", "0.6414007", "0.63670653", "0.63209105", "0.63030666", "0.6279283", "0.6275524", "0.621508", "0.6196465", "0.6148248", "0.6104529", "0.60913354", "0.6081214", "0.60594183", "0.6058...
0.7870358
0
Untags this object from a tag specified by a tag name, primary key or Tag model instance
def untag(self, tag): if isinstance(tag, six.integer_types): try: tag = Tag.objects.get(pk=tag, owner=self.owner) except Tag.DoesNotExist: return if isinstance(tag, six.string_types): try: tag = Tag.objects.get(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def untag(self, uuid, tags=None):\n if isinstance(tags, basestring):\n tags = [tags]\n\n self._backend.untag(uuid, tags)", "def remove_tag(self, tag):\n cp = self.copy()\n cp.tags.remove(tag)\n return cp", "def delete_tag(self,tag):\r\n\r\n # with shelf\r\n ...
[ "0.6581936", "0.6569352", "0.65154964", "0.6419307", "0.6366215", "0.613729", "0.6099109", "0.60640305", "0.60616106", "0.6047276", "0.6009565", "0.5999241", "0.59780717", "0.5956036", "0.59260625", "0.588727", "0.5883824", "0.58749294", "0.5853107", "0.5759094", "0.5744433",...
0.7446062
0
Returns all the elements tagged with the given tag or any other tags it implies
def get_by_tag(cls, tag): out = [] tags = Tag.expand_implied_by([tag]) for t in tags: results = cls.objects.filter(owner=tag.owner, tags=t) for b in results: if b not in out: out.append(b) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_tagged(self,tag_name):\n return self.tag2elements[tag_name]", "def get_tags(self,element):\n if element in self.element2tags.keys():\n return self.element2tags[element]\n return []", "def check_and_get_all_elements_by_tag_name(element, tag_name):\r\n if element is None or not tag_n...
[ "0.7682765", "0.6988964", "0.6707831", "0.65731496", "0.6313463", "0.6310617", "0.62054396", "0.61800957", "0.6134957", "0.61071503", "0.60247475", "0.5989653", "0.59873897", "0.5967671", "0.59566736", "0.59315103", "0.5923862", "0.59012187", "0.586929", "0.586929", "0.584404...
0.67569757
2
Returns a dictionary representation of this tag The keys of the object are the field names, and the values are the respective values.
def to_dir(self): out = {} out["name"] = self.name out["colour"] = self.colour out["slug"] = self.slug out["id"] = self.pk out["tags"] = [] for t in self.tags.all(): out["tags"].append(t.pk) return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_dict(self):\n return {'tag_type': self.tag_type, 'value': self.value}", "def serialize(self):\n return {\n 'name': self.name,\n 'id': self.id,\n 'description': self.description,\n }", "def to_dict(self):\n _dict = {}\n for f in self._me...
[ "0.7906893", "0.74075985", "0.7403961", "0.73854554", "0.73658055", "0.7356104", "0.735488", "0.735488", "0.735488", "0.7321188", "0.73047435", "0.7293118", "0.72879535", "0.7276822", "0.7236181", "0.7235604", "0.7234098", "0.72181904", "0.72181904", "0.72181904", "0.72181904...
0.0
-1
Produces the JSON representation of this tag It's the JSON for the output of to_dir()
def to_json(self): return json.dumps(self.to_dir())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_json(self):\n return {'name': self.name, \n 'path': self.path, \n 'enabled': self.enabled}", "def to_dir(self):\n out = {}\n out[\"name\"] = self.name\n out[\"colour\"] = self.colour\n out[\"slug\"] = self.slug\n out[\"id\"] = self.p...
[ "0.7254296", "0.7204862", "0.6899478", "0.6766462", "0.6741779", "0.67358327", "0.671214", "0.671214", "0.671214", "0.671214", "0.671214", "0.671214", "0.671214", "0.671214", "0.671214", "0.6691138", "0.66525084", "0.6629055", "0.6582917", "0.6580073", "0.6575524", "0.65662...
0.81298095
0
Puts everything to do with this tag into a new tag Specifically, everything tagged with this tag gets tagged with the new tag
def pool_into(self, target): for taggable in taggables().values(): for t in taggable.by_user(self.owner).filter(tags=self): t.tag(target)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_tag(tag):\n remove_tag(tag)\n add_tag(tag)", "def tag(self, tag):\n self.tag = tag", "def set_tag(self, tag):\n self.update(tag=tag)", "def tagger():", "def add(self, tag):\n self.tags[tag.name] = tag", "def add_tags(event):\n\n add_tags_from_presets()", "def ad...
[ "0.68450415", "0.66959107", "0.66091335", "0.6608696", "0.65841866", "0.65109783", "0.6490783", "0.643429", "0.643429", "0.643429", "0.643429", "0.64281595", "0.63527644", "0.63505626", "0.63243264", "0.63088197", "0.6302192", "0.6277016", "0.62149954", "0.62000203", "0.61865...
0.5835091
51
Given the undoable JSON representation of the tag, creates one for it Note that this SAVES the object to the database.
def from_undoable(jsonData, user): obj = json.loads(jsonData) tag = Tag(owner=user, name=obj["tag"]["name"], colour=obj["tag"]["colour"], slug=obj["tag"]["slug"], ) tag.save() for t in obj["tag"]["tags"]: tag.tag(t) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self, name, tag):\n\n\t\turl_json = urllib.urlencode({\"name\": name, \"tag\": tag})\n\t\treturn self._create(\"/tag?json_hash=%s\" % url_json, \"tag\")", "def tag(self, tag):\n \n if isinstance(tag, six.integer_types):\n try:\n tag = Tag.objects.get(pk=tag, own...
[ "0.68379575", "0.6223951", "0.6206263", "0.6084949", "0.6079323", "0.6001024", "0.5909171", "0.5885422", "0.58552563", "0.5853059", "0.5835232", "0.582034", "0.580405", "0.5733759", "0.57311594", "0.57013", "0.56803435", "0.5633003", "0.5623184", "0.5532445", "0.5512779", "...
0.76959306
0
Checks if a tag exists for a given user, and returns it if it does If it doesn't, the owner of the instance is set to the provided one, it is saved and then returned.
def get_or_create_with_slug(owner, instance): try: return Tag.objects.get(owner=owner, slug=makeslug(instance.name)) except Tag.DoesNotExist: instance.owner = owner instance.save() return instance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_owner(self):\n username = self.cleaned_data['owner']\n owner = User.objects.filter(username=username).first()\n if owner is None:\n raise forms.ValidationError(\n _('User %(username)s does not exist'),\n params={'username': username},\n ...
[ "0.57880306", "0.56677806", "0.56435883", "0.5559733", "0.55188113", "0.5518041", "0.5497315", "0.54858625", "0.5484042", "0.5459997", "0.5448539", "0.5447152", "0.53896964", "0.53632486", "0.53549755", "0.53303343", "0.53284883", "0.53248155", "0.5321938", "0.5318804", "0.53...
0.62832665
0
Takes an iterable of tags, and returns a list of those tags and all that they imply That is, make a list out of the argument, and for each tag T, add all T's tags to this list if they aren't in it already. The list is sorted alphabetically. For example, if A is tagged B (A implies B), then expand_implies([A]) == [A, B]...
def expand_implies(tags): out = list(tags) i = 0 while i < len(out): for implied in out[i].tags.all(): if implied not in out: out.append(implied) i += 1 out.sort(key=lambda a: a.slug) retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expand_implied_by_check(tags):\n out = list(map(lambda x : (x, True), list(tags)))\n tlist = list(tags)\n \n i = 0\n while i < len(tlist):\n for implies in tlist[i].tags_to.all():\n if implies not in out:\n out.append((implies, Fal...
[ "0.8277511", "0.82477945", "0.8071657", "0.52188385", "0.5081271", "0.5079979", "0.49866027", "0.49452943", "0.47744787", "0.47594008", "0.47567642", "0.47527817", "0.47327515", "0.4704478", "0.46731877", "0.46594027", "0.4648895", "0.46449554", "0.46080807", "0.4599413", "0....
0.82710314
1
Does the same as expand_implies, but each element is a (tag, direct) pair Direct is true only for the tags in the input iterable, not for the implied ones.
def expand_implies_check(tags): out = list(map(lambda x : (x, True), list(tags))) tlist = list(tags) i = 0 while i < len(tlist): for implied in tlist[i].tags.all(): if implied not in tlist: out.append((implied, False)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expand_implied_by_check(tags):\n out = list(map(lambda x : (x, True), list(tags)))\n tlist = list(tags)\n \n i = 0\n while i < len(tlist):\n for implies in tlist[i].tags_to.all():\n if implies not in out:\n out.append((implies, Fal...
[ "0.7650832", "0.7026415", "0.69893414", "0.5127024", "0.50551105", "0.48585972", "0.4781383", "0.4683263", "0.4681429", "0.46648985", "0.45524988", "0.4549901", "0.45247072", "0.44956627", "0.44738948", "0.44586575", "0.44510412", "0.44402215", "0.44390503", "0.4438355", "0.4...
0.7637341
1
Takes an iterable of tags, and returns a list of those tags and all that imply them That is, make a list out of the argument, and for each tag T, add all tags that have T as a tag if it isn't already in the list. The list is sorted alphabetically. For example if A is tagged B (A implies B), expand_implied_by([A]) == [A...
def expand_implied_by(tags): out = list(tags) i = 0 while i < len(out): for implies in out[i].tags_to.all(): if implies not in out: out.append(implies) i += 1 out.sort(key=lambda a: a.slug) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expand_implied_by_check(tags):\n out = list(map(lambda x : (x, True), list(tags)))\n tlist = list(tags)\n \n i = 0\n while i < len(tlist):\n for implies in tlist[i].tags_to.all():\n if implies not in out:\n out.append((implies, Fal...
[ "0.79339683", "0.7664067", "0.7466441", "0.5794743", "0.5567189", "0.54926735", "0.54457945", "0.5440171", "0.5335196", "0.53335434", "0.5256834", "0.5229648", "0.5100543", "0.5064569", "0.50596", "0.5045757", "0.50413346", "0.50368875", "0.5029048", "0.5010543", "0.5006942",...
0.8137174
0
Does the same as expand_implied_by, but each element is a (tag, direct) pair Direct is true only for the tags in the input iterable, not for the implied ones.
def expand_implied_by_check(tags): out = list(map(lambda x : (x, True), list(tags))) tlist = list(tags) i = 0 while i < len(tlist): for implies in tlist[i].tags_to.all(): if implies not in out: out.append((implies, False)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expand_implied_by(tags):\n out = list(tags)\n \n i = 0\n while i < len(out):\n for implies in out[i].tags_to.all():\n if implies not in out:\n out.append(implies)\n \n i += 1\n \n out.sort(key=lambda a:...
[ "0.73786473", "0.6921995", "0.6901337", "0.5127778", "0.4939665", "0.4857299", "0.4841612", "0.48378667", "0.47903764", "0.4744233", "0.47146145", "0.46981707", "0.4651671", "0.46219185", "0.46054628", "0.46042565", "0.4585371", "0.45849028", "0.45668754", "0.45388457", "0.45...
0.7290612
1
Returns all the tags owned by this user
def by_user(user): return Tag.objects.all().filter(owner=user)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_asset_tags(user_id):\n result = db.session.query(Tag).filter(\n NotificationAssetTag.user_id == user_id,\n NotificationAssetTag.tag_id == Tag.id\n ).all()\n return result if result else []", "def tags(request):\n return Tag.objects.filter(user=request.user)", "def get_inte...
[ "0.692619", "0.6867615", "0.68465114", "0.6743126", "0.65778196", "0.65561783", "0.6544148", "0.6514843", "0.6499508", "0.6447732", "0.6423474", "0.638473", "0.638473", "0.638473", "0.638473", "0.638473", "0.638473", "0.638473", "0.638473", "0.6380079", "0.6321024", "0.6310...
0.7943311
0
with a data_containers (list of processed SampleDataContainer objects), this will transform results into a single dataframe with all of the function values, with probe names in rows, and sample beta values for probes in columns.
def consolidate_values_for_sheet(data_containers, postprocess_func_colname='beta_value'): for idx,sample in enumerate(data_containers): sample_id = "{0}_{1}".format(sample.sample.sentrix_id,sample.sample.sentrix_position) this_sample_values = sample._SampleDataContainer__data_frame[postprocess_func_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_frame(data, index, resultsq, functions):\n results_list = []\n failed = False\n for function_id in functions:\n function = function_mapper[function_id]\n result = function(data.slice, functions[function_id])\n results_list.append(result)\n if not result.res:\n ...
[ "0.61030674", "0.5999272", "0.59028965", "0.5843566", "0.5804714", "0.5803746", "0.5624689", "0.5613195", "0.5611028", "0.55851024", "0.54885006", "0.54116213", "0.5403579", "0.5392863", "0.5391308", "0.5386644", "0.53635895", "0.5361517", "0.5337244", "0.5320356", "0.5312189...
0.60265476
1
Returns the value of a property should be used from other modules only!
def get_prop(prop, config_type="", config_path=""): paths = [] if len(config_type): paths = [get_config_path(config_type, config_path)] else: paths = [get_global_config_path()] user_path = get_user_config_path() if os.path.exists(user_path): paths.append(user_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getProperty(propname):", "def get_property(prop, project):\n result = re.search(\n r'{}\\s*=\\s*[\\'\"]([^\\'\"]*)[\\'\"]'.format(prop),\n open(project + \"/__init__.py\").read(),\n )\n return result.group(1)", "def get_property(self, property):\n return self.shell([\"getprop\...
[ "0.6916654", "0.6769773", "0.67538357", "0.6722013", "0.6652091", "0.6489578", "0.64892507", "0.64237255", "0.63986534", "0.63937336", "0.6383006", "0.63692194", "0.6352038", "0.63495433", "0.63404363", "0.6330848", "0.6325854", "0.6325854", "0.6325854", "0.6325854", "0.63258...
0.0
-1
Sets the value of a property should be used from other modules only!
def set_prop(prop, value, config_type="", config_path=""): path = get_config_path(config_type, config_path) set_property_value(prop, value, path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setprop(name, value):\n _slp.setprop(name, value)", "def set_property(self, name, value):\n self.properties[name] = value", "def set_property(key, value):\n return impl.set_property(**locals())", "def set_user_property(self, property, value):\n self._user_properties.update({property: valu...
[ "0.7342421", "0.72254354", "0.71361965", "0.70918727", "0.69609255", "0.69375974", "0.69375974", "0.69375974", "0.69375974", "0.69375974", "0.68955857", "0.686352", "0.6860998", "0.6805863", "0.6797391", "0.67734396", "0.6708743", "0.66969424", "0.6678721", "0.6627641", "0.65...
0.6789031
15
Resolves a path for a config type
def get_config_path(config_type, config_path=""): data = { "own": config_path, "user": get_user_config_path(), "global": get_global_config_path() } try: return data[config_type] except KeyError: raise InvalidConfigTypeException()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _resolve_conf_name(conf_type):\n fnm = config_names[conf_type]\n if os.path.isfile(fnm):\n return fnm\n elif os.path.isfile(config_path + fnm):\n return config_path + fnm\n else:\n raise RuntimeError(\"Missing configuration file for %s\" % conf_type)", "def get_config_type(co...
[ "0.6675451", "0.6384866", "0.5918775", "0.5913211", "0.5868751", "0.58641165", "0.57384616", "0.56661963", "0.5644473", "0.5627098", "0.5624543", "0.5576847", "0.5562291", "0.55478436", "0.5451666", "0.5439571", "0.54111356", "0.54036963", "0.5273365", "0.527113", "0.52587265...
0.7259593
0
Returns the path of the global configuration file
def get_global_config_path(): return "/etc/dapsenv/dapsenv.conf"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config_file_location():\n\n return './' + CONFIG_FILE_NAME", "def get_config_path():\n\n root = os.path.dirname(os.path.abspath(__file__))[:-5]\n config_path = os.path.join(root, 'config.ini')\n\n return config_path", "def configPath(self):\n return os.path.dirname(__file__)", "def...
[ "0.8170498", "0.8149112", "0.8113216", "0.7989826", "0.7970176", "0.79333484", "0.7824644", "0.7777473", "0.77438056", "0.7719309", "0.7697185", "0.76197577", "0.7570368", "0.7545556", "0.75374484", "0.7467858", "0.74403304", "0.74283", "0.7358495", "0.73165745", "0.7294852",...
0.8346807
0
Returns the path of the user configuration file
def get_user_config_path(): return "{}/.dapsenv/dapsenv.conf".format(expanduser("~"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_config_path():\n return os.path.join(os.path.expanduser('~'))", "def get_user_config_dir(options):\n return '/root/.spinnaker'", "def config_file(self):\n return join_path(self.prefix.etc.bohrium, \"config.ini\")", "def config_file_and_path():\n return str(rmfriend_dir() / 'config.cf...
[ "0.78400224", "0.7665953", "0.7620153", "0.75382227", "0.7534668", "0.7432483", "0.7346872", "0.72849715", "0.726103", "0.7230243", "0.7229635", "0.7221889", "0.7221053", "0.71134675", "0.7088942", "0.7082575", "0.70495373", "0.6991914", "0.69861937", "0.6981911", "0.69739807...
0.79443234
0
Returns the value of a property should only be used internally!
def get_property_value(prop, paths): data = parse_config(paths) return data.get(prop)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_value (property):\n assert is_iterable_typed(property, basestring) or isinstance(property, basestring)\n return replace_grist (property, '')", "def get_property_value(self, property, db):\n try:\n for p in self.properties:\n if p.idProperty =...
[ "0.7966625", "0.79354656", "0.7874442", "0.7656781", "0.7521477", "0.75198215", "0.74387866", "0.7414117", "0.73977107", "0.73902535", "0.7380925", "0.72912407", "0.7261663", "0.7232989", "0.72282", "0.71172047", "0.70893174", "0.7045235", "0.70395815", "0.7030893", "0.700933...
0.70536906
17
Sets a value for a property should only be used internally!
def set_property_value(prop, value, path): if not isfile(path): raise ConfigFileNotCreatedException(path) content = "" updated = False try: with open(path, "r+") as f: for line in f: m = _search_pattern.search(line) if m: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_property(self, name, value):\n self.properties[name] = value", "def set_property(key, value):\n return impl.set_property(**locals())", "def do_set_property(self, spec, value):\n attribute = self.find_attribute(spec.name)\n if attribute is not None and isinstance(attribute, property)...
[ "0.789875", "0.787195", "0.77938426", "0.7764865", "0.76872176", "0.76138103", "0.75846153", "0.7535346", "0.7509986", "0.7486596", "0.7475414", "0.74670243", "0.74670243", "0.74670243", "0.73869795", "0.7344651", "0.7318426", "0.7303821", "0.7299281", "0.7232437", "0.7222646...
0.0
-1
Parses all given configuration files and returns their content
def parse_config(paths): data = {} try: for path in paths: if not isfile(path): raise ConfigFileNotCreatedException(path) with open(path) as f: for line in f: # search for key=value pairs m = _search_patte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __load_config_files(self):\n # Parsed configuration files\n # ==========================\n T_dict = ParsedParameterFile(self.config_path('0/T'))\n fv_solutions = ParsedParameterFile(self.config_path('system/fvSolution'))\n fv_schemes = ParsedParameterFile(self.config_path('sy...
[ "0.696402", "0.67024195", "0.6692854", "0.66028833", "0.6596782", "0.6591424", "0.65703565", "0.65684605", "0.6567055", "0.64944386", "0.6489012", "0.64866066", "0.6471236", "0.6432489", "0.63784456", "0.6371147", "0.63701695", "0.6316428", "0.6310577", "0.63022876", "0.62976...
0.6478963
12
Generates a configuration file at the desired location
def generate_config(path, force_overwrite=False): currdir = os.path.dirname(os.path.realpath(__file__)) if not force_overwrite: if os.path.exists("{}/dapsenv.conf".format(path)): raise ConfigFileAlreadyExistsException(path) try: shutil.copy("{}/templates/dapsenv.conf".format(c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_global_config() -> str:\n logger = getLogger(__name__)\n dst = os.path.join(os.path.expanduser(\"~\"),\n \".aiscalator/config/aiscalator.conf\")\n logger.info(\"Generating a new configuration file for aiscalator:\\n\\t%s\",\n dst)\n pattern = [\n ...
[ "0.69057345", "0.6904385", "0.6893657", "0.6818285", "0.6701469", "0.66633904", "0.662853", "0.653605", "0.65043265", "0.6492254", "0.63891", "0.63475204", "0.6343165", "0.63317055", "0.63298446", "0.63297", "0.63161016", "0.63035953", "0.6291675", "0.62661564", "0.6260246", ...
0.6251898
21
Test title, which are present in both databases
def test_present_in_both_db(self): for i in range(5): price = find_cheapest_price("Star Wars: Episode VI - Return of the Jedi") if price is "69.5": break time.sleep(1) self.assertTrue(price == "69.5")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_video_title(self):\r\n video1 = Item.objects.get(video_title=\"Title\")\r\n video2 = Item.objects.get(video_title=\"Not Title\")\r\n self.assertEqual(video1.video_title, \"Title\")\r\n self.assertEqual(video2.video_title, \"Not Title\")", "def test_title(names):", "def test...
[ "0.6810692", "0.6636476", "0.62576246", "0.6207335", "0.61426693", "0.61112493", "0.6020435", "0.59607303", "0.596046", "0.59053046", "0.5889142", "0.5889142", "0.5846345", "0.5842261", "0.5790136", "0.5773127", "0.5773098", "0.5757617", "0.57561547", "0.57504725", "0.5722569...
0.0
-1
Test title, which is present in one database only
def test_present_in_one_db(self): for i in range(5): price = find_cheapest_price("Star Wars: The Force Awakens") if price is "129.5": break time.sleep(1) self.assertTrue(price == "129.5")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_title(self):\n key = api.portal.get_registry_record(\n 'plone.site_title'\n )\n self.assertEqual(u'Briefy CMS', key)", "def test_title(names):", "def test_video_title(self):\r\n video1 = Item.objects.get(video_title=\"Title\")\r\n video2 = Item.objects.get...
[ "0.69115084", "0.68747866", "0.6698193", "0.6624086", "0.66194016", "0.65139085", "0.63848144", "0.63809997", "0.63307256", "0.6262883", "0.6248247", "0.6214016", "0.6193819", "0.6183599", "0.61244667", "0.61119235", "0.6103055", "0.6089567", "0.60747665", "0.6054598", "0.604...
0.0
-1
Test title, which is not present in any database
def test_not_present_in_any_db(self): price = find_cheapest_price("Only Star Wars") self.assertTrue(price == None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_title(names):", "def test_title(self):\n key = api.portal.get_registry_record(\n 'plone.site_title'\n )\n self.assertEqual(u'Briefy CMS', key)", "def test_index_has_status_in_title(self):", "def test_query_has_query_in_title(self):\n query_url = self.warno_url ...
[ "0.68357944", "0.669294", "0.6659154", "0.66550845", "0.6562267", "0.6556013", "0.6490048", "0.64443755", "0.6407572", "0.6393863", "0.63384825", "0.62897366", "0.62545705", "0.6222035", "0.61828727", "0.61750036", "0.6164912", "0.6149769", "0.61397433", "0.61179894", "0.6113...
0.0
-1
Test extra initial spaces
def test_extra_initial_spaces(self): for i in range(5): price = find_cheapest_price(" Star Wars: Episode VI - Return of the Jedi") if price is "69.5": break time.sleep(1) self.assertTrue(price == "69.5")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_before_space():\n \n \n assert(1 == before_space(\"1 2 3\"))\n assert(\"NO SPACE\" == before_space(\"1\"))\n assert(\"Error\" == before_space(None))", "def isspace(self) -> bool:\n pass", "def _is_whitespace(char):\n if char == ' ' or char == '\\t' or char == '\\n' or char == '\\r...
[ "0.72271353", "0.6714598", "0.6690153", "0.66385835", "0.6617807", "0.66094416", "0.6579838", "0.65702033", "0.6558551", "0.653799", "0.6512899", "0.64960116", "0.6495435", "0.6436047", "0.64295197", "0.6429463", "0.6346191", "0.6321559", "0.63012207", "0.6283817", "0.6281358...
0.62246585
24
Test extra end spaces
def test_extra_end_spaces(self): for i in range(5): price = find_cheapest_price("Star Wars: Episode VI - Return of the Jedi ") if price is "69.5": break time.sleep(1) self.assertTrue(price == "69.5")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_space_at_the_end():\n line = \"n\" * 79 + \" \"\n print \"--%s--\" % wrap_line(line)\n assert wrap_line(line) == \"n\" * 79", "def remove_end_spaces(conversion):\n ending = False\n while ending == False:\n if conversion[-1] == ' ':\n del conversion[-1]\n if conver...
[ "0.7096777", "0.6583292", "0.6522514", "0.6513981", "0.6508848", "0.64986074", "0.64799017", "0.6440675", "0.6413336", "0.6377339", "0.6376093", "0.6325999", "0.63193965", "0.63080835", "0.62825227", "0.62758803", "0.62533045", "0.6212336", "0.6202876", "0.6181698", "0.617695...
0.63165057
13
Test extra between spaces
def test_extra_between_spaces(self): for i in range(5): price = find_cheapest_price("Star Wars: Episode VI - Return of the Jedi ") if price is not None: break time.sleep(1) self.assertTrue(price == None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_before_space():\n \n \n assert(1 == before_space(\"1 2 3\"))\n assert(\"NO SPACE\" == before_space(\"1\"))\n assert(\"Error\" == before_space(None))", "def space_check(board, position):\n return board[position] == \" \"", "def test_with_multiple_spaces(self):\n self.assertEqua...
[ "0.7235423", "0.72115743", "0.69549525", "0.6865596", "0.6863932", "0.682128", "0.673894", "0.6686956", "0.66818535", "0.6626529", "0.6560907", "0.6530691", "0.6492438", "0.6451389", "0.6450767", "0.64443094", "0.6436397", "0.64074093", "0.6385751", "0.6383583", "0.6355942", ...
0.5891619
54
Test title with all small letters
def test_small_letters(self): for i in range(5): price = find_cheapest_price("star wars: episode VI - return of the jedi") if price is "69.5": break time.sleep(1) self.assertTrue(price == "69.5")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def title_contains(title_substring):\n title_substring = title_substring.encode('ascii')\n def f(win):\n t = conv(win.title)\n return title_substring in t\n return f", "def test_title(names):", "def testFalseCapTitle(self):\n val = capTitles(\"victor Ifezue\") \n self.a...
[ "0.7216029", "0.7121521", "0.7116587", "0.70877403", "0.70398676", "0.699872", "0.6916369", "0.68733656", "0.6852058", "0.68507123", "0.68265444", "0.6759885", "0.67231154", "0.6678151", "0.6665645", "0.6643266", "0.6637457", "0.6586373", "0.6572064", "0.6534497", "0.6520177"...
0.0
-1
Test title with all capital letters
def test_capital_letters(self): for i in range(5): price = find_cheapest_price("STAR WARS: EPISODE VI - RETURN OF THE JEDI") if price is "69.5": break time.sleep(1) self.assertTrue(price == "69.5")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testCapTitleAgain(self):\n val = capTitles(\"victor\") \n self.assertEqual(val, \"Victor\")", "def proper_title_case(s):\n nocaps = [\"the\"] # This needs to be extended.", "def testFalseCapTitle(self):\n val = capTitles(\"victor Ifezue\") \n self.assertNotEqual(val, ...
[ "0.7584302", "0.73187137", "0.7256049", "0.7191587", "0.7181554", "0.71611553", "0.70876896", "0.69659775", "0.69235843", "0.6917762", "0.6893609", "0.68722034", "0.6856061", "0.68523157", "0.68442553", "0.6844096", "0.676707", "0.67213273", "0.6688612", "0.6667659", "0.66671...
0.6074005
68
Setup required URL and browser
def setup(self): setup_data = get_setup_data() self.base_url = setup_data['base_url'] browser = setup_data['browser'].lower() if browser == 'chrome': self.driver = webdriver.Chrome() elif browser == 'firefox': self.driver = webdriver.Firefox() el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup(self, url, browser_config):\n\n # navigate to the front page\n browser.open_url(url)", "def setUp(self):\n self.browser = webdriver.Firefox()\n self.url = 'http://127.0.0.1:8000/'", "def setup(bus):\n\n import webbrowser\n\n bus.register_service(DOMAIN_BROWSER, SERVI...
[ "0.78816956", "0.70955104", "0.7068756", "0.6758885", "0.6568374", "0.64492273", "0.6431475", "0.6412007", "0.6394155", "0.63925385", "0.6380785", "0.63110197", "0.6297633", "0.62531245", "0.61666447", "0.61405796", "0.6136142", "0.6128124", "0.61214244", "0.61077684", "0.607...
0.70478886
3
Close browser after test
def teardown(self): self.log.info('Close browser') self.driver.quit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def i_close_the_browser():\n driver.close()\n driver.quit()", "def close_browser():\n driver.close()", "def closeBrowser(driver):\n driver.quit()", "def _shutdown_browser(self):\n if self.browser:\n self.browser.close()", "def close(self):\n self.driver.quit()", "def ...
[ "0.8507607", "0.8493402", "0.8110661", "0.804822", "0.7790632", "0.7770495", "0.76660335", "0.752038", "0.75203776", "0.75168914", "0.7512728", "0.75061566", "0.7448983", "0.74159193", "0.740557", "0.7402157", "0.73613596", "0.73563594", "0.7353315", "0.73506343", "0.7349565"...
0.77384126
6
Remove names and emails from the JSON data
def anonymize(data_dir): for root, dirs, files in os.walk(dst_data_dir, topdown=False): for dir_name in sorted(dirs): dir_path = os.path.join(root, dir_name) json_path = os.path.join(root, dir_name, 'data.json') print(json_path) with open(json_path) as f: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_without(self, fields):\n without = {}\n data = json.loads(self.data())\n for field, value in data.items():\n if field not in fields:\n without[field] = value\n return json.dumps(without)", "def strip_unwanted_fields(self, data, many, **kwargs):\n ...
[ "0.6503703", "0.6107616", "0.5858904", "0.5853381", "0.58459127", "0.5783925", "0.5737477", "0.5712423", "0.56732863", "0.56693095", "0.56518984", "0.56355965", "0.5594088", "0.55935717", "0.5591977", "0.55816674", "0.5573393", "0.55636644", "0.5562145", "0.5545655", "0.55399...
0.53692836
35
Find the best and worst clips based on an ensemble of all models
def find_best_worst(data_dir, out_dir, num_gen=30, num_topk=5, max_itrs=5000): all_clips = load_audio_files(data_dir, single_bar=False) all_clips = [clip.squeeze().numpy() for clip in all_clips] print('loaded {} clips'.format(len(all_clips))) models = load_models(data_dir) multi_model = MultiMode...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def best_cv_training(args: dict):\n assert len(args.learning_rates) == args.s, (\n \"learning_rates should be of size s\"\n )\n np.random.seed(args.seed) # set seed\n dataloader_pairs = get_dataloaders(\n args.folder, args.dimensions, args.batch_size, args.s, args.num_workers\n ...
[ "0.6456809", "0.63944465", "0.62981546", "0.6274426", "0.62251264", "0.6138299", "0.6105304", "0.6075691", "0.60605574", "0.60558045", "0.6054263", "0.6024149", "0.60108334", "0.5999265", "0.59565336", "0.59428686", "0.59214", "0.5880305", "0.58452225", "0.58439136", "0.58396...
0.63115335
2
Redraw all the elements on the GraphicsScene
def redraw(self): offset = self.actual_row * self.row_size x = 5 y = 5 ind = 0 self.scene.clear() for _ in range(self.column_size): for _ in range(self.row_size): if ind+offset < len(self.cards): self.draw_card(x, y, ind+off...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh(self):\n\n # Set Graphics scene\n self.setScene(QtGui.QGraphicsScene())\n self._connections = set()\n self._nodes = {}\n self._selection = set()\n self._manipulation_mode = 0\n self._selection_rect = None", "def redraw(self):\n self.scene.redraw...
[ "0.7598374", "0.7523456", "0.73359394", "0.73359394", "0.7278681", "0.72614765", "0.72301275", "0.7224556", "0.7215738", "0.7202812", "0.7139211", "0.71083397", "0.7094835", "0.7075643", "0.7075643", "0.7010708", "0.696503", "0.6866194", "0.6857688", "0.68394774", "0.68365973...
0.7069961
15
Draw card item with its image on the screen
def draw_card(self, x, y, card_pos): card_id = self.cards[card_pos] item = CommonCardHandle(card_pos, self) pixmap = QPixmap() if not pixmap.loadFromData(self.parent.database.get_data(card_id, 'low_res')): # TODO: throw error or something pass item.setPixm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_card_icon(self):\n card_icon = pygame.Surface((card_dimensions[0]/2, card_dimensions[1]/2))\n card_icon.fill(self.color)\n pygame.draw.rect(card_icon, CARD_OUTLINE, (0,0,card_icon.get_width(), card_icon.get_height()), 1)\n #the picture\n pic = pygame.transform.scale(self...
[ "0.77568555", "0.7183763", "0.70858896", "0.70401824", "0.70079154", "0.6899117", "0.6876519", "0.68346894", "0.6754337", "0.6723893", "0.67201185", "0.6700681", "0.6670856", "0.6617026", "0.6616946", "0.65604407", "0.6513981", "0.64907306", "0.64469767", "0.6432041", "0.6398...
0.7373437
1
Draw a frame around a clicked card on the board
def draw_highlight(self, x1, x2, y1, y2, color): self.scene.addLine(x1 - 1, y1 - 1, x1 - 1, y2 + 1, QPen(color)) self.scene.addLine(x2 + 1, y1 - 1, x2 + 1, y2 + 1, QPen(color)) self.scene.addLine(x1 - 1, y1 - 1, x2 + 1, y1 - 1, QPen(color)) self.scene.addLine(x1 - 1, y2 + 1, x2 + 1, y2 +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_me(self):\r\n\t\tself.image.fill((100, 200, 100))\r\n\t\tif self.active: pg.draw.rect(self.image, (100, 100, 200), self.frame, 3) #if active => draw frame around selected entity width 3\r\n\t\tself.display_surface.blit(self.image, self.rect)", "def draw():", "def draw(self, canvas, yloc):\n \n ...
[ "0.69895494", "0.681933", "0.6818229", "0.68115544", "0.67861265", "0.67620695", "0.675582", "0.6736298", "0.67119414", "0.66957617", "0.6582334", "0.6575421", "0.65591764", "0.65526736", "0.6526447", "0.6501671", "0.649707", "0.64956635", "0.6450405", "0.63855344", "0.637756...
0.0
-1
Asks user to specify a city, month, and day to analyze.
def get_filters(): print("Hello there! Let's explore some data!") legit_cities = ['chicago', 'new york city', 'washington'] # cities im gonna accept city = input("\nWhich city do you want to analyze? Chicago, New York City or Washington?\n").lower() while city not in legit_cities: print("There...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Raw_Data(city,month,day):\n print(\"The city you have entered is: \",city)\n print(\"The month you have entered is: \",month)\n print(\"The day you have entered is: \",day)", "def get_filters():\n city = None\n month = None\n day = None\n while day == None:\n # TO DO: get user input f...
[ "0.667135", "0.65355784", "0.6372491", "0.6349019", "0.63104576", "0.62870693", "0.6259983", "0.62297434", "0.62112975", "0.62049454", "0.6181796", "0.6170252", "0.6170224", "0.6159359", "0.61588275", "0.6153817", "0.61454034", "0.61345667", "0.61054", "0.61033493", "0.609148...
0.6459417
2
Loads data for the specified city and filters by month and day if applicable.
def load_data(city, month, day): data = pd.read_csv("{}.csv".format(city)) data.drop(data.columns[0], axis = 1, inplace = True) #dropping this strange column data['Start Time'] = pd.to_datetime(data['Start Time'], format='%Y-%m-%d %H:%M:%S') data['End Time'] = pd.to_datetime(data['End Time'], format...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(city, month, day):\n df = pd.read_csv(CITY_DATA [city])\n \n # convert the Start Time column to datetime\n df['Start Time'] = pd.to_datetime(df['Start Time'])\n \n # extract month and day of week from Start Time to create new columns\n df['month'] = df['Start Time'].dt.month\n ...
[ "0.81320685", "0.8108889", "0.8045821", "0.8042514", "0.80090284", "0.80071104", "0.79991937", "0.7998333", "0.7988789", "0.797905", "0.79737365", "0.79610896", "0.7956163", "0.7947432", "0.79463065", "0.7908287", "0.7908229", "0.7904569", "0.7900715", "0.78930074", "0.788921...
0.73460114
97