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
Converts an atom into a plush gene.
def atom_to_plush_gene(self, atom): is_literal = False proc_atom = None if callable(atom): # If it is callable, then it is likely a function that will # produce a literal. fn_element = atom() if callable(fn_element): # It's another function! ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_atom(self, atom):\n\t\treturn atom", "def from_symbol_to_entrez_gene_id(row):\r\n\tgene_entry = annotation_client.get_entrez_gene_id_from_symbol(row['symb'])\r\n\t# import pdb; pdb.set_trace()\r\n\tegid = str(gene_entry['entrez_gene_id'][0]) if gene_entry is not None else \"0\"\r\n\treturn egid", "...
[ "0.6376666", "0.54954624", "0.5164283", "0.5075839", "0.49984407", "0.49653354", "0.4889176", "0.48709634", "0.47833455", "0.4767029", "0.47523892", "0.47412694", "0.47290564", "0.47286844", "0.47149265", "0.47015738", "0.46589604", "0.4652836", "0.46481746", "0.46437928", "0...
0.7106877
0
Returns a random plush gene given atom_generators and epigeneticmarkers. Returns A random Plush gene from the ``atom_generators``.
def random_plush_gene(self): atom = random.choice(list(self.atom_generators)) return self.atom_to_plush_gene(atom)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __generate_random_gene_sequence(self):\n genes = []\n for j in range(self.chromosome_size):\n genes.append(random.choice(self.gene_pool))\n\n return genes", "def random_gene(self):\n size = random.randint(1,50)\n gene = \"\"\n for i in range(0,size,1):\n ...
[ "0.62055737", "0.61462736", "0.6118242", "0.59235466", "0.5799568", "0.5753317", "0.57463783", "0.5726904", "0.56850755", "0.5670097", "0.5586955", "0.55046254", "0.5476053", "0.54712176", "0.5389296", "0.5357205", "0.5284238", "0.5267698", "0.52539104", "0.52085936", "0.5170...
0.741422
0
Returns a random Plush genome with size ``genome_size``.
def random_plush_genome_with_size(self, genome_size): atoms = rand.choice(list(self.atom_generators), size=genome_size) return [self.atom_to_plush_gene(atom) for atom in atoms]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_plush_genome(self, max_genome_size):\n genome_size = random.randint(1, max_genome_size)\n return self.random_plush_genome_with_size(genome_size)", "def get_random_genome(self):\n return random.choice(self.genomes)", "def generate_random_population(pop_size):\n\n random_popula...
[ "0.78010154", "0.6555178", "0.6489522", "0.639668", "0.6082051", "0.60245764", "0.5986952", "0.57938874", "0.5732188", "0.57120425", "0.5651485", "0.56411", "0.5639163", "0.5633647", "0.5595927", "0.55193704", "0.5512438", "0.54670936", "0.5464544", "0.54443496", "0.54303193"...
0.82965225
0
Returns a random Plush genome with size limited by max_genome_size.
def random_plush_genome(self, max_genome_size): genome_size = random.randint(1, max_genome_size) return self.random_plush_genome_with_size(genome_size)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_plush_genome_with_size(self, genome_size):\n atoms = rand.choice(list(self.atom_generators), size=genome_size)\n return [self.atom_to_plush_gene(atom) for atom in atoms]", "def get_random_genome(self):\n return random.choice(self.genomes)", "def _make_random_genome(evo_config):\...
[ "0.753748", "0.7089966", "0.6752933", "0.6277186", "0.6107495", "0.6055105", "0.60515046", "0.602981", "0.5952698", "0.5886196", "0.57833123", "0.57707804", "0.57010764", "0.5688395", "0.566979", "0.5648049", "0.5640551", "0.56156576", "0.55757904", "0.5574941", "0.5560186", ...
0.87570876
0
Returns a random Push expression with size limited by max_points.
def random_push_code(self, max_points): max_genome_size = max(int(max_points / 2), 1) genome = self.random_plush_genome(max_genome_size) return genome_to_program(genome)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_plush_genome(self, max_genome_size):\n genome_size = random.randint(1, max_genome_size)\n return self.random_plush_genome_with_size(genome_size)", "def random_plush_gene(self):\n atom = random.choice(list(self.atom_generators))\n return self.atom_to_plush_gene(atom)", "de...
[ "0.64721805", "0.57280564", "0.5667171", "0.5605492", "0.5529688", "0.5511735", "0.54048395", "0.5329024", "0.5326156", "0.5317445", "0.531234", "0.5264657", "0.51636416", "0.51634496", "0.5159698", "0.5148549", "0.51481014", "0.51468843", "0.51397496", "0.5133279", "0.513049...
0.7029213
0
Return the Ground State Energies
def _get_gs_energies(self): energy = [] for ground_state in self._ground_states: gs_energy = 0.0 for key in ground_state["eci"].keys(): gs_energy += ground_state["eci"][key] * ground_state["cf"][key] energy.append(len(ground_state["atoms"]) * gs_energy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gEs(self):\n try:\n return self._gEs\n except AttributeError:\n try:\n self._gEs = pd.read_csv(\n os.path.join(self.loc, self.gs_out),\n index_col=0)\n print(\"Reading ground spin states from...
[ "0.6230123", "0.61784995", "0.6009308", "0.5999785", "0.5996852", "0.59820014", "0.5958661", "0.5931075", "0.5889137", "0.5888036", "0.5803028", "0.576005", "0.57563055", "0.5721198", "0.5711022", "0.5687426", "0.5670511", "0.56288415", "0.56270766", "0.56044376", "0.55956", ...
0.6506218
0
Sets the integration direction.
def _set_integration_direction(self, T0, Tend): if Tend is None: # Use the default which is increasing from 0K return if T0 > Tend: self._integration_direction = "decreasing" else: self._integration_direction = "increasing"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setDirection(self,stepDir = 2):\n pass", "def setdirection(self, *args, **kwargs):\n return _coordsys.coordsys_setdirection(self, *args, **kwargs)", "def direction(self, direction):\n\n self._direction = direction", "def set_direction(self, new_dir):\n self.__direction = new_d...
[ "0.7542952", "0.7146989", "0.69682", "0.69272983", "0.69205153", "0.68018293", "0.68018293", "0.67248225", "0.67248225", "0.6560766", "0.649372", "0.6449591", "0.6381216", "0.6296564", "0.6294324", "0.6231282", "0.61218536", "0.60626364", "0.60610044", "0.6020907", "0.6015768...
0.76403767
0
Returns true if we reached the temperature end point.
def _reached_temperature_end_point(self, T, Tend): if Tend is None: # End point not give return False if self._integration_direction == "increasing": if T > Tend: return True elif self._integration_direction == "decreasing": if T <...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_done(self):\n return True if self.t >= self.max_ep_len else False", "def if_end(self, **kwargs):\n\n index = self.get('_index')\n\n if index and index >= len(self.steps)-1:\n return True # all steps have been used\n\n return False", "def isFinished(self):\n ...
[ "0.68749845", "0.6486663", "0.64634204", "0.640316", "0.6394104", "0.6357551", "0.6345655", "0.63410616", "0.6326322", "0.63182914", "0.62896657", "0.62468636", "0.6238003", "0.6207513", "0.62044257", "0.6198576", "0.6184775", "0.61823577", "0.6150872", "0.61056906", "0.60730...
0.83553135
0
Stores backup data to hdf5 file
def _backup(self, data, dsetname="data"): with h5.File(self._backupfile, 'a') as hfile: grp = hfile.create_group( dsetname + "{}".format( self._current_backup_indx)) for key, value in data.items(): if value is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_as_hdf5(self, filename):", "def save_backup(\n self):\n self.backup = self.data", "def to_hdf5(self, filepath, **kwargs):\n hdf = pd.HDFStore(filepath, **kwargs)\n hdf.put(self.INDEXDATAFRAME, self.df, format='fixed', data_columns=True)\n hdf.close()", "def save_h5...
[ "0.73253554", "0.6622011", "0.6496483", "0.64814097", "0.647887", "0.6392372", "0.63609046", "0.63100886", "0.62743527", "0.6262256", "0.6217909", "0.6199056", "0.61985654", "0.6194896", "0.61822635", "0.61728513", "0.6162515", "0.6148715", "0.6139941", "0.6126298", "0.610742...
0.6652448
1
Check if composition changes too much from one step to another
def _system_changed_phase(self, prev_comp, comp): return np.abs(prev_comp - comp) > self._max_singlet_change
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_if_can_evolve(self):\n # This sounds similar to generate actions\n pass", "def converged(self) -> bool:", "def converged(self) -> bool:", "def converged(self) -> bool:", "def _compositions_swapped(self, thermo):\n assert self._ref_indicators is not None\n\n indicators ...
[ "0.6158223", "0.609395", "0.609395", "0.609395", "0.60568446", "0.6024883", "0.5987834", "0.5795023", "0.574844", "0.5735461", "0.57305664", "0.5709299", "0.5709299", "0.5688929", "0.5688929", "0.56603444", "0.5645165", "0.5631118", "0.562156", "0.5614584", "0.560819", "0.5...
0.61296654
1
Return array of the singlet terms
def _get_singlet_array(self, thermo): singlets = [] for entry in thermo: singlets.append([entry[get_singlet_name(name)] for name in self._singlet_names]) return singlets
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_terms(self):\n return self.__terms", "def _get_terms(self):\n return self.__terms", "def _get_terms(self):\n return self.__terms", "def _get_terms(self):\n return self.__terms", "def _get_terms(self):\n return self.__terms", "def _get_terms(self):\n return self.__terms", "def...
[ "0.69178885", "0.69178885", "0.69178885", "0.69178885", "0.69178885", "0.69178885", "0.69178885", "0.69178885", "0.69178885", "0.67557126", "0.66699016", "0.6567775", "0.63677454", "0.6355416", "0.6226497", "0.6089282", "0.6078308", "0.6078308", "0.6032249", "0.60092956", "0....
0.6973103
0
Check if one of the systems changed phase
def _one_system_changed_phase(self, thermo, ref_values): singlet_array = self._get_singlet_array(thermo) for cur_array, ref_array in zip(singlet_array, ref_values): for cur_val, ref_val in zip(cur_array, ref_array): if self._system_changed_phase(cur_val, ref_val): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _system_changed_phase(self, prev_comp, comp):\n return np.abs(prev_comp - comp) > self._max_singlet_change", "def has_state_changed(self) -> bool:\r\n ...", "def check_device_state(self):", "def check_change(self, state_variables):\n for control in self.__control_list:\n i...
[ "0.758044", "0.6362879", "0.61289746", "0.59745437", "0.5927031", "0.5877956", "0.58395505", "0.5811819", "0.58104575", "0.5734162", "0.57106453", "0.5701636", "0.5695618", "0.568467", "0.5654003", "0.56400806", "0.5624871", "0.56106794", "0.5610273", "0.56056416", "0.5599556...
0.7447519
1
Checks if the predicted and the computed values match
def _prediction_match(self, thermo, ref_values, eps=0.05): singlet_array = self._get_singlet_array(thermo) for cur_array, ref_array in zip(singlet_array, ref_values): for cur_val, ref_val in zip(cur_array, ref_array): if abs(cur_val - ref_val) > eps: retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_prediction(self):\n predicted_scores = self.sess.run(self.NET.output_with_relu, feed_dict={self.NET.input: self.test_image if len(self.test_image.shape)==4 else [self.test_image]})\n self.original_confidence = np.max(predicted_scores)\n if np.argmax(predicted_scores,1) != self.origin...
[ "0.6819916", "0.6686152", "0.6664491", "0.66569054", "0.658159", "0.65720046", "0.65405303", "0.65399057", "0.6520549", "0.6491463", "0.64827454", "0.6441679", "0.64338255", "0.6414647", "0.6393218", "0.6378676", "0.6371993", "0.6312835", "0.6306903", "0.6305888", "0.62949526...
0.6692643
1
Initialize the SGC MC objects
def _init_sgc(self, init_temp, symbols): self._sgc_obj = [] for ground_state in self._ground_states: self._sgc_obj.append( SGCMonteCarlo( ground_state["atoms"], init_temp, symbols=symbols))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\r\n\r\n self.Helpers = Helpers(\"Movidius\")\r\n self.confs = self.Helpers.confs\r\n\r\n self.classes = []\r\n self.ncsGraph = None\r\n self.ncsDevice = None\r\n self.reqsize = None\r\n\r\n self.mean = 128\r\n self.std = 1 / 128\r\n\r\n ...
[ "0.67107725", "0.6539785", "0.6507728", "0.64441645", "0.64169127", "0.64014566", "0.6322285", "0.6314256", "0.6253781", "0.62345904", "0.62134373", "0.62134373", "0.62134373", "0.62134373", "0.62134373", "0.62134373", "0.62134373", "0.62134373", "0.6211918", "0.62051463", "0...
0.68712074
0
Check that the ground_state arguments contain the correct fields
def check_gs_argument(ground_state): required_fields = ["bc", "cf", "eci", "atoms"] keys = ground_state.keys() for key in keys: if key not in required_fields: raise ValueError( "The GS argument has to contain {} keys. Given {}".format( required_fields,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _verify_command_states(cls, kwargs):\n return kwargs", "def check_state(self):\n pass", "def _check_params(self):\n pass", "def validate_ground_input(ground: tuple) -> None:\n\n if not isinstance(ground, tuple):\n raise InvalidGroundValueError(\n f\"O...
[ "0.65441775", "0.6414534", "0.61819196", "0.6114851", "0.6088804", "0.5971366", "0.59573877", "0.5891864", "0.5886692", "0.5885214", "0.58631516", "0.580721", "0.5800338", "0.5740057", "0.57381886", "0.57213455", "0.57193244", "0.5703734", "0.5701963", "0.56963843", "0.569578...
0.77645344
0
Returns the singlet name as stored in the thermodictionary
def get_singlet_name(orig_name): return "singlet_{}".format(orig_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self) -> str:\n return f\"{self._inst} {self._sid_data['sid']} {self._data[self._sid_data['sid_name']]}\"", "def species_name(self):\n return self.get(self._names[\"species_name\"])", "def get_name():", "def name(self) -> str:\n return pulumi.get(self, \"name\")", "def name(se...
[ "0.6928742", "0.67757905", "0.6712813", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", "0.66612947", ...
0.7363678
0
Delete a previously created rolemenu
async def rolemenu_delete(self, interaction: discord.Interaction, name: str): doc = await self.db.find_one({ "guild_id": interaction.guild.id, "name": name }) if not doc: return await interaction.response.send_message( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_menu():", "async def roledelete(ctx):\r\n await ctx.message.delete()\r\n roles = ctx.guild.roles\r\n roles.pop(0)\r\n for role in roles:\r\n if ctx.guild.roles[-1] > role:\r\n try:\r\n await role.delete()\r\n except:\r\n print(f\"{...
[ "0.7695256", "0.71618533", "0.7062838", "0.69895333", "0.6775688", "0.675535", "0.6746418", "0.67404985", "0.67155915", "0.6577805", "0.652319", "0.64278144", "0.64047396", "0.6371427", "0.63324994", "0.63156474", "0.63074523", "0.63068837", "0.6301148", "0.6283026", "0.62599...
0.78972113
0
Remove a role from a menu
async def rolemenu_remove_role(self, interaction: discord.Interaction, name: str, role: str): try: role_id = int(role) except ValueError: return await interaction.response.send_message( "The role provided " "is no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_menu(menu_name):\n\n pass", "async def rolemenu_delete(self, interaction: discord.Interaction,\n name: str):\n doc = await self.db.find_one({\n \"guild_id\": interaction.guild.id,\n \"name\": name\n })\n if not doc:\n ...
[ "0.76884437", "0.747322", "0.7270676", "0.71565264", "0.712966", "0.70907384", "0.69873995", "0.6899004", "0.6845092", "0.68170446", "0.6810149", "0.68007976", "0.67884195", "0.67334276", "0.6684447", "0.6681211", "0.66589636", "0.66485894", "0.6637888", "0.662638", "0.661526...
0.81111044
0
to evaluate a postfix expression into a value. Use the postfix_valid function described below to check the validity of the expression
def postfix_eval(postfix_expr): s = StackArray() expr = postfix_expr.split() for token in expr: if token[0] in '0123456789': res = token s.push(res) else: # token is operator op2 = s.pop() op2 = float(op2) if s.is_empty(): # token i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluatePostfixExp(self, postfixExpr):\n\n operandStack = []\n tokenList = postfixExpr.split(\" \")\n\n for token in tokenList:\n if self.isOperand(token):\n if \".\" in token:\n token = float(token)\n else:\n t...
[ "0.7719225", "0.74093944", "0.7368014", "0.7160753", "0.7056071", "0.6832468", "0.680652", "0.67106664", "0.67052156", "0.6677665", "0.6639799", "0.65545446", "0.64869434", "0.6457488", "0.64207363", "0.64158213", "0.6396951", "0.63920987", "0.6357941", "0.6345688", "0.631739...
0.7796605
0
To test for an invalid postfix expression. You may assume that what is passed in is a string that only contains numbers and operators. These are separated into valid tokens by spaces so you can use split and join as necessary.
def postfix_valid(postfix_expr): expr = postfix_expr.split() count = 0 if postfix_expr == "": return False for token in expr: if token[0] in '0123456789': count += 1 elif token == '~': pass else: # all other binary operators count -= 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate(string):\n \n tokens = string.split()\n \n # Remembers if the previous token was an operator\n opflag = True\n \n ## Highly inefficient validity checking begins here ##\n \n # List of operators as they would appear in the infix expression\n operators = ['+', '-', '*', '/'...
[ "0.7520136", "0.6987341", "0.69246596", "0.6914398", "0.67455107", "0.6717881", "0.6708455", "0.67051095", "0.66992074", "0.6603976", "0.6578779", "0.6534092", "0.646224", "0.6458865", "0.6412046", "0.63550186", "0.63059497", "0.62621725", "0.6261374", "0.6159734", "0.6157778...
0.7960342
0
Handles bootstrapping of system restart for exchange resources and broker state. Ensures ExchangePoint and ExchangeSpace resources in system have a properly declared AMQP exchange Ensures ExchangeName resources in system have a properly declared queue Logs all exchanges/queues it didn't understand Purges all service qu...
def on_restart(self, process, config, **kwargs): ex_manager = process.container.ex_manager old_use_ems = ex_manager.use_ems ex_manager.use_ems = False # get list of queues from broker with full props that have to do with our sysname all_queues = ex_manager._list_q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_initial_bootstrap(self, process, config, **kwargs):\n\n # get default org_id\n # @TODO: single org assumed for now\n org_ids = process.container.resource_registry.find_resources(RT.Org, id_only=True)\n if not (len(org_ids) and len(org_ids[0]) == 1):\n raise StandardErr...
[ "0.5795612", "0.55824107", "0.54487985", "0.54377425", "0.52643657", "0.5207759", "0.51595104", "0.51521397", "0.5136054", "0.5055962", "0.5046804", "0.49983096", "0.49463856", "0.49236155", "0.48859736", "0.48449838", "0.47945452", "0.477098", "0.47691527", "0.4756401", "0.4...
0.6884117
0
Adds a persistence interval as child to this along with its points
def appendChild(self, child): self.points += child.points.copy() self.children.append(child)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(self, interval):\n self.intervals.append(copy.deepcopy(interval))", "def add_child(self, child: UIComponent):\n child.parent = self\n child.set_chronometer(self._chronometer)\n self.children.append(child)\n if self.props.resize_mode == ResizeMode.AUTO:\n s...
[ "0.5290929", "0.52899754", "0.5150174", "0.5115925", "0.50472325", "0.49198186", "0.48833942", "0.4872159", "0.48698753", "0.4853984", "0.48440596", "0.48227778", "0.4820813", "0.48132288", "0.4789898", "0.47870472", "0.47661018", "0.47631806", "0.47591513", "0.47563797", "0....
0.5965832
0
Computes the filtration of the function which values are stored in x Return a single persistence interval which is the father of all the others
def get_filtration(self, x): n = x.shape[0] s = sorted([(i, x[i]) for i in range(n)], key=lambda x: x[1]) selected = [False for i in range(n)] sets = {} ancestor = {i: i for i in range(n)} i = 0 while False in selected: newpoint = s[i] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate_filter(self, x):\n raise NotImplementedError", "def __call__(self,x):\n\n arr = np.array(x,copy=False,dtype=float)\n return self._filterfunc(arr,*self.parvals)", "def x_density_function(self, x):\n return self.wavefunction(x) * self.wavefunction(x)", "def apply(cls, x...
[ "0.66155213", "0.6502836", "0.6244583", "0.6191562", "0.6171329", "0.60968804", "0.5972131", "0.58754563", "0.58578396", "0.583398", "0.58136237", "0.5768855", "0.57474226", "0.57474226", "0.5723264", "0.5715423", "0.57015836", "0.568552", "0.5681059", "0.56740314", "0.563692...
0.73229456
0
Testing {% ageid %} with now
def test_with_now(self): self.assertEqual(ageid(self.now), 'age1')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now_minus_1_day(self):\n self.assertEqual(ageid(self.now - timedelta(1)), 'age2')", "def test_with_now_minus_4_days(self):\n self.assertEqual(ageid(self.now - timedelta(4)), 'age5')", "def test_with_now_minus_2_days(self):\n self.assertEqual(ageid(self.now - timedelta(2)), 'a...
[ "0.69662714", "0.6784399", "0.66615933", "0.6583668", "0.5942472", "0.5604099", "0.5554456", "0.54843175", "0.54843175", "0.54263604", "0.53355616", "0.51519006", "0.51454365", "0.5122762", "0.51186895", "0.5117891", "0.5117891", "0.50775474", "0.50633246", "0.5044899", "0.50...
0.735791
0
Testing {% ageid %} with yesterday
def test_with_now_minus_1_day(self): self.assertEqual(ageid(self.now - timedelta(1)), 'age2')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now_minus_2_days(self):\n self.assertEqual(ageid(self.now - timedelta(2)), 'age3')", "def test_with_now_minus_4_days(self):\n self.assertEqual(ageid(self.now - timedelta(4)), 'age5')", "def test_with_now_minus_3_days(self):\n self.assertEqual(ageid(self.now - timedelta(3)), '...
[ "0.6852591", "0.68312496", "0.6746986", "0.63439506", "0.55546343", "0.5394519", "0.5380408", "0.53524274", "0.532431", "0.53095055", "0.5292067", "0.5264989", "0.52530444", "0.5232551", "0.5178952", "0.5160872", "0.5160872", "0.51382077", "0.5128389", "0.51267356", "0.512673...
0.71235526
0
Testing {% ageid %} with two days ago
def test_with_now_minus_2_days(self): self.assertEqual(ageid(self.now - timedelta(2)), 'age3')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now_minus_1_day(self):\n self.assertEqual(ageid(self.now - timedelta(1)), 'age2')", "def test_with_now_minus_3_days(self):\n self.assertEqual(ageid(self.now - timedelta(3)), 'age4')", "def test_with_now_minus_4_days(self):\n self.assertEqual(ageid(self.now - timedelta(4)), 'a...
[ "0.7187669", "0.71045613", "0.69863856", "0.6409827", "0.6115783", "0.6011794", "0.59129065", "0.58910406", "0.5766613", "0.57489073", "0.570259", "0.5692219", "0.56637126", "0.5635098", "0.56275165", "0.5569759", "0.5563165", "0.5558488", "0.55378413", "0.5536425", "0.551116...
0.74781424
0
Testing {% ageid %} with three days ago
def test_with_now_minus_3_days(self): self.assertEqual(ageid(self.now - timedelta(3)), 'age4')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now_minus_2_days(self):\n self.assertEqual(ageid(self.now - timedelta(2)), 'age3')", "def test_with_now_minus_4_days(self):\n self.assertEqual(ageid(self.now - timedelta(4)), 'age5')", "def test_with_now_minus_1_day(self):\n self.assertEqual(ageid(self.now - timedelta(1)), 'a...
[ "0.72407234", "0.71853626", "0.69618046", "0.6308967", "0.5874855", "0.5764519", "0.57058084", "0.5670079", "0.5669819", "0.56191695", "0.55904025", "0.5588826", "0.5547945", "0.55410856", "0.54885393", "0.5463492", "0.54514664", "0.5433101", "0.5414855", "0.5414855", "0.5396...
0.7658383
0
Testing {% ageid %} with four days ago
def test_with_now_minus_4_days(self): self.assertEqual(ageid(self.now - timedelta(4)), 'age5')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now_minus_3_days(self):\n self.assertEqual(ageid(self.now - timedelta(3)), 'age4')", "def test_with_now_minus_2_days(self):\n self.assertEqual(ageid(self.now - timedelta(2)), 'age3')", "def test_with_now_minus_1_day(self):\n self.assertEqual(ageid(self.now - timedelta(1)), 'a...
[ "0.74405986", "0.7243347", "0.7164045", "0.64622", "0.61869997", "0.5989337", "0.5977138", "0.59006375", "0.58485234", "0.58320135", "0.5765161", "0.57545257", "0.5669327", "0.56675255", "0.5645776", "0.56452954", "0.5626133", "0.56260896", "0.5614728", "0.5614728", "0.560904...
0.76875675
0
Testing {% ageid %} with nondatetime object
def test_with_non_datetime(self): class Foo: def __init__(self, now): self.day = now.day self.month = now.month self.year = now.year self.assertEqual(ageid(Foo(self.now)), 'age1')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_now(self):\n self.assertEqual(ageid(self.now), 'age1')", "def test_with_now_minus_1_day(self):\n self.assertEqual(ageid(self.now - timedelta(1)), 'age2')", "def test_with_now_minus_4_days(self):\n self.assertEqual(ageid(self.now - timedelta(4)), 'age5')", "def test_with_now...
[ "0.63388425", "0.63034344", "0.62018883", "0.5981848", "0.5964965", "0.54276353", "0.53872085", "0.5364365", "0.5332901", "0.5280744", "0.5114568", "0.5074603", "0.5051021", "0.50412714", "0.5040437", "0.5022143", "0.50190246", "0.5007389", "0.49899918", "0.4977157", "0.49450...
0.6560905
0
Testing {% attr %} with value
def test_with_value(self): t = Template('{% load djblets_utils %}' '<span{% attr "class" %}\n' '{% if some_bool %}truthy{% endif %}\n' '{% endattr %}>') self.assertEqual( t.render(Context({ 'some_bool': True, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_escapes_value(self):\n t = Template('{% load djblets_utils %}'\n '<span{% attr \"data-foo\" %}<hello>{% endattr %}>')\n\n self.assertEqual(\n t.render(Context()),\n '<span data-foo=\"&lt;hello&gt;\">')", "def test_without_value(self):\n t = ...
[ "0.6986304", "0.64239806", "0.62053716", "0.60444796", "0.6013152", "0.5872319", "0.57564497", "0.5672158", "0.5657833", "0.5617325", "0.5616147", "0.55541307", "0.55276436", "0.55276436", "0.5515096", "0.53856736", "0.5377886", "0.5365207", "0.53558373", "0.5329564", "0.5322...
0.7152068
0
Testing {% attr %} with no value
def test_without_value(self): t = Template('{% load djblets_utils %}' '<span{% attr "class" %}\n' '{% if some_bool %}falsy{% endif %}\n' '{% endattr %}>') self.assertEqual( t.render(Context({ 'some_bool': False,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_nocondense_preserves_whitespace(self):\n t = Template('{% load djblets_utils %}'\n '<span{% attr \"data-foo\" nocondense %}\\n'\n 'some \\n\\n'\n 'value\\n'\n '{% endattr %}>')\n\n self.assertEqual(\n ...
[ "0.6310917", "0.61786014", "0.6155865", "0.61103326", "0.6076733", "0.60245657", "0.60144234", "0.5987151", "0.59353393", "0.5877451", "0.57956505", "0.5780371", "0.5739188", "0.57341295", "0.570383", "0.5699017", "0.56983703", "0.56973076", "0.56841075", "0.5683129", "0.5657...
0.7473954
0
Testing {% attr %} escapes value
def test_escapes_value(self): t = Template('{% load djblets_utils %}' '<span{% attr "data-foo" %}<hello>{% endattr %}>') self.assertEqual( t.render(Context()), '<span data-foo="&lt;hello&gt;">')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_condenses_whitespace(self):\n t = Template('{% load djblets_utils %}'\n '<span{% attr \"data-foo\" %}\\n'\n 'some \\n\\n'\n 'value\\n'\n '{% endattr %}>')\n\n self.assertEqual(\n t.render(Context())...
[ "0.68725014", "0.66181767", "0.6570079", "0.6313018", "0.6299173", "0.6291482", "0.62913966", "0.62795967", "0.62727976", "0.625454", "0.6089015", "0.6058828", "0.6058828", "0.60290384", "0.59374166", "0.5875695", "0.5865545", "0.58360916", "0.5792689", "0.5773664", "0.576730...
0.8348637
0
Testing {% attr %} condenses/strips extra whitespace by default
def test_condenses_whitespace(self): t = Template('{% load djblets_utils %}' '<span{% attr "data-foo" %}\n' 'some \n\n' 'value\n' '{% endattr %}>') self.assertEqual( t.render(Context()), '<spa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_nocondense_preserves_whitespace(self):\n t = Template('{% load djblets_utils %}'\n '<span{% attr \"data-foo\" nocondense %}\\n'\n 'some \\n\\n'\n 'value\\n'\n '{% endattr %}>')\n\n self.assertEqual(\n ...
[ "0.75899607", "0.6015355", "0.60029346", "0.599833", "0.59812284", "0.590307", "0.58477765", "0.5798002", "0.5767309", "0.57589287", "0.5736964", "0.57327765", "0.566209", "0.555631", "0.55304635", "0.5522477", "0.55130064", "0.55026585", "0.55026585", "0.5475007", "0.5445276...
0.7845027
0
Testing {% attr %} with "nocondense" option preserves whitespace
def test_with_nocondense_preserves_whitespace(self): t = Template('{% load djblets_utils %}' '<span{% attr "data-foo" nocondense %}\n' 'some \n\n' 'value\n' '{% endattr %}>') self.assertEqual( t.render(Co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_condenses_whitespace(self):\n t = Template('{% load djblets_utils %}'\n '<span{% attr \"data-foo\" %}\\n'\n 'some \\n\\n'\n 'value\\n'\n '{% endattr %}>')\n\n self.assertEqual(\n t.render(Context())...
[ "0.76482457", "0.6110049", "0.6032022", "0.60097104", "0.59339833", "0.58609396", "0.5809474", "0.5775858", "0.57260346", "0.57034314", "0.5422834", "0.5383639", "0.5341832", "0.5255964", "0.51910955", "0.5153591", "0.5108174", "0.51074314", "0.50881976", "0.50743866", "0.504...
0.87957716
0
Testing {% definevar %}
def test_basic_usage(self): t = Template('{% load djblets_utils %}' '{% definevar "myvar" %}\n' 'test{{num}}\n' '{% enddefinevar %}' '{{myvar}}') self.assertEqual( t.render(Context({ 'num': 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_global(self):\n t = Template(\n '{% load djblets_utils %}'\n '{% block main %}'\n '{% block inner %}'\n '{% definevar \"myvar\" global %}{{num}}{% enddefinevar %}'\n '{% endblock %}'\n '{% endblock %}'\n '[{{myvar...
[ "0.7557205", "0.6654228", "0.66269934", "0.64311785", "0.6370524", "0.5851564", "0.58426505", "0.58310306", "0.58013564", "0.5758977", "0.5751494", "0.5745439", "0.5702883", "0.5684491", "0.5683458", "0.5608868", "0.5593703", "0.5558762", "0.55465716", "0.55460024", "0.553575...
0.73995805
1
Testing {% definevar %} with global option
def test_with_global(self): t = Template( '{% load djblets_utils %}' '{% block main %}' '{% block inner %}' '{% definevar "myvar" global %}{{num}}{% enddefinevar %}' '{% endblock %}' '{% endblock %}' '[{{myvar}}]') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_basic_usage(self):\n t = Template('{% load djblets_utils %}'\n '{% definevar \"myvar\" %}\\n'\n 'test{{num}}\\n'\n '{% enddefinevar %}'\n '{{myvar}}')\n\n self.assertEqual(\n t.render(Context({\n ...
[ "0.6690785", "0.6217259", "0.58671683", "0.57850444", "0.57299507", "0.56862706", "0.56507456", "0.55629444", "0.5521804", "0.5510736", "0.55011946", "0.5426911", "0.5374006", "0.5332082", "0.52935004", "0.5253905", "0.5244905", "0.5229635", "0.52291816", "0.5228609", "0.5226...
0.76271826
0
Testing {% definevar %} with strip option
def test_with_strip(self): t = Template('{% load djblets_utils %}' '{% definevar "myvar" strip %}\n' '<span>\n' ' <strong>\n' ' test{{num}}\n' ' </strong>\n' '</span>\n' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_spaceless(self):\n t = Template('{% load djblets_utils %}'\n '{% definevar \"myvar\" spaceless %}\\n'\n '<span>\\n'\n ' <strong>\\n'\n ' test{{num}}\\n'\n ' </strong>\\n'\n ...
[ "0.67545617", "0.6157952", "0.5923703", "0.5849991", "0.5803739", "0.57914233", "0.5790824", "0.5713735", "0.55374765", "0.54750603", "0.54729444", "0.5461906", "0.5449159", "0.54380345", "0.5423991", "0.54140425", "0.5406714", "0.5388676", "0.53626126", "0.53512734", "0.5298...
0.8216071
0
Testing {% definevar %} with spaceless option
def test_with_spaceless(self): t = Template('{% load djblets_utils %}' '{% definevar "myvar" spaceless %}\n' '<span>\n' ' <strong>\n' ' test{{num}}\n' ' </strong>\n' '</span>\n' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_strip(self):\n t = Template('{% load djblets_utils %}'\n '{% definevar \"myvar\" strip %}\\n'\n '<span>\\n'\n ' <strong>\\n'\n ' test{{num}}\\n'\n ' </strong>\\n'\n '</span>...
[ "0.7116686", "0.67886454", "0.67262304", "0.64860123", "0.6057726", "0.6020129", "0.59924453", "0.59869397", "0.5836771", "0.58309156", "0.57882994", "0.57387507", "0.5709727", "0.57092327", "0.56692076", "0.5519866", "0.5509027", "0.5428919", "0.53868854", "0.5332345", "0.52...
0.7949295
0
Testing {% definevar %} with unsafe option
def test_with_unsafe(self): t = Template('{% load djblets_utils %}' '{% definevar "myvar" unsafe %}<hello>{% enddefinevar %}' '{{myvar}}') self.assertEqual(t.render(Context()), '&lt;hello&gt;')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_strip(self):\n t = Template('{% load djblets_utils %}'\n '{% definevar \"myvar\" strip %}\\n'\n '<span>\\n'\n ' <strong>\\n'\n ' test{{num}}\\n'\n ' </strong>\\n'\n '</span>...
[ "0.64857894", "0.64418113", "0.61597216", "0.61581916", "0.59256214", "0.58586115", "0.58135176", "0.57546264", "0.5553935", "0.5450713", "0.54189855", "0.54012203", "0.5380707", "0.5361904", "0.5353325", "0.5328995", "0.532316", "0.52441657", "0.51985097", "0.5165681", "0.51...
0.81571186
0
Testing {{...|escapespaces}} with single space
def test_with_single_space(self): self.assertEqual(escapespaces('Hi there'), 'Hi there')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_spaceless(self):\n t = Template('{% load djblets_utils %}'\n '{% definevar \"myvar\" spaceless %}\\n'\n '<span>\\n'\n ' <strong>\\n'\n ' test{{num}}\\n'\n ' </strong>\\n'\n ...
[ "0.68032426", "0.67486656", "0.6638375", "0.62644416", "0.60793024", "0.6068157", "0.59095526", "0.5902652", "0.5900635", "0.5815562", "0.5795822", "0.577586", "0.5750066", "0.57357484", "0.5699933", "0.5664234", "0.56113553", "0.5590534", "0.5538899", "0.55047613", "0.545144...
0.70163834
0
Testing {{...|escapespaces}} with multiple consecutive spaces
def test_with_multiple_spaces(self): self.assertEqual(escapespaces('Hi there'), 'Hi&nbsp; there')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_single_space(self):\n self.assertEqual(escapespaces('Hi there'),\n 'Hi there')", "def test_with_spaceless(self):\n t = Template('{% load djblets_utils %}'\n '{% definevar \"myvar\" spaceless %}\\n'\n '<span>\\n'\n ...
[ "0.67469984", "0.6433338", "0.63909113", "0.61706376", "0.616987", "0.603858", "0.57823545", "0.5732287", "0.5717638", "0.55804926", "0.55595803", "0.5544655", "0.5468769", "0.5451948", "0.5430117", "0.5414154", "0.538847", "0.53717864", "0.5336291", "0.52358156", "0.5225007"...
0.6839661
0
Testing {{...|escapespaces}} with newline
def test_with_newline(self): self.assertEqual(escapespaces('Hi there\n'), 'Hi&nbsp; there<br />')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_newlines(self):\n self.assertValue({\n \"foo\": \"something\\nwith\\nnewlines\",\n },\n \"foo: something_with_newlines\\n\")", "def test_code(self):\n self.assertEquals(\"\\n\\tline1\\n\\tline2\",\n trans(\"{{{\\nline1\\nline2\\n}}}\"))", ...
[ "0.66250724", "0.6362418", "0.6012879", "0.5941337", "0.5929384", "0.5918962", "0.5874929", "0.5810262", "0.5764275", "0.5755598", "0.57518566", "0.57145613", "0.56923354", "0.5679629", "0.565067", "0.5621903", "0.55415255", "0.55312526", "0.55049425", "0.5420975", "0.5402391...
0.68857753
0
Testing {{...|humanize_list}} with empty list
def test_with_empty_list(self): self.assertEqual(humanize_list([]), '')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_1_item(self):\n self.assertEqual(humanize_list(['a']),\n 'a')", "def test_with_2_items(self):\n self.assertEqual(humanize_list(['a', 'b']),\n 'a and b')", "def test_with_4_items(self):\n self.assertEqual(humanize_list(['a', 'b',...
[ "0.7209216", "0.6821816", "0.6803753", "0.6747265", "0.60909104", "0.6047052", "0.5889234", "0.576699", "0.5730108", "0.5727563", "0.5638082", "0.5527138", "0.54196876", "0.5410036", "0.53933257", "0.53890765", "0.53756136", "0.5358281", "0.5352746", "0.5332928", "0.5312761",...
0.84898084
0
Testing {{...|humanize_list}} with 1 item
def test_with_1_item(self): self.assertEqual(humanize_list(['a']), 'a')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_4_items(self):\n self.assertEqual(humanize_list(['a', 'b', 'c', 'd']),\n 'a, b, c, and d')", "def test_with_2_items(self):\n self.assertEqual(humanize_list(['a', 'b']),\n 'a and b')", "def test_with_3_items(self):\n self.assertE...
[ "0.74867344", "0.7485351", "0.7454677", "0.6828147", "0.67824715", "0.6465609", "0.63791704", "0.58145946", "0.58145946", "0.58145946", "0.58145946", "0.5766288", "0.5729722", "0.572213", "0.57021636", "0.56853616", "0.56729215", "0.5652388", "0.5632467", "0.56143266", "0.555...
0.8221179
0
Testing {{...|humanize_list}} with 2 items
def test_with_2_items(self): self.assertEqual(humanize_list(['a', 'b']), 'a and b')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_1_item(self):\n self.assertEqual(humanize_list(['a']),\n 'a')", "def test_with_3_items(self):\n self.assertEqual(humanize_list(['a', 'b', 'c']),\n 'a, b and c')", "def test_with_4_items(self):\n self.assertEqual(humanize_list(['...
[ "0.7770209", "0.7701434", "0.7694392", "0.67632717", "0.65721804", "0.6350669", "0.63303834", "0.57339954", "0.5732924", "0.5719008", "0.5717518", "0.56404835", "0.56404835", "0.56404835", "0.56404835", "0.562351", "0.5592338", "0.5560638", "0.5533705", "0.5500018", "0.547888...
0.7984499
0
Testing {{...|humanize_list}} with 3 items
def test_with_3_items(self): self.assertEqual(humanize_list(['a', 'b', 'c']), 'a, b and c')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_4_items(self):\n self.assertEqual(humanize_list(['a', 'b', 'c', 'd']),\n 'a, b, c, and d')", "def test_with_1_item(self):\n self.assertEqual(humanize_list(['a']),\n 'a')", "def test_with_2_items(self):\n self.assertEqual(humaniz...
[ "0.7959641", "0.76548904", "0.7512626", "0.6840446", "0.6606152", "0.6386993", "0.6284902", "0.59038913", "0.5873438", "0.5778882", "0.57520056", "0.5720628", "0.56403565", "0.5628272", "0.561915", "0.561915", "0.561915", "0.561915", "0.5571809", "0.5539878", "0.55234474", ...
0.8175464
0
Testing {{...|humanize_list}} with 4 items
def test_with_4_items(self): self.assertEqual(humanize_list(['a', 'b', 'c', 'd']), 'a, b, c, and d')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_3_items(self):\n self.assertEqual(humanize_list(['a', 'b', 'c']),\n 'a, b and c')", "def test_with_1_item(self):\n self.assertEqual(humanize_list(['a']),\n 'a')", "def test_with_2_items(self):\n self.assertEqual(humanize_list(['...
[ "0.7818746", "0.75763154", "0.73760206", "0.6708089", "0.6705747", "0.63406163", "0.63235223", "0.59415454", "0.57278186", "0.56521595", "0.56213796", "0.5577789", "0.5576578", "0.5571174", "0.55692714", "0.55645466", "0.5553006", "0.5546997", "0.5542719", "0.554077", "0.5516...
0.8308927
0
Testing {% include_as_string %}
def test_basic_usage(self): t = Template('{% load djblets_utils %}' '{% include_as_string template_name %}') self.assertEqual( t.render(Context({ 'template_name': 'testing/foo.html', 'foo': 1, 'bar': 2, })), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def include_string(parser, token):\n\tbits = token.split_contents()\n\tif len(bits) != 2:\n\t\traise TemplateSyntaxError(\"%r tag takes one argument: the template string to be included\" % bits[0])\n \tstring = parser.compile_filter(bits[1])\n\treturn IncludeStringNode(string)", "def test_includes(self):\n ...
[ "0.72237074", "0.7058335", "0.6938502", "0.69019485", "0.6657269", "0.66082406", "0.6418754", "0.623286", "0.620674", "0.5977595", "0.5906052", "0.5865723", "0.58279705", "0.5799238", "0.5733636", "0.57208425", "0.57152575", "0.5704218", "0.5651656", "0.5632499", "0.56095517"...
0.7729179
0
Testing {{...|indent}} with default indentation level
def test_with_default_indent(self): self.assertEqual(indent('foo'), ' foo')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_custom_indent(self):\n self.assertEqual(indent('foo', 3), ' foo')", "def test_adjust_indent():\n hr.Element.indent = 2\n\n body = hr.Body()\n body.append(hr.P(\"some text\"))\n html = hr.Html(body)\n\n file_contents = render_result(html)\n\n print(file_contents)\n line...
[ "0.778307", "0.65845025", "0.64145744", "0.640567", "0.6320119", "0.6283757", "0.6254726", "0.62319493", "0.61933684", "0.6110476", "0.6092362", "0.60786456", "0.60786456", "0.60785407", "0.6023838", "0.59295094", "0.5891613", "0.58672994", "0.58418995", "0.5767337", "0.57017...
0.76486266
1
Testing {{...|indent}} with custom indentation level
def test_with_custom_indent(self): self.assertEqual(indent('foo', 3), ' foo')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_default_indent(self):\n self.assertEqual(indent('foo'), ' foo')", "def test_adjust_indent():\n hr.Element.indent = 2\n\n body = hr.Body()\n body.append(hr.P(\"some text\"))\n html = hr.Html(body)\n\n file_contents = render_result(html)\n\n print(file_contents)\n lines...
[ "0.7285234", "0.68716925", "0.6601827", "0.6521513", "0.6454053", "0.6436792", "0.637126", "0.634604", "0.62667", "0.625941", "0.6186124", "0.61533314", "0.6131626", "0.6043399", "0.6043399", "0.602634", "0.59728074", "0.5963381", "0.59593403", "0.5902826", "0.58931136", "0...
0.7920645
0
Testing {{...|indent}} with multiple lines
def test_with_multiple_lines(self): self.assertEqual(indent('foo\nbar'), ' foo\n bar')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_custom_indent(self):\n self.assertEqual(indent('foo', 3), ' foo')", "def test_multiple_indent():\n body = hr.Body()\n body.append(hr.P(\"some text\"))\n html = hr.Html(body)\n\n file_contents = render_result(html)\n\n print(file_contents)\n lines = file_contents.split(\"\...
[ "0.735322", "0.7073774", "0.69509804", "0.6840931", "0.68078333", "0.68071306", "0.67973256", "0.67146814", "0.66842926", "0.64460665", "0.63834816", "0.6257567", "0.6255706", "0.6243714", "0.6222274", "0.61781883", "0.6087206", "0.6076181", "0.60641384", "0.605803", "0.60136...
0.7795303
0
Testing {% querystring "update" %} basic usage
def test_update_basic_usage(self): self.assertEqual( self._render_tag(tag='{% querystring "update" "foo=bar" %}', query_str='foo=bar'), '?foo=bar')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_with_querystring_key_overide(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"update\" \"a=1\" \"a=2\" %}',\n query_str='foo=foo')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(QueryDict(rendered_result[1:]),\n...
[ "0.8160826", "0.81003916", "0.78848255", "0.781702", "0.7786558", "0.77261317", "0.7715116", "0.7595097", "0.7405113", "0.63803375", "0.6078759", "0.59671193", "0.5962284", "0.59361494", "0.59328645", "0.5919303", "0.5906413", "0.59014446", "0.58933955", "0.5768803", "0.57684...
0.84873694
0
Testing {% querystring "update" %} with an existing query that gets overridden
def test_update_with_existing_query_override(self): rendered_result = self._render_tag( tag='{% querystring "update" "foo=bar" %}', query_str='foo=foo&bar=baz') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(QueryDict(rendered_result[1:]), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_with_existing_query_with_two_args_override(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"update\" \"foo=bar\" \"qux=baz\" %}',\n query_str='foo=foo&bar=bar&baz=baz&qux=qux')\n\n self.assertTrue(rendered_result.startswith('?'))\n self...
[ "0.82285905", "0.8130441", "0.80727655", "0.79774666", "0.78701615", "0.7824038", "0.7694648", "0.74788016", "0.72497344", "0.6282942", "0.6119359", "0.60488284", "0.6003275", "0.60010093", "0.5985671", "0.59831214", "0.5979202", "0.59778893", "0.59083915", "0.5906219", "0.58...
0.88072
0
Testing {% querystring "update" %} with two args that get overridden
def test_update_with_existing_query_with_two_args_override(self): rendered_result = self._render_tag( tag='{% querystring "update" "foo=bar" "qux=baz" %}', query_str='foo=foo&bar=bar&baz=baz&qux=qux') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(Quer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_with_existing_query_override(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"update\" \"foo=bar\" %}',\n query_str='foo=foo&bar=baz')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(QueryDict(rendered_result[1:]...
[ "0.8393917", "0.81698006", "0.8157803", "0.7903674", "0.7751201", "0.772445", "0.76976013", "0.7611009", "0.7605545", "0.6213056", "0.6131876", "0.6074763", "0.6017298", "0.59298253", "0.5928301", "0.58698416", "0.58698416", "0.58597875", "0.5797873", "0.57940143", "0.578386"...
0.8527788
0
Testing {% querystring "update" %} with no value
def test_update_with_no_value(self): rendered_result = self._render_tag( tag='{% querystring "update" "foo" %}', query_str='') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(QueryDict(rendered_result[1:]), QueryDict('foo='))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_with_no_key(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"update\" \"=foo\" %}',\n query_str='')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(QueryDict(rendered_result[1:]), QueryDict('=foo'))", "def test...
[ "0.83778876", "0.8344275", "0.79929906", "0.7838386", "0.77645916", "0.75217503", "0.7430781", "0.7206279", "0.6957165", "0.63444877", "0.61944747", "0.6171176", "0.6119739", "0.59485555", "0.5840339", "0.58194894", "0.5763195", "0.5723799", "0.5700123", "0.5652544", "0.56483...
0.8507903
0
Testing {% querystring "update" %} with multiple values
def test_update_with_multiple_values(self): rendered_result = self._render_tag( tag='{% querystring "update" "foo=bar=baz" %}', query_str='foo=foo') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(QueryDict(rendered_result[1:]), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_with_updating_multiple_values_of_a_key(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"update\" \"a=1&a=2\" %}',\n query_str='foo=foo')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(QueryDict(rendered_result[1:]),\n ...
[ "0.83192694", "0.8115465", "0.7924868", "0.7861795", "0.7820674", "0.75683415", "0.74704516", "0.74522585", "0.7427821", "0.6365287", "0.62719387", "0.6235126", "0.6219152", "0.6127101", "0.6050058", "0.6045493", "0.6045493", "0.6033712", "0.59621257", "0.5841878", "0.5827072...
0.8562762
0
Testing {% querystring "update" %} with empty value
def test_update_with_empty_value(self): rendered_result = self._render_tag( tag='{% querystring "update" "foo=" %}', query_str='') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(QueryDict(rendered_result[1:]), QueryDict('foo='))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_with_no_value(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"update\" \"foo\" %}',\n query_str='')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(QueryDict(rendered_result[1:]), QueryDict('foo='))", "def tes...
[ "0.85938555", "0.8381606", "0.7849045", "0.760292", "0.7579912", "0.73541963", "0.7286511", "0.7055417", "0.67807907", "0.6305068", "0.62017447", "0.61609757", "0.6049829", "0.587832", "0.57909924", "0.57764435", "0.5737658", "0.57255924", "0.5694696", "0.5607382", "0.5581019...
0.86261064
0
Testing {% querystring "update" %} with no key
def test_update_with_no_key(self): rendered_result = self._render_tag( tag='{% querystring "update" "=foo" %}', query_str='') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(QueryDict(rendered_result[1:]), QueryDict('=foo'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_with_no_value(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"update\" \"foo\" %}',\n query_str='')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(QueryDict(rendered_result[1:]), QueryDict('foo='))", "def tes...
[ "0.83767027", "0.8260205", "0.8205793", "0.8035107", "0.7845689", "0.7674357", "0.7564186", "0.7472058", "0.73783904", "0.6436952", "0.63122505", "0.6225137", "0.61859393", "0.612663", "0.6009522", "0.5991379", "0.5983234", "0.5963799", "0.5881154", "0.5877678", "0.58691776",...
0.8736628
0
Testing {% querystring "update" %} by updating multiple values of a key value
def test_with_updating_multiple_values_of_a_key(self): rendered_result = self._render_tag( tag='{% querystring "update" "a=1&a=2" %}', query_str='foo=foo') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(QueryDict(rendered_result[1:]), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_with_multiple_values(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"update\" \"foo=bar=baz\" %}',\n query_str='foo=foo')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(QueryDict(rendered_result[1:]),\n ...
[ "0.84186804", "0.810681", "0.7557398", "0.7449745", "0.7355413", "0.7349155", "0.7247374", "0.7078936", "0.705895", "0.66061294", "0.64534163", "0.6402692", "0.6355075", "0.6283492", "0.6176012", "0.61271197", "0.5983697", "0.5941984", "0.59279925", "0.59279925", "0.5825642",...
0.8602916
0
Testing {% querystring "append" %} with appending multiple values of a key
def test_append_with_multiple_values_and_same_key(self): rendered_result = self._render_tag( tag='{% querystring "append" "a=1&a=2&a=3" %}', query_str='a=0&&b=2&c=3') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(QueryDict(rendered_result[1:]), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_append_with_multiple_values_and_same_key_seperated(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"append\" \"a=1\" \"a=2\" \"a=3\" %}',\n query_str='a=0&&b=2&c=3')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(Query...
[ "0.8498463", "0.8341243", "0.76318073", "0.6942017", "0.6838789", "0.6705557", "0.65282977", "0.6202453", "0.6140832", "0.611182", "0.60828626", "0.59720445", "0.5939296", "0.5853891", "0.58489376", "0.58000696", "0.58000696", "0.56923723", "0.56226695", "0.5602836", "0.55750...
0.85816944
0
Testing {% querystring "append" %} with appending multiple values of a key fragment
def test_append_with_multiple_values_and_same_key_seperated(self): rendered_result = self._render_tag( tag='{% querystring "append" "a=1" "a=2" "a=3" %}', query_str='a=0&&b=2&c=3') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(QueryDict(rendered_resul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_append_with_multiple_values_and_same_key(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"append\" \"a=1&a=2&a=3\" %}',\n query_str='a=0&&b=2&c=3')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(QueryDict(rendered_resu...
[ "0.86375725", "0.84450185", "0.781504", "0.68740207", "0.67290455", "0.66967934", "0.6629074", "0.62867236", "0.6149132", "0.61116165", "0.6078402", "0.6041519", "0.59463435", "0.5895472", "0.5895472", "0.58687717", "0.5769661", "0.5714091", "0.5696046", "0.56622285", "0.5643...
0.8574146
1
Testing {% querystring "append" %} with appending new keyvalue pair
def test_append_with_new_key(self): rendered_result = self._render_tag( tag='{% querystring "append" "d=4" %}', query_str='a=1&b=2&c=3') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(QueryDict(rendered_result[1:]), QueryDict('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_append_with_multiple_values_and_same_key(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"append\" \"a=1&a=2&a=3\" %}',\n query_str='a=0&&b=2&c=3')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(QueryDict(rendered_resu...
[ "0.8260465", "0.81529766", "0.8100246", "0.7122451", "0.70814383", "0.68417764", "0.65832335", "0.632912", "0.6328968", "0.63135624", "0.62243444", "0.6187808", "0.6101339", "0.6048709", "0.6048709", "0.5992231", "0.59557575", "0.59342337", "0.59126395", "0.5843746", "0.58304...
0.87845033
0
Testing {% querystring "remove" %} by attempting to remove a nonexisting key
def test_remove_with_key_not_in_querystring(self): rendered_result = self._render_tag( tag='{% querystring "remove" "baz" %}', query_str='foo=foo&bar=bar') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(QueryDict(rendered_result[1:]), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_with_no_key(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"remove\" \"=foo\" %}',\n query_str='foo=foo&foo=bar&baz=baz&=foo')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(QueryDict(rendered_result[1:]),\n ...
[ "0.84152013", "0.80939305", "0.79133326", "0.79089874", "0.7750738", "0.7373129", "0.7191346", "0.6528528", "0.6507897", "0.6199616", "0.61719894", "0.6120845", "0.6088209", "0.6058557", "0.60254574", "0.6016976", "0.5947428", "0.5919038", "0.58856094", "0.5815144", "0.577812...
0.83562726
1
Testing {% querystring "remove" %} by removing all instances of a key
def test_remove_with_key_appearing_multiple_times(self): rendered_result = self._render_tag( tag='{% querystring "remove" "foo" %}', query_str='foo=foo&foo=bar&bar=bar') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(QueryDict(rendered_result[1:]), Que...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_with_no_key(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"remove\" \"=foo\" %}',\n query_str='foo=foo&foo=bar&baz=baz&=foo')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(QueryDict(rendered_result[1:]),\n ...
[ "0.85173905", "0.8459718", "0.8431988", "0.80031836", "0.7982969", "0.7942104", "0.7938666", "0.67572826", "0.6434704", "0.63995194", "0.62388736", "0.62070173", "0.6081511", "0.6012274", "0.5948167", "0.5887117", "0.586309", "0.58515227", "0.583285", "0.579642", "0.57885164"...
0.85131925
1
Testing {% querystring "remove" %} by removing a specific keyvalue pair
def test_remove_for_specific_key_value_pairs(self): rendered_result = self._render_tag( tag='{% querystring "remove" "a=4" %}', query_str='a=1&a=2&a=3&a=4') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(QueryDict(rendered_result[1:]), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_with_key_not_in_querystring(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"remove\" \"baz\" %}',\n query_str='foo=foo&bar=bar')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(QueryDict(rendered_result[1:]),\n ...
[ "0.86211497", "0.86141086", "0.8397185", "0.8291769", "0.8162063", "0.81378734", "0.79093105", "0.65594715", "0.6130791", "0.60870177", "0.5993961", "0.56719804", "0.56274676", "0.5627308", "0.56103635", "0.56000274", "0.5595212", "0.5594768", "0.5589343", "0.55880225", "0.55...
0.8716594
0
Testing {% querystring "remove" %} by removing a value with no key
def test_remove_with_no_key(self): rendered_result = self._render_tag( tag='{% querystring "remove" "=foo" %}', query_str='foo=foo&foo=bar&baz=baz&=foo') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(QueryDict(rendered_result[1:]), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_with_no_value(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"remove\" \"foo=\" %}',\n query_str='foo=foo&foo=bar&foo=&baz=baz')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(QueryDict(rendered_result[1:]), Qu...
[ "0.8768574", "0.8608548", "0.85124594", "0.8144512", "0.80228597", "0.8015881", "0.7719858", "0.6615589", "0.64976746", "0.64727014", "0.6124275", "0.6086564", "0.5976051", "0.58541024", "0.56783885", "0.5660003", "0.5650449", "0.5639908", "0.5620342", "0.55923486", "0.555478...
0.8808378
0
Testing {% querystring "remove" %} by removing multiple specific keyvalue pairs
def test_remove_with_multiple_specific_values(self): rendered_result = self._render_tag( tag='{% querystring "remove" "foo=1" "foo=2" %}', query_str='foo=1&foo=2&foo=3') self.assertTrue(rendered_result.startswith('?')) self.assertEqual(QueryDict(rendered_result[1:]), Que...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_remove_for_specific_key_value_pairs(self):\n rendered_result = self._render_tag(\n tag='{% querystring \"remove\" \"a=4\" %}',\n query_str='a=1&a=2&a=3&a=4')\n\n self.assertTrue(rendered_result.startswith('?'))\n self.assertEqual(QueryDict(rendered_result[1:]),\n...
[ "0.8700103", "0.86342984", "0.84553623", "0.83464617", "0.8266275", "0.8107934", "0.80839235", "0.6472443", "0.6022613", "0.59204817", "0.5677038", "0.5628828", "0.562024", "0.5582078", "0.5559137", "0.55267173", "0.5524983", "0.55198497", "0.55075717", "0.55037594", "0.55020...
0.8674158
1
Returned a rendered template tag using a query string. This will render a ``querystring`` template using the provided template tag, with autoescaping turned off, and with the given query string as would be provided in a URL.
def _render_tag(self, tag, query_str): t = Template('{%% load djblets_utils %%}' '{%% autoescape off %%}%s{%% endautoescape %%}' % tag) request = HttpRequest() if query_str: request.GET = QueryDict(query_str) return t.render(Contex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template_string(template, **kwargs):\n\n temp = Template(template)\n return temp.render(**kwargs)", "def render_str(self, template, **params):\n return render_str(template, **params)", "def querystring(parser, token):\r\n bits = token.split_contents()\r\n tag = bits.pop(0)\r\n updates...
[ "0.5957292", "0.58817935", "0.57983536", "0.5778623", "0.57117337", "0.5596593", "0.55515957", "0.55368096", "0.5526971", "0.54989415", "0.54698455", "0.54629296", "0.5458646", "0.53809476", "0.5372585", "0.536746", "0.53206545", "0.5303815", "0.5260162", "0.5234884", "0.5216...
0.78619885
0
Return a filter key and value if exact filter exists for name.
def get_exact_filter_by_name(self, name): for entry in self.filters: if (entry['type'] == 'filter' and entry['name'] == name and entry['comparator'] == 'equals'): return entry
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_filter(name):\n try:\n return FILTERS[name.upper()]\n except:\n msg = 'Unknown model of filter {}, options are {}'\n raise ValueError(msg.format(name, list(FILTERS.keys())))", "def manifest_filter(self, name):\n if not name:\n return self._data.index\n ...
[ "0.62365323", "0.61823237", "0.61162287", "0.61162287", "0.61162287", "0.61068785", "0.56777346", "0.55669785", "0.55378616", "0.553224", "0.55188286", "0.55173266", "0.5495687", "0.54905736", "0.54889935", "0.5462702", "0.5452204", "0.53600377", "0.5333365", "0.52472883", "0...
0.7875014
0
Set a limit to indicate the list should be truncated.
def set_limit(self, limit, truncated=False): self.limit = {'limit': limit, 'type': 'limit', 'truncated': truncated}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_limit(self, limit):\n self.limit = limit\n self._prune()", "def limit(self, limit):\n self._limit = limit", "def limit(self, limit):\n raise NotImplementedError(\"This should have been implemented.\")", "def limit(self, limit):\n\n self._limit = limit", "def limit...
[ "0.75690305", "0.74136245", "0.7268453", "0.7227085", "0.7227085", "0.7227085", "0.7150918", "0.7135207", "0.70293975", "0.701623", "0.6900221", "0.68999344", "0.6751625", "0.6742927", "0.6742424", "0.66420597", "0.6582306", "0.64915013", "0.6447758", "0.6411383", "0.6300985"...
0.79677534
0
Builds and returns a QueryStrategy using a feature extractor and a base_df
def build_query_strategy(sent_df, col_names): # type: (DataFrame, ColumnNames) -> QueryStrategy init_extractor = SynStateALHeuristic.build_feature_extractor(sent_df, col_names) combined_features = init_extractor.transform(sent_df, col_names) return HintSVM(TextDataset(sent_df, col_names,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_query_strategy(utility_measure: Callable, selector: Callable) -> Callable:\n def query_strategy(classifier: BaseEstimator, X: modALinput) -> Tuple:\n utility = utility_measure(classifier, X)\n query_idx = selector(utility)\n return query_idx, X[query_idx]\n\n return query_strate...
[ "0.5952889", "0.5775487", "0.55588496", "0.529119", "0.5259821", "0.5202929", "0.51925635", "0.5178014", "0.5163325", "0.5140859", "0.5063282", "0.50391376", "0.5026559", "0.49773774", "0.49665532", "0.49620157", "0.49497977", "0.49446902", "0.49109635", "0.4886161", "0.48770...
0.6853019
0
Parse a list of MAVEHGVS strings into Variant objects or error messages.
def parse_variant_strings( variants: Iterable[str], targetseq: Optional[str] = None, expected_prefix: Optional[str] = None, ) -> Tuple[List[Optional[Variant]], List[Optional[str]]]: if expected_prefix is not None and expected_prefix not in list("cgmnopr"): raise ValueError("invalid expected pref...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_values(self):\n self.assertEqual(\"test\", grammar._VALUE.parseString(\"test\")[0])\n self.assertEqual(\"test(*)\", grammar._VALUE.parseString(\"test(*)\")[0])\n self.assertEqual(\"test(123)\", grammar._VALUE.parseString(\"test(123)\")[0])\n self.assertEqual(\"123\", grammar._V...
[ "0.55300385", "0.54785925", "0.5428499", "0.54011434", "0.53826064", "0.5340443", "0.5202114", "0.5156769", "0.51507455", "0.5124695", "0.5124507", "0.5102875", "0.5073347", "0.5016438", "0.49852303", "0.49693668", "0.4961004", "0.49565905", "0.495055", "0.49437034", "0.49418...
0.6759886
0
Generate a batch of binary masks for data.
def _generate_masks(self, data, batch_size): height, width = data.shape[2], data.shape[3] mask_size = (self._down_sample_size, self._down_sample_size) up_size = (height + mask_size[0], width + mask_size[1]) mask = np.random.random((batch_size, 1) + mask_size) < self._mask_probability ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bits():\n for d in data:\n for i in [5, 4, 3, 2, 1, 0]:\n yield (d >> i) & 1", "def test_get_mask(self):\n\n spine_data_loader = SpineDataLoader(dirpath_data=self.dirpath,\n batch_size=4)\n\n for idx in range(4):\n ...
[ "0.65286094", "0.64621294", "0.63746774", "0.62852716", "0.6263692", "0.6249675", "0.6237803", "0.62282276", "0.6218766", "0.62182695", "0.6199647", "0.6149319", "0.6104692", "0.6101146", "0.60662824", "0.6061052", "0.60520583", "0.6050134", "0.6042464", "0.60416996", "0.6024...
0.7697249
0
To unify targets to be 2D numpy.ndarray.
def _unify_targets(inputs, targets): if isinstance(targets, int): return np.array([[targets] for _ in inputs]).astype(np.int) if isinstance(targets, Tensor): if not targets.shape: return np.array([[targets.asnumpy()] for _ in inputs]).astype(np.int) if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def targets(self) -> Optional[jnp.ndarray]:\n pass", "def target_array(self):\n target_dtype = np.dtype([('targetID', np.int64),\n ('x', np.float64),\n ('y', np.float64),\n ('z', np.float64),\n ...
[ "0.6756555", "0.61209065", "0.6060304", "0.60284156", "0.6013608", "0.596247", "0.58169913", "0.58032334", "0.5798457", "0.5793701", "0.5786053", "0.57662976", "0.5763996", "0.5749886", "0.570804", "0.57043284", "0.56917435", "0.56873614", "0.56873614", "0.56604946", "0.56528...
0.6536828
1
Compiles a message that can be posted to Slack after a call has been made
def compile_slack_phone_message(phone_from, phone_to, status, location): call_from_user = _query_user(phone_from) call_from = _format_caller(call_from_user, phone_from) call_to_user = _query_user(phone_to) call_to = _format_caller(call_to_user, phone_to) location_str = list(filter(lambda x: x[0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_message(ctx, question, answer):\n return preamble.format(channel=rules_channel(ctx).id) + question + answer", "def message(**payload):\n web_client = payload[\"web_client\"]\n\n # Getting information from the response\n data = payload[\"data\"]\n channel_id = data.get(\"channel\")\n ...
[ "0.6430378", "0.61646515", "0.61048555", "0.6087194", "0.60472983", "0.6007284", "0.6002899", "0.5978185", "0.5974844", "0.5949206", "0.59122825", "0.57997376", "0.57194704", "0.5707758", "0.56715614", "0.5656784", "0.5643831", "0.5628419", "0.56189126", "0.5614972", "0.55933...
0.6493337
0
Compile a message that can be posted to Slack after a SMS has been received
def compile_slack_sms_message(_sms_from, message): sms_from_user = _query_user(_sms_from) sms_from = _format_caller(sms_from_user, _sms_from) pretext = "Nytt SMS från %s" % (sms_from, ) fallback = "%s \n\"%s\"" % (pretext, message) return { 'attachments': [ { 'p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compile_slack_phone_message(phone_from, phone_to, status, location):\n\n call_from_user = _query_user(phone_from)\n call_from = _format_caller(call_from_user, phone_from)\n\n call_to_user = _query_user(phone_to)\n call_to = _format_caller(call_to_user, phone_to)\n\n location_str = list(filter(la...
[ "0.67178714", "0.6370651", "0.6323726", "0.63050747", "0.6260869", "0.62185776", "0.619205", "0.6175053", "0.6171278", "0.6103282", "0.6072457", "0.60609436", "0.60509944", "0.60441846", "0.60350686", "0.6020911", "0.6018892", "0.5999021", "0.5975836", "0.59454054", "0.593202...
0.71974516
0
Retrieves first name, last name and groups corresponding to a phone number from the database, if it exists. If multiple users have the same number, none will be queried
def _query_user(phone): if not is_valid_phone_number(phone): return None try: user = Profile.objects.get(mobile_phone=_remove_area_code(phone)).user return { 'first_name': user.first_name, 'last_name': user.last_name, 'groups': [group.name if group.n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user(conn ,phone_number: str) -> Tuple[str, List[str], str]:\n with conn.cursor() as cur:\n\n # Get user info from db.\n cur.execute(\"SELECT * FROM users WHERE phone_number = %s\", (phone_number,))\n usr = cur.fetchone()\n if usr is None:\n return None\n re...
[ "0.6712627", "0.6684366", "0.6540897", "0.6530467", "0.64618504", "0.64562565", "0.6306256", "0.62955487", "0.6291792", "0.62606305", "0.6074895", "0.6006919", "0.5898004", "0.57387257", "0.5648351", "0.5647391", "0.5595597", "0.5593799", "0.55526763", "0.549593", "0.5446735"...
0.75981003
0
Formats caller information into a readable string
def _format_caller(call_user, phone): # The phone number is private or not provided if not phone: return 'dolt nummer' if is_valid_phone_number(phone): # Set the phone number as a clickable link caller = '<tel:%s|%s>' % (phone, phone) else: caller = phone if call_us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _print_caller(self):\n import traceback\n print '\\n'.join(['%s:%d %s'%(f,l,c) for f,l,m,c in traceback.extract_stack()])", "def format_call(func, args, kwargs, object_name=\"Memory\"):\r\n path, signature = format_signature(func, *args, **kwargs)\r\n msg = '%s\\n[%s] Calling %s...\\n%s' ...
[ "0.7178175", "0.6633771", "0.6473987", "0.6436923", "0.63126194", "0.6247994", "0.616689", "0.61521333", "0.6140672", "0.6119034", "0.60761124", "0.6044592", "0.60336864", "0.6026234", "0.5985547", "0.5975166", "0.594615", "0.5940507", "0.59292597", "0.59132135", "0.5875647",...
0.739633
0
Removes the area code (+46) from the given phone number and replaces it with 0
def _remove_area_code(phone): if not phone.startswith('+46'): return phone else: return '0' + phone[3:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_phone(number):\n numberlist = re.findall(\"\\d\",number)\n new_number = \"\".join(numberlist)\n if len(new_number) == 8:\n \tnew_number = \"010\" + new_number\n\tnew_number = new_number[-11:]\n\tif new_number.startswith('1'):\n\t\tnew_number = \"+86-\" + new_number\n\telse:\n\t\tnew_number = ...
[ "0.7460669", "0.72332627", "0.69025934", "0.6782024", "0.67445296", "0.65414447", "0.6436624", "0.64058983", "0.63791174", "0.6344951", "0.6307682", "0.62712353", "0.62262017", "0.6223244", "0.61936754", "0.618883", "0.61685634", "0.61436635", "0.61339825", "0.6082766", "0.60...
0.87382734
0
als het regtype wijzigt moeten ook de naam ervan, de player, de editor en het filepad en de url aangepast worden (door het item op te halen)
def type(self, value): self._type_id = value data = RegType(value) self.regtype = data.typenaam ## self.player = data.playernaam ## self.editor = data.readernaam self.pad = os.path.join(data.padnaam, self._file) self.url = '/'.join((data.htmlpadnaam, self._...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_ur_choose_ok_btn_clicked(self):\n ur_type = self.ur_choose_box.currentText()\n self.ur.set_UR_ROBOT(ur_type)\n self.set_ur_info_txt(\"set UR type: \" + ur_type )", "def add_player(self):\n title = \"Bienvenue dans le gestionnaire de tournois d'échec.\\nAjout d'un joueur\"\n ...
[ "0.5468898", "0.5372713", "0.5341861", "0.5332574", "0.5239701", "0.5222167", "0.51035255", "0.50887513", "0.5044618", "0.49934238", "0.49651843", "0.49612513", "0.4917673", "0.48918155", "0.48897576", "0.48815265", "0.48449853", "0.48328492", "0.48286667", "0.48030823", "0.4...
0.65343946
0
als het songid wijzigt moet ook de titel aangepast worden (door de song te raadplegen)
def song(self, value): self._song_id = value data = Song(value) self.songtitel = data.songtitel if data.found else ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_title():", "def media_title(self):\n return self.coordinator.data.nowplaying[self.zone.SourceID].CurrSong.Title", "def construct_metadata(song):\n print(song) #temp", "def tv_tropes_id(title):\n pass", "def get_title_by_id(id):\n\n # your code", "def get_title_song(mess_chat_id):\...
[ "0.666082", "0.64697766", "0.6342941", "0.63207954", "0.62568146", "0.6199513", "0.618698", "0.6174337", "0.61728776", "0.61343974", "0.6076811", "0.60717183", "0.6051481", "0.6007897", "0.5971578", "0.59425765", "0.5912056", "0.58918613", "0.58918613", "0.58787864", "0.58745...
0.70082396
0
Import the `datafile` Excel sheet to a CSV representation stored within the database that can be further processed without large filesystem operations. This also stores the original file's hash in order to skip importing unchanged data. Returns boolean (whether file was imported).
def import_datafile(db, infile): res = stat(infile) mtime = datetime.utcfromtimestamp(res.st_mtime) hash = md5hash(infile) data_file = db.model.data_file # Should maybe make sure error is not set rec = db.get(data_file, hash) # We are done if we've already imported if rec is not None:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_data_from_file(self, filename):\n self.get_cursor()\n ct = len([True for c in self.table.columns if c[1][0][:3] == \"ct-\"]) != 0\n if (([self.table.cleanup.function, self.table.delimiter,\n self.table.header_rows] == [no_cleanup, \",\", 1])\n and not self.ta...
[ "0.55844575", "0.54056644", "0.53893214", "0.53867716", "0.5307293", "0.5246726", "0.5222508", "0.5163896", "0.5116722", "0.509766", "0.509731", "0.5044055", "0.5019669", "0.4979874", "0.49676162", "0.49665996", "0.4965659", "0.49415362", "0.49070588", "0.487215", "0.48677886...
0.6357831
0
Decorator for class functions to catch errors and display a dialog box for a success or error. Checks if method is a bound method in order to properly handle parents for dialog box.
def errorCheck(success_text=None, error_text="Error!",logging=True,show_traceback=False,skip=False): def decorator(func): @functools.wraps(func) def wrapper(*args, **kwargs): if inspect.ismethod(func): self = args[0] else: self = None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_handler(call_on_errors):\n assert callable(call_on_errors)\n def entangle(method):\n @functools.wraps(method)\n def wrapper(self, *args, **kwargs):\n try:\n return method(self, *args, **kwargs)\n except InputInvalidException:\n retur...
[ "0.60215515", "0.5855564", "0.58513117", "0.5837953", "0.57659924", "0.5627547", "0.5543959", "0.5534907", "0.5445549", "0.54414475", "0.5429948", "0.53747135", "0.53649336", "0.53635114", "0.53361785", "0.53337044", "0.5322622", "0.53081447", "0.52866286", "0.51993626", "0.5...
0.61921567
0
Normalize weight vector. Negative weights set to zero, and whole vector sums to 1.0.
def normalize_weights(self): # Set negative weights to zero # Normalize to sum to one. self.new_weight=[] for i in self._weights: if any(i < 0 for i in self._weights): self.new_weight = [0,1] elif all(i == 0 for i in self._weig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_weights(self):\n total_weight = sum(self.weights)\n self.norm_weights = self.weights / float(total_weight)", "def normalize(self, weights):\n tot = sum(weights)\n newW = [-1] * self.numParticles\n for i in range(len(weights)):\n newW[i] = weights[i] / t...
[ "0.81079364", "0.789293", "0.7727452", "0.77199495", "0.76464504", "0.7522993", "0.7492114", "0.74709684", "0.7452147", "0.74076146", "0.73972994", "0.7382311", "0.72835106", "0.7223835", "0.72054964", "0.71810776", "0.7152016", "0.7151621", "0.71274734", "0.7124058", "0.7097...
0.8004195
1
Returns the path where the .NET2 Framework SDK is installed
def _getNETSDKPath(): try: dotNETSDK_root_key = win32api.RegOpenKeyEx(win32con.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Microsoft SDKs\\.NETFramework\\v2.0', 0, win32con.KEY_READ) found = False i = 0 try: try: while not found: name, obj, ntype = win32api.RegEnumValue(d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_windows_sdk_path():\n try:\n import _winreg as winreg\n except ImportError:\n import winreg\n sub_key = r\"Software\\Microsoft\\Microsoft SDKs\\Windows\"\n with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, sub_key) as key:\n name = \"CurrentInstallFolder\"\n return winr...
[ "0.6635156", "0.6456769", "0.62163496", "0.614617", "0.602612", "0.5883742", "0.5740016", "0.5641935", "0.5618597", "0.5578395", "0.556722", "0.55422294", "0.5538291", "0.5534905", "0.5458584", "0.54463655", "0.5429792", "0.538674", "0.53390664", "0.53347325", "0.5324747", ...
0.7449213
0
Add Builders and construction variables for tlbimp to an Environment.
def generate(env): if not exists(env): return 0; TLBImpBuilder = env.Builder( action = SCons.Action.Action( TLBImpGenerator , generator = 1 #, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetupEnvironment(self):\n pass", "def initialize():\n environment = Environment()\n environment.setup()", "def _setup_environment_vars(self, opts):\n # Check that these directories actually exist\n assert os.path.isdir(opts.movie_advisor_home)\n\n #if not 'install-bento' in se...
[ "0.5895225", "0.558601", "0.55457306", "0.5461047", "0.54333425", "0.54333425", "0.53935885", "0.53727806", "0.53727806", "0.53727806", "0.53727806", "0.53727806", "0.53727806", "0.53605133", "0.5341112", "0.5335485", "0.53309304", "0.52924156", "0.5265965", "0.5261049", "0.5...
0.69298697
0
Compare two categorical histograms and return a overlap score based on RMSE b1 bin edges of hist 1 b2 bin edges of hist 2 h1 histogram values of hist 1 h2 histogram values of hist 2 Return rmsebased overlap score
def _compare_cat_hist(b1, b2, h1, h2): cbe = list(set(b1) | set(b2)) total = len(cbe) rmse = 0.0 if sum(h1) == 0 or sum(h2) == 0: return 0.0 for index in range(total): sh1 = 0.0 sh2 = 0.0 try: sh1 = float(h1[b1.index(cbe[index])]) except Excepti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compare_cont_hist(b1, b2, h1, h2):\n\n b1 = copy.deepcopy(b1)\n h1 = copy.deepcopy(h1)\n b2 = copy.deepcopy(b2)\n h2 = copy.deepcopy(h2)\n\n bd1 = [float(x) for x in b1]\n bd2 = [float(x) for x in b2]\n\n inf = float('inf')\n\n if bd1[0] == -inf:\n del bd1[0]\n del h1[0]\...
[ "0.6879068", "0.61870795", "0.6087511", "0.60521746", "0.60158235", "0.59968966", "0.59831977", "0.5939749", "0.5920067", "0.5869332", "0.57640076", "0.5714345", "0.568633", "0.56607807", "0.56391025", "0.5636864", "0.56339514", "0.56069434", "0.56041086", "0.5590879", "0.552...
0.75110346
0
Compare two continuous histograms and return a overlap score based on RMSE b1 bin edges of hist 1 b2 bin edges of hist 2 h1 histogram values of hist 1 h2 histogram values of hist 2 Return rmsebased overlap score
def _compare_cont_hist(b1, b2, h1, h2): b1 = copy.deepcopy(b1) h1 = copy.deepcopy(h1) b2 = copy.deepcopy(b2) h2 = copy.deepcopy(h2) bd1 = [float(x) for x in b1] bd2 = [float(x) for x in b2] inf = float('inf') if bd1[0] == -inf: del bd1[0] del h1[0] if bd1[-1] == i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compare_cat_hist(b1, b2, h1, h2):\n cbe = list(set(b1) | set(b2))\n\n total = len(cbe)\n rmse = 0.0\n\n if sum(h1) == 0 or sum(h2) == 0:\n return 0.0\n\n for index in range(total):\n sh1 = 0.0\n sh2 = 0.0\n try:\n sh1 = float(h1[b1.index(cbe[index])])\n ...
[ "0.71725196", "0.65142816", "0.62537", "0.6232226", "0.6183617", "0.61671734", "0.61571336", "0.60737", "0.60692286", "0.5956013", "0.59121007", "0.5891987", "0.58791715", "0.5832929", "0.5825022", "0.5769532", "0.5756441", "0.5727408", "0.5718197", "0.56934917", "0.5683721",...
0.72700787
0
Evaluates base attribute value of person based on features, age, gender, etc.
def attribute(self, attribute): value = 3 if self.age == "child": value -= 1 if attribute == "physique" or attribute == "phy": if self.age == "adult": value += 1 if self.gender == "male": value += 1 elif self.gender ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feature_extraction(_data):\n # Find the digits in the given string Example - data='18-20' digits = '1820'\n digits = str(''.join(c for c in _data if c.isdigit()))\n # calculate the length of the string\n len_digits = len(digits)\n # splitting digits in to values example - digits = '1820' ages = ...
[ "0.5633302", "0.56305707", "0.5630525", "0.55070186", "0.5478344", "0.54693484", "0.54613477", "0.54573274", "0.5453816", "0.54529595", "0.5422918", "0.5317995", "0.53045845", "0.52880687", "0.5277273", "0.527475", "0.52594405", "0.52482104", "0.5226759", "0.5215583", "0.5201...
0.6449075
0
Permute the rows of _X_ to minimize error with Y, ignoring signs of the columns X numpy.array input matrix Y numpy.array comparison matrix numpy.array X with permuted rows
def match_rows_sign(X, Y): n, d = X.shape n_, d_ = Y.shape assert n == n_ and d == d_ # Create a weight matrix to compare the two W = zeros((n, n)) for i, j in it.product(xrange(n), xrange(n)): # Cost of 'assigning' j to i. W[i, j] = min(norm(X[j] - Y[i]), norm(X[j] + Y[i]) ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def match_rows(X, Y):\n n, d = X.shape\n n_, d_ = Y.shape\n assert n == n_ and d == d_\n\n # Create a weight matrix to compare the two\n W = zeros((n, n))\n for i, j in it.product(xrange(n), xrange(n)):\n # Cost of 'assigning' j to i.\n W[i, j] = norm(X[j] - Y[i])\n\n matching = ...
[ "0.5769132", "0.5621818", "0.5586707", "0.54072565", "0.5397549", "0.5358403", "0.5319366", "0.5261717", "0.5255339", "0.52463937", "0.5175605", "0.5172019", "0.516699", "0.5155215", "0.51417834", "0.5139273", "0.5113438", "0.5082017", "0.5073561", "0.5043652", "0.502834", ...
0.6251233
0
Requests a new ip for the device
def request_new_ip(self, mac): self.execute_script('new_ip', mac)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def purchase_ip(self, debug=False):\n json_scheme = self.gen_def_json_scheme('SetPurchaseIpAddress')\n json_obj = self.call_method_post(method='SetPurchaseIpAddress', json_scheme=json_scheme, debug=debug)\n try:\n ip = Ip()\n ip.ip_addr = json_obj['Value']['Value']\n ...
[ "0.64938843", "0.64519453", "0.6445656", "0.64216715", "0.62110883", "0.6202511", "0.61524814", "0.60697424", "0.6024123", "0.59993225", "0.5996937", "0.59684306", "0.5909357", "0.58596236", "0.583989", "0.58333933", "0.58167917", "0.58154434", "0.5806481", "0.579902", "0.572...
0.7935096
0
Change dhcp response time for device mac
def change_dhcp_response_time(self, mac, time): self.execute_script('change_dhcp_response_time', mac, time)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop_dhcp_response(self, mac):\n self.change_dhcp_response_time(mac, -1)", "def dhcp(self, dhcp):\n\n self._dhcp = dhcp", "def dhcp_utilization(self, dhcp_utilization):\n\n self._dhcp_utilization = dhcp_utilization", "def dhcp_callback(self, state, target_mac=None, target_ip=None, ex...
[ "0.68185097", "0.61317915", "0.60052145", "0.5939863", "0.5885967", "0.5811359", "0.58035165", "0.57373697", "0.5646604", "0.5625567", "0.55827594", "0.55206007", "0.5491405", "0.5381941", "0.53621304", "0.5349844", "0.53050417", "0.52728444", "0.52219707", "0.5220993", "0.52...
0.82894284
0
Stops DHCP response for the device
def stop_dhcp_response(self, mac): self.change_dhcp_response_time(mac, -1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self):\n\n if not self._dhcp_client_ctrl is None:\n self._dhcp_client_ctrl.exit()\n if not self._slave_dhcp_process is None:\n self._slave_dhcp_process.kill()\n logger.debug('DHCP client stopped on ' + self._ifname)\n \n self._new_lease_event.cl...
[ "0.7163312", "0.631082", "0.6104016", "0.60529596", "0.60524225", "0.6041364", "0.6019232", "0.5972226", "0.592156", "0.5913132", "0.590311", "0.5891132", "0.589016", "0.58840525", "0.58741194", "0.58572394", "0.582723", "0.5790126", "0.57324284", "0.5713386", "0.5644416", ...
0.8130744
0
Change dhcp range for devices
def change_dhcp_range(self, start, end, prefix_length): self.execute_script('change_dhcp_range', start, end, prefix_length)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dhcp_range(options, index):\n second_octet = 160 + index\n return \"192.%s.1.2-192.%s.255.254\" % (second_octet, second_octet)", "def dhcp(self, dhcp):\n\n self._dhcp = dhcp", "def configureDHCP():\n dhcpStart = config.get(\"hotspot\", \"dhcpstart\")\n dhcpEnd = config.get(\"hotspot\...
[ "0.6616823", "0.6526532", "0.64205295", "0.61709964", "0.5981741", "0.581122", "0.57029295", "0.56834716", "0.565777", "0.5584433", "0.54814816", "0.5453117", "0.5443394", "0.5424341", "0.5423709", "0.535401", "0.53214043", "0.5315264", "0.5313163", "0.53032523", "0.5302614",...
0.82061505
0
Converts a single track record into m3u format. Need the normalization to fix the way Apple handles e.g. combining diacriticals.
def to_m3u_track(record: Dict[str, str]) -> str: location = normalize(unquote(record.get("Location"))) # m3u duration in seconds, not ms duration = int(record.get("Total Time")) // 1000 name = normalize(unquote(record.get("Name"))) artist = normalize(unquote( record.get("Artist") or ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_m3u_list(list_name: str, tracks: List[str]) -> str:\n\n return M3U_TEMPLATE.format(name=list_name, tracks=\"\\n\".join(tracks))", "def encodeMP3(self, wavf: str, dstf: str, cover: str, meta: TrackMeta) -> None:\n FNULL = open(os.devnull, 'w')\n subprocess.call(['lame', '-V2', wavf, dstf],...
[ "0.62157995", "0.5663488", "0.5658642", "0.5651403", "0.56042594", "0.55793566", "0.5382664", "0.53761894", "0.5295393", "0.52780515", "0.52740747", "0.517685", "0.5173452", "0.51395833", "0.50221336", "0.5019546", "0.501397", "0.50028616", "0.49967933", "0.49772906", "0.4931...
0.75607246
0
Converts a list of serialized m3u tracks into a playlist.
def to_m3u_list(list_name: str, tracks: List[str]) -> str: return M3U_TEMPLATE.format(name=list_name, tracks="\n".join(tracks))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def playlist(self):\n def iconv(s):\n encoding = self.options[\"id3_encoding\"]\n try:\n if encoding:\n return s.encode('latin1').decode(encoding).encode('utf-8')\n else:\n return s.encode('latin1')\n except...
[ "0.6630314", "0.63010496", "0.6148589", "0.59600264", "0.59457934", "0.5888346", "0.5799984", "0.5784354", "0.5780846", "0.5779549", "0.577538", "0.5754062", "0.5745098", "0.57270885", "0.56991816", "0.5638412", "0.5616215", "0.56141627", "0.55851924", "0.55660707", "0.554203...
0.7024213
0
get the value of property _Chassis
def Chassis(self): return self._Chassis
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCharger(self):\r\n if hasattr(self, \"charger\"):\r\n return self.charger\r\n else:\r\n return None", "def value(self):\r\n return self.__cargo", "def test_get_chassis(self):\n resp = self.chassis_client.get_chassis(self.chassis.uuid)\n self.a...
[ "0.66945535", "0.62844557", "0.62731075", "0.6223003", "0.6214095", "0.59638584", "0.5955606", "0.59384584", "0.5914062", "0.5908595", "0.59032404", "0.5835006", "0.5728211", "0.5713444", "0.5685319", "0.5671768", "0.55380136", "0.55307096", "0.5527974", "0.5512052", "0.55114...
0.7827342
0
get the value of property _Option
def Option(self): return self._Option
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_option(self, option):\n\t\treturn self.options[option]", "def get(self, option):\n return get(self.name, option)", "def get_option_value(self, key):\n\n # Check the key.\n self.__assert_option(key)\n\n # Get and return the value.\n return self.__opt[key]", "def Op...
[ "0.8096682", "0.77774155", "0.7556324", "0.75427765", "0.7527482", "0.75237143", "0.7513979", "0.7381633", "0.73176533", "0.7317182", "0.7203971", "0.7119419", "0.7093766", "0.708832", "0.70553225", "0.70469296", "0.7028326", "0.70008403", "0.6975328", "0.6930424", "0.6911173...
0.7837177
1
Draws a Run the test button on the page for a user.
def Button(request): params = { 'mimetype': 'text/javascript', 'fn': request.GET.get('fn', '_bRunTest'), 'btn_text': request.GET.get('btn_text', 'Run the test'), 'cb_text': request.GET.get('cb_text', 'and send my results to Browserscope (anonymously)'), } return util.Render(request, 'user_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_run_button(self):\n\n run_button = Button(\n self.master, text=\"Run\", command=self.run_simulator)\n run_button.grid(row=6, column=1)\n\n return run_button", "def click_button(self):\n self.q(css='div#fixture button').first.click()", "def trigger_output(self):\n...
[ "0.63031554", "0.62987185", "0.61791044", "0.61791044", "0.6075906", "0.6057968", "0.6029089", "0.5979514", "0.58742535", "0.58558655", "0.5851815", "0.57412475", "0.57368124", "0.5710455", "0.5707332", "0.5673687", "0.5670039", "0.56390357", "0.56390077", "0.56256866", "0.56...
0.73393345
0
The User Test results table.
def Table(request, key): test = models.user_test.Test.get_mem(key) if not test: msg = 'No test was found with test_key %s.' % key return http.HttpResponseServerError(msg) params = { 'hide_nav': True, 'hide_footer': True, 'test': test, } return util.GetResults(request, 'user_test_table.ht...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tabulate(self):\n for test_name, test in self.test_types.items():\n for ivs_name, ivs in self.ivs.items():\n if self.verbose:\n print(\"{0}: {1}\".format(ivs_name, test_name))\n tree = test(ivs)\n if not tree:\n ...
[ "0.6465429", "0.6332018", "0.61088157", "0.6088008", "0.60849124", "0.6081138", "0.6075006", "0.60503936", "0.5999182", "0.5970002", "0.59527034", "0.58797216", "0.5863282", "0.5861191", "0.5843431", "0.5839", "0.5837997", "0.58336246", "0.5829603", "0.5828688", "0.58000195",...
0.728486
0