query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Initialize value of the constant.
def __init__(self, value): self.value = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, value=0, name='const'):\n super(ConstantExpression, self).__init__(name=name)\n ## The constant value this expression represents.\n self.c = value", "def __init__(self,value = 0):\n\n self.value = value", "def initialize(self):\n self._value = self.initiali...
[ "0.7538944", "0.65806085", "0.6517043", "0.6471259", "0.64205784", "0.63644856", "0.63123673", "0.63123673", "0.63123673", "0.63123673", "0.63123673", "0.63123673", "0.6277166", "0.62557435", "0.62459683", "0.62459683", "0.62459683", "0.62428844", "0.62318146", "0.6228091", "...
0.633586
6
Add variable_classification to symbol table, keyed by name. variable_classification should be an instance of a supported class.
def add(self, name, variable_classification): if name in self.__table__: logger.error("Tried to add duplicate key : " , name) if isinstance(variable_classification, Global_Variable): self.__table__[name] = variable_classification elif isinstance(variable_cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_classification(binary_addr, classification):\n\n binary_addr = memorymanager.BinaryAddr(binary_addr)\n assert classification is not None\n assert not is_classified(binary_addr, classification.length())\n\n classifications[binary_addr] = classification\n for i in range(1, classification.lengt...
[ "0.57706994", "0.5299413", "0.5178825", "0.5178825", "0.50512016", "0.5013679", "0.49713007", "0.49616438", "0.4951365", "0.49184912", "0.49086782", "0.48979303", "0.48972085", "0.4870996", "0.48198763", "0.48087734", "0.48018882", "0.47521648", "0.47314653", "0.4712323", "0....
0.8011216
0
return a variable_classification associated with name.
def get_data(self, name): return(self.__table__.get(name))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name_to_label(self, name):\n\t\t\treturn self.classes[name]", "def name_to_label(self, name):\n return self.classes[name]", "def name_to_label(self, name):\n\t\treturn self.classes[name]", "def get_node_with_name(self, name):\n\t return self.variables[name]", "def get_classification(self, ima...
[ "0.6528298", "0.6527921", "0.6510826", "0.59916306", "0.58133733", "0.57817703", "0.57817703", "0.57817703", "0.57711256", "0.5745272", "0.57253325", "0.5605661", "0.5573469", "0.5573469", "0.55194837", "0.5519292", "0.55147225", "0.54960835", "0.54558754", "0.5451315", "0.54...
0.0
-1
Display the symbol table.
def dump(self): for (name, value) in self.__table__.items(): print (name) print (value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_symbol_table(st):\n print(st)\n # Dump the name lists get_*()\n if isinstance(st, symtable.Function):\n for nlist in _NAME_LISTS:\n names = getattr(st, \"get_\"+nlist)()\n if names:\n print(' {} : {!r}'.format(nlist, names))\n # Dump the properties ...
[ "0.7768469", "0.74099475", "0.72750115", "0.6930435", "0.6711659", "0.6670382", "0.6665367", "0.6599625", "0.6598746", "0.6591674", "0.659064", "0.64741695", "0.6460066", "0.6340352", "0.63070005", "0.627977", "0.62285984", "0.62001884", "0.61887306", "0.6106539", "0.6053894"...
0.0
-1
Return text rep of the symbol table.
def __str__(self): tmp = "" for (name, value) in self.__table__.items(): tmp += str(name) + "\n" + str(value) + "\n" return(tmp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n dictt = self.getFullDict()\n return \"SymbolTable(\\n{}\\n)\".format(pprint.pformat(dictt))", "def __str__(self) -> str:\n\n return self._format_symbol_table_content(\"Symbol table\", self._symbols.items())", "def symbol_table(self) -> str:\n return self._symbol...
[ "0.7809413", "0.7695677", "0.75749266", "0.6714751", "0.6567845", "0.6553784", "0.6502915", "0.6430299", "0.6240541", "0.617382", "0.59942317", "0.59732187", "0.59671587", "0.5957305", "0.593824", "0.5930856", "0.5917182", "0.58882177", "0.5880251", "0.58725065", "0.58465326"...
0.5593835
53
Go to the specified directory
def cd(self,path): self.cwd = path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def go_to(dir):\n work = \"/home/prm/Desktop/optical/optical/CAHA/cig96_jun16/\" + dir\n os.chdir(work)\n #print \"Work/save directory:\", work", "def choose_directory():\n \n directory = askdirectory()\n chdir(directory)", "def cd(cls, directory):\n Log.debug('CMD: cd {0}'.format(dire...
[ "0.7531069", "0.7092994", "0.7075724", "0.7032784", "0.6880115", "0.6836928", "0.67205834", "0.6663107", "0.6647906", "0.6642001", "0.6566271", "0.64195335", "0.6386551", "0.6296432", "0.6288504", "0.6283376", "0.62689596", "0.62195694", "0.6175128", "0.6164524", "0.6143473",...
0.62231076
17
Go up one directory level
def cd_up(self): parts = self.cwd.split("\\") self.cwd = "" for i in parts[:-1]: self.cwd += i + "\\" self.cwd = self.cwd[:-1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def moveUp():\r\n\tos.chdir(\"..\")", "def _goUp(self) -> None:\n self._openPath(path=self._currPath.parent)", "def level_up(self):\n pass", "def move_up(self, directory=\"..\", start=False):\n try:\n curdir = os.getcwd()\n os.chdir(directory)\n if not st...
[ "0.7863609", "0.7094982", "0.6420725", "0.6305749", "0.6254262", "0.60747653", "0.59275055", "0.5922919", "0.589511", "0.58732444", "0.58665204", "0.58639157", "0.58307844", "0.57399356", "0.5708837", "0.56958", "0.5687419", "0.56815106", "0.5616748", "0.56079817", "0.5604445...
0.6728891
2
Does a single timestep. x is input at single timestep, with shape [B, input_size] h_mask has shape (1, hidden_size) w_rnn_mask has shape (hidden_size, hidden_size)
def __call__(self, x, state, h_mask=None, w_rnn_mask=None): self._initialize(x) h, syn_x, syn_u = state # Update STP state if self.synapse_config == 'static': h_post = h else: syn_x += self.dynamic_synapse*(self.alpha_std*(1-syn_x) - self.dt_sec*syn_u*syn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward_multistep(self, x, h=None):\n rnn_out, _ = self.rnn(x, h)\n out = self.nonlin(rnn_out)\n out = self.out(out)\n return out", "def recurrent(self, x, h_0, w_ih, w_hh, b_ih, b_hh):\n time_step = x.shape[0]\n outputs = []\n t = 0\n h = h_0\n ...
[ "0.6626418", "0.6523465", "0.6475527", "0.6467861", "0.63915914", "0.6248351", "0.62410563", "0.6223673", "0.61891216", "0.61472535", "0.5977498", "0.5958096", "0.5928593", "0.5924435", "0.5900401", "0.58467704", "0.5833496", "0.5816832", "0.57625586", "0.5760914", "0.5746896...
0.6954587
0
Does an entire trial. inputs has shape (T, B, input_size) h_mask has shape (1, hidden_size) w_rnn_mask has shape (hidden_size, hidden_size)
def do_trial(self, inputs, h_mask=None, w_rnn_mask=None): # Initial state batch_size = tf.shape(inputs)[1] state = self.initial_state(batch_size) # Lists to record outputs and state y_list = [] h_list = [] syn_x_list = [] syn_u_list = [] # Do tri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _build_rnn(self, input_tensor):\n\n w_trainable = False\n x_shift_trainable = False\n eta_trainable = True\n\n input_shape = input_tensor.get_shape().as_list()\n input_area = np.prod(input_shape[1:])\n batch_input_shape = (-1, input_area)\n\n filters = self._hparams.filters + self._hparams...
[ "0.6537916", "0.643278", "0.63914007", "0.6254323", "0.62117887", "0.61617935", "0.6105288", "0.60597825", "0.6032844", "0.582015", "0.5806906", "0.5765901", "0.5758782", "0.57418066", "0.57151246", "0.56992996", "0.5634114", "0.56296146", "0.562593", "0.5616265", "0.5605084"...
0.7540586
0
Cleans text including removal of whitespace, punctuation, accented characters, special characters and transforming to lowercase. Assumes input text is string. Returns clean string.
def normalize_document(doc:str, rm_sw:bool=True, rm_symb:bool=True, lemmatize:bool=True) -> str: stop_words_es = load_stopwords() # lower case and remove special characters\whitespaces if rm_symb: # Remove accents doc = unicodedata.normalize(u'NFKD', doc)\ .encode('ascii'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_text(text):\n text = re.sub(r\"[^A-Za-z0-9(),!?\\'\\`]\", \" \", text)\n text = re.sub(r\"\\'s\", \" \\'s\", text)\n text = re.sub(r\"\\'ve\", \" \\'ve\", text)\n text = re.sub(r\"n\\'t\", \" n\\'t\", text)\n text = re.sub(r\"\\'re\", \" \\'re\", text)\n text = r...
[ "0.8544424", "0.8435103", "0.82290757", "0.80813605", "0.8073183", "0.8063899", "0.80336934", "0.8000144", "0.79784954", "0.7964097", "0.7964097", "0.7964097", "0.7964097", "0.7964097", "0.7964097", "0.77424794", "0.772857", "0.77225435", "0.7708242", "0.76745415", "0.7620131...
0.0
-1
Initialize this prefix tree node with the given character value, an empty structure of children nodes, and a boolean terminal property.
def __init__(self, character=None): # Character that this node represents self.character = character # Data structure to associate character keys to children node values self.children = PrefixTreeNode.CHILDREN_TYPE() # TODO: changes this later to be more modular # we need...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.end_of_ngram = False #Flag marking whether this node is the end of an n-gram.\n self.value = None #Provided that the node marks the end of an n-gram, this refers to the value mapped by this n-gram.\n self.children = dict() #A dictionary which maps the next elements i...
[ "0.6665235", "0.6543156", "0.6469666", "0.6381798", "0.6364745", "0.6266195", "0.61163795", "0.59772074", "0.5968809", "0.5961764", "0.587357", "0.58718324", "0.5849852", "0.5834361", "0.57998735", "0.57780296", "0.5742961", "0.5738601", "0.57318425", "0.5730069", "0.57175416...
0.8080057
0
Return True if this prefix tree node terminates a string.
def is_terminal(self): return self.terminal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hasSuffix(self, s):\n node, off = self.followPath(s)\n if node is None:\n return False # fell off the tree\n if off is None:\n # finished on top of a node\n return '$' in node.out\n else:\n # finished at offset 'off' within an edge leading...
[ "0.7226911", "0.69385135", "0.6033172", "0.6033172", "0.60195875", "0.5998232", "0.59152925", "0.5912517", "0.5908837", "0.5890289", "0.58554524", "0.5829457", "0.58249617", "0.5778697", "0.57712626", "0.5768341", "0.57521415", "0.57521415", "0.5705662", "0.5678333", "0.56633...
0.0
-1
Return the number of children nodes this prefix tree node has.
def num_children(self): # TODO: Determine how many children this node has count = 0 for child in self.children: # if child not none if child: count += 1 return count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_children(self):\n return len(self.children)", "def children_count(self):\n return len(self._children_ids)", "def child_count(self):\n\t\treturn len(self._children)", "def _children_count(self):\n cnt = 0\n if self.left:\n cnt += 1\n if self.right:\n ...
[ "0.81510204", "0.80437917", "0.8000613", "0.7999524", "0.7935008", "0.7912218", "0.78598297", "0.78209823", "0.76490587", "0.76189154", "0.7589475", "0.753154", "0.74713975", "0.7357932", "0.7343707", "0.7329761", "0.7300585", "0.7299009", "0.7292898", "0.7290064", "0.7287386...
0.79914874
4
Return True if this prefix tree node has a child node that represents the given character amongst its children.
def has_child(self, character): # get the position of that character if self.num_children() > 0: character = character.upper() # get the character position the children list index = self._get_index(character) # if there is a value(not None) in that positio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startsWith(self, prefix: str) -> bool:\n\t\tcurrent_node = self.root\n\t\tfor ch in prefix:\n\t\t\tfound_in_child = False\n\t\t\tfor node in current_node.children:\n\t\t\t\tif node.char == ch:\n\t\t\t\t\tfound_in_child = True\n\t\t\t\t\tcurrent_node = node\n\t\t\tif found_in_child == False: # some char not fou...
[ "0.7128197", "0.7124183", "0.68367136", "0.6833913", "0.6767288", "0.6633027", "0.6624532", "0.6616198", "0.6612872", "0.65886366", "0.6573919", "0.6516627", "0.64836717", "0.6480255", "0.6474775", "0.6463279", "0.6448133", "0.6431371", "0.64189017", "0.6399336", "0.6399336",...
0.823829
0
Return this prefix tree node's child node that represents the given character if it is amongst its children, or raise ValueError if not.
def get_child(self, character): if self.has_child(character): index = self._get_index(character.upper()) return self.children[index] else: raise ValueError(f'No child exists for character {character!r}')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_child(self, character, child_node):\n # make sure character is uppercase\n character = character.upper()\n # TODO: Should I consider check if char is english letter?\n if not character.isalpha():\n raise ValueError(f'Child can only be English letters!')\n\n if ...
[ "0.6411065", "0.6123256", "0.59505016", "0.5816716", "0.5716883", "0.55713284", "0.5504385", "0.5464852", "0.5397857", "0.5277082", "0.52383786", "0.51611114", "0.5122005", "0.50697345", "0.5056239", "0.5043961", "0.5043162", "0.5042223", "0.5009303", "0.49876723", "0.4982551...
0.6819031
0
Add the given character and child node as a child of this node, or raise ValueError if given character is amongst this node's children.
def add_child(self, character, child_node): # make sure character is uppercase character = character.upper() # TODO: Should I consider check if char is english letter? if not character.isalpha(): raise ValueError(f'Child can only be English letters!') if not self.has...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_child(self, char, node):\n # Since most nodes only have a single child, we cheat and just store\n # the character and child node locally instead of using a dictionary\n # since dictionaries are quite large. We only use a dictionary for\n # children if there is more than one.\n ...
[ "0.7766311", "0.64096355", "0.63521856", "0.6063242", "0.6048972", "0.60131407", "0.5985679", "0.5974402", "0.5946803", "0.5944756", "0.5931625", "0.5878112", "0.58529073", "0.5841672", "0.5718316", "0.56705666", "0.56446874", "0.5643118", "0.5559174", "0.55575705", "0.554538...
0.79886997
0
Return a code representation of this prefix tree node.
def __repr__(self): return f'PrefixTreeNode({self.character!r})'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prefix(self):\n return str(self.data)", "def print_prefix(self):\n if self.is_empty():\n return \"\"\n else:\n ch = str(self.root_value())\n if self.is_leaf():\n return ch\n else:\n if self.has_left():\n ...
[ "0.6528944", "0.6526481", "0.6429511", "0.6429511", "0.62779075", "0.62705106", "0.62266624", "0.6158443", "0.60770893", "0.6044291", "0.60248667", "0.59881675", "0.59881675", "0.59881675", "0.59881675", "0.59868693", "0.5969311", "0.59661835", "0.5922735", "0.5877203", "0.58...
0.7174368
0
Return a string view of this prefix tree node.
def __str__(self): return f'({self.character})'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_prefix(self):\n if self.is_empty():\n return \"\"\n else:\n ch = str(self.root_value())\n if self.is_leaf():\n return ch\n else:\n if self.has_left():\n if self.has_right():\n ...
[ "0.78688645", "0.77090394", "0.76721746", "0.72109437", "0.69245", "0.6888956", "0.68463635", "0.68463635", "0.68463635", "0.6803383", "0.6798295", "0.6796307", "0.6789594", "0.67809397", "0.67643434", "0.67530656", "0.6752193", "0.6741303", "0.6741303", "0.6739444", "0.67361...
0.0
-1
Return a index position of character where it should be placed in list of children.
def _get_index(self, character): OFFSET = 65 # ascii value of 'A' since the first element should be 'A' index = ord(character) - OFFSET return index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indexOfChild(self, child):\n self.__initChild()\n return self.__child.index(child)", "def get_index(self, child):\n for _index, item in enumerate(self.children):\n if item == child:\n return _index\n\n return -1", "def get_parent_index(self, child):\n ...
[ "0.7009422", "0.700826", "0.66675276", "0.6638552", "0.6634376", "0.65657616", "0.65270454", "0.64948785", "0.6494254", "0.64940816", "0.6444423", "0.6420129", "0.6409724", "0.640417", "0.6361441", "0.63218945", "0.6315875", "0.6286927", "0.6285693", "0.62847406", "0.62767726...
0.673267
2
return marks for today
def today(self) -> List[Mark]: def is_today(mark): then = datetime.datetime.strptime(mark.date, "%Y-%m-%d %H:%M:%S") then = then.replace( tzinfo=pytz.timezone("Europe/Moscow")) now = _get_now_datetime() delta = then - now return delta....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def today(self):\r\n return RecordsToday(self)", "def get_today_stat(cls):\n return cls.get_specified_days_stat(0)", "def get_dates(self):\n now = datetime.now()\n if now.month > 6 and now.month < 9:\n now = datetime(now.year, 6, 1)\n\n term = ReadingsTerm()\n ...
[ "0.5916586", "0.5863006", "0.56907153", "0.5520133", "0.551707", "0.53910345", "0.53877157", "0.53220946", "0.53081816", "0.52918375", "0.52601963", "0.5241408", "0.5206583", "0.51920193", "0.5178562", "0.51725596", "0.51532644", "0.51315415", "0.5126638", "0.51142246", "0.50...
0.7245128
0
text is what type of drink, number is a volume
def _parse_message(msg): text = [] volume = 0 for word in msg.split(): try: volume += int(word) except ValueError: text += [word] if not text: text = ['water'] return volume, ' '.join(text)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vol(data):\n vol = re.search(\"[^a-zA-Z](v\\s*o\\s*l\\s*\\.?\\s*[^a-zA-Z\\n,]+)\",\n data, re.IGNORECASE)\n # Check if the search result contains at least a digit\n if has_num(vol.group()):\n return ''.join([num for num in vol.group() if num.isdigit()])\n return '(nf)'...
[ "0.54913557", "0.53042984", "0.5290135", "0.52120286", "0.52105665", "0.51988214", "0.5197405", "0.5192001", "0.51730245", "0.5152081", "0.5082428", "0.5070318", "0.5057047", "0.50451714", "0.50428504", "0.50155425", "0.4988973", "0.49786577", "0.49751192", "0.49695954", "0.4...
0.47787458
61
List forecast ARNs which should be deleted.
def get_deletion_target_forecast_arns(project_name, status_list): # Get all forecasts # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/forecast.html#ForecastService.Client.list_forecasts deletion_target_forecast_arns = [] paginator = forecast_client.get_paginator('list_forec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deleteRDFHistoryAnnotation(*args):\n return _libsbml.RDFAnnotationParser_deleteRDFHistoryAnnotation(*args)", "def _cleanup_deleted_nics(self):\n try:\n nics = self.network.network_interfaces.list(\n CONF.azure.resource_group)\n except Exception as e:\n ...
[ "0.5197516", "0.5063396", "0.5037167", "0.5018939", "0.50044006", "0.49915823", "0.49785802", "0.4913383", "0.49072155", "0.48931664", "0.48756954", "0.48353547", "0.4831092", "0.48188224", "0.4786588", "0.4776793", "0.47636405", "0.474672", "0.47381392", "0.47339857", "0.472...
0.69066507
0
Initialize given shell instance.
def __init__(self, stdin=None, stdout=None): self._stdin = stdin or sys.stdin self._stdout = stdout or sys.stdout self._builtins = self._make_builtins()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_shell(self):\n self.shell = PlayerTerminalInteractiveShell.instance(\n commands=self.commands,\n speed=self.speed,\n parent=self,\n display_banner=False,\n profile_dir=self.profile_dir,\n ipython_dir=self.ipython_dir,\n us...
[ "0.76439446", "0.735345", "0.7075153", "0.68446887", "0.6771419", "0.6708153", "0.667007", "0.663338", "0.6611069", "0.6511655", "0.6463832", "0.63359904", "0.62717134", "0.62325203", "0.6166664", "0.6163892", "0.61011064", "0.607137", "0.60688907", "0.6012114", "0.59869075",...
0.5549789
66
Make a list with internal commands.
def _make_builtins(self, which=__name__): def iscommand(what): if not inspect.isclass(what): return False return issubclass(what, Command) and what != Command return dict([ (cls.cmdname(), cls) for _, cls in inspect.getmembers(sys.m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cmd_list(args):", "def test_CommandList():\n from paradrop.confd.command import CommandList\n\n clist = CommandList()\n clist.append(20, \"b\")\n clist.append(20, \"c\")\n clist.append(10, \"a\")\n\n commands = list(clist.commands())\n assert commands == [\"a\", \"b\", \"c\"]", "def li...
[ "0.7016942", "0.6951982", "0.6946235", "0.6875561", "0.6874467", "0.68443877", "0.68018043", "0.67821926", "0.67821926", "0.67776465", "0.6622671", "0.64022905", "0.638254", "0.63745326", "0.63724905", "0.6363219", "0.63238096", "0.6314166", "0.6305056", "0.6304288", "0.62865...
0.0
-1
This function perform indexing process for a document object. Saved information is captures via two dictionaries ('inverted index' and 'posting')
def add_new_doc(self, document, documents_list_length=10000): try: document_dictionary = document.term_doc_dictionary # self.countDoc += 1 for term in document_dictionary.keys(): if self.stemming == 'y': my_stemmer = Stemmer() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _index_doc(self, db, doc_id):\n doc = db.get(doc_id)\n if doc is None:\n log.warning(\"Unable to find document in database: '%s'\" % doc_id)\n return\n fields = doc.get('solr_fields')\n fields = [\"payload\", \"timesaved\"]\n if not fields:\n ...
[ "0.6578094", "0.65689105", "0.64580166", "0.6388263", "0.63281995", "0.6242575", "0.61722445", "0.6171569", "0.6133206", "0.61045647", "0.60836166", "0.6072565", "0.6020664", "0.5973908", "0.5949004", "0.592966", "0.5928366", "0.5918795", "0.59119004", "0.59115744", "0.589549...
0.0
-1
Loads a precomputed index (or indices) so we can answer queries.
def load_index(self, fn): # print('Load ', fn) # if fn[len(fn)-4:] == '.pkl': # fn = fn[0:len(fn)-4] fn = 'idx_bench' inverted_index = utils.load_obj(fn) return inverted_index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_index(self, index_path: str = \"annoy_index.bin\"):\n if index_path and os.path.exists(index_path):\n corpus_emb_json_path = index_path + \".json\"\n logger.info(f\"Loading index from: {index_path}, corpus embedding from: {corpus_emb_json_path}\")\n super().load_ind...
[ "0.70387506", "0.7017522", "0.65531576", "0.65475804", "0.6488442", "0.61033887", "0.605056", "0.60362166", "0.60216534", "0.5958679", "0.58026785", "0.5799363", "0.5760247", "0.5742401", "0.57050043", "0.56919247", "0.5686208", "0.5660083", "0.56473666", "0.5628764", "0.5611...
0.68460137
2
Saves a precomputed index (or indices) so we can save our work.
def save_index(self, fn): utils.save_obj(self.inverted_idx, fn)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self):\n self.index.saveIndex(c.index_path('hnsw.index'))\n joblib.dump(self.ys, \"%s.ys\" % self.index_file_prefix)", "def save_index(self, index_path: str = \"annoy_index.bin\"):\n if index_path:\n if self.index is None:\n self.build_index()\n ...
[ "0.768521", "0.7268615", "0.7143544", "0.7043186", "0.6728959", "0.6711802", "0.6211941", "0.61536616", "0.60525626", "0.6005699", "0.58245677", "0.58102417", "0.5808068", "0.580441", "0.5789389", "0.5783334", "0.57672304", "0.57663906", "0.5756875", "0.57513165", "0.5730735"...
0.7413817
1
Checks if a term exist in the dictionary.
def _is_term_exist(self, term): return term in self.postingDict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _word_exists(self, word):\n try:\n self.vault[word]\n return True\n except KeyError:\n log('w', 'No vault entry for %s.' % word)\n return False", "def contains(self, term):\n\t\tif term in self.textFile:\n\t\t\treturn True\n\t\t\n\t\treturn False", ...
[ "0.71143764", "0.69745284", "0.6818216", "0.67665815", "0.67011344", "0.6628426", "0.65445715", "0.648925", "0.648786", "0.64627874", "0.64576524", "0.6287824", "0.62027085", "0.6191887", "0.61565", "0.60809", "0.6059904", "0.6058339", "0.604235", "0.60353863", "0.601541", ...
0.86079973
0
Return the posting list from the index for a term.
def get_term_posting_list(self, term): return self.postingDict[term] if self._is_term_exist(term) else []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_terms(self):\n [[self.set_postings(term, id) for term in NLProcessor.process(doc)] for id, doc in\n self.doc_store.dict.iteritems()]", "def get_posting_list(lines_to_get):\n\n # type(posting list) == { term: [df, {doc_id: tf}] }\n posting_list = {}\n current_index = 0\n with ...
[ "0.75238407", "0.64862007", "0.6434141", "0.6215521", "0.60838443", "0.6023031", "0.5840072", "0.57536083", "0.57006234", "0.55942345", "0.55942345", "0.55942345", "0.55942345", "0.55942345", "0.55942345", "0.55942345", "0.55942345", "0.55942345", "0.55517894", "0.54507554", ...
0.8083019
0
Find player in DB, return player id or None
def player(self, name): self.name = name q = Query() data = TinyDB('app/data/db_player.json').table('players') self.search_result = data.search( (q.name == self.name) | (q.surname == self.name) ) if len(self.search_result) == 0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_player(playerName):\n return players_col.find_one({\"name\": playerName})", "def get_player_id(self):\n User = Query()\n serialized_player = self.serialize_player()\n documents = table_players.search(User.first_name == str(serialized_player['first_name']) and\n ...
[ "0.76779073", "0.73495895", "0.73356354", "0.7250669", "0.71944904", "0.7151509", "0.7096887", "0.6957721", "0.6936647", "0.67984575", "0.65948427", "0.6585504", "0.6555482", "0.6552185", "0.64795864", "0.64064187", "0.6385305", "0.6368199", "0.6363935", "0.6353685", "0.63481...
0.7035678
7
Find tournament in DB, return tournament id or None
def tournament(self, name): self.name = name q = Query() data = TinyDB('app/data/db_tournaments.json').table('tournaments') self.search_result = data.search( (q.name == self.name) | (q.place == self.name) ) if len(self.search_result) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tournament_id(self):\n User = Query()\n serialized_tournament = self.serialize_tournament()\n documents = table_tournaments.search(User.tournament_name == str(serialized_tournament['tournament_name'])\n and User.start_date == str(serialized_t...
[ "0.7317936", "0.71878844", "0.66823566", "0.6586053", "0.62570727", "0.61614025", "0.59224683", "0.59196794", "0.5917578", "0.5827671", "0.5803463", "0.56885487", "0.56575257", "0.5646724", "0.5629798", "0.5609824", "0.56083345", "0.5598748", "0.55618787", "0.5556157", "0.555...
0.7204733
1
Initialize the MixedDataset object
def __init__(self, mode='train_with_val', datasets=None, options=_DEFAULT_DS_TRAIN_OPTIONS): # Only options supported in this initial implementation assert (mode in ['train_noval', 'val', 'train_with_val', 'test']) self.mode = mode self.opts = options # Combine dataset fields ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, dataset: Dataset):\n self.dataset = dataset", "def __init__(self):\n self.__dataset = None", "def __init__(self, dataset):\n self._dataset = dataset", "def __init__(self, **kwargs):\n DataLoader.__init__(self, **kwargs)", "def __init__(self, config):\n ...
[ "0.7411658", "0.72885245", "0.71571064", "0.7053392", "0.68904114", "0.6724314", "0.6659843", "0.6644623", "0.6643797", "0.66090095", "0.66068286", "0.65960044", "0.65706927", "0.65495265", "0.6547606", "0.6535818", "0.65315616", "0.6527384", "0.64903736", "0.64691925", "0.64...
0.0
-1
Starts a new trip
def start_trip(self, live): t = Trip(live) self.current_trip = t if live: # Send a request for a new trip to the remote server self.get_connection().start_trip() else: # Add a new trip to the local database self.get_database().start_trip(t)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_trip(self, trip):\n with closing(self.db.cursor()) as cursor:\n t = datetime.datetime.fromtimestamp(time.time()).strftime(\"%Y-%m-%d %H:%M:%S\")\n query = \"INSERT INTO Trips (StartTime, EndTime) VALUES('\"+t+\"', '\"+t+\"')\"\n #cursor = self.db.cursor()\n ...
[ "0.7632614", "0.73476607", "0.68050456", "0.6070551", "0.58444476", "0.57740855", "0.56689465", "0.5656807", "0.56367147", "0.55783194", "0.55622566", "0.5558509", "0.55477726", "0.5527102", "0.552073", "0.5515618", "0.5509126", "0.54992664", "0.5492092", "0.549134", "0.54648...
0.80429375
0
Stops the current trip.
def stop_trip(self): if self.current_trip is None: print("stopping non-existent trip") return # Send all data that is still available about this trip self.send_data() if self.current_trip.is_live(): # If the trip is live, warn the remote server that we...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self, **kwargs):\n return self.client.api.stop(self.id, **kwargs)", "def stop_trip(self, trip_id):\n print \"stopping trip in data_store\"\n with closing(self.db.cursor()) as cursor:\n t = datetime.datetime.fromtimestamp(time.time()).strftime(\"%Y-%m-%d %H:%M:%S\")\n ...
[ "0.70914865", "0.6969482", "0.683968", "0.66863656", "0.64907783", "0.64907783", "0.64669704", "0.6458828", "0.6427096", "0.6424007", "0.6422723", "0.642067", "0.6415792", "0.64154863", "0.64116096", "0.6401978", "0.635442", "0.6339749", "0.6339749", "0.63291174", "0.63229513...
0.80128336
0
This function is called when the creation of a new trip has been confirmed.
def trip_started(self, id): self.current_trip.set_id(id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_flight_needs_task(self):\n duration = self.trip.arrival_date_time - self.trip.departure_date_time\n if duration > timedelta(hours=2):\n self.tasks.append(self.trip.tasks.create(\n title=\"Flight Must Have !\",\n comments=\"It's a long flight ! Don't...
[ "0.63380027", "0.6304978", "0.62344754", "0.62009203", "0.6165714", "0.60250163", "0.5967789", "0.5965648", "0.5892993", "0.58810633", "0.5859362", "0.5826318", "0.5822881", "0.5808399", "0.5808399", "0.5808399", "0.5808134", "0.5759486", "0.56831", "0.5659985", "0.5659985", ...
0.6031829
5
Tries to send all data that is available in memory to either the local database or the remote server.
def send_data(self): if self.current_trip is None: return if not self.current_trip.has_id(): return try: if self.current_trip.is_live(): while self.current_trip.has_data(): d = self.current_trip.next_data() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_save_send(self):\r\n # Don't really know how to test this effectively...\r\n # Would require to simulate a blocking socket on the recipient side...\r\n pass", "def _flush(self):\n tempbuf = self.databuffer\n self.databuffer = []\n self.database.runInteraction(se...
[ "0.58548135", "0.582908", "0.58176786", "0.5816121", "0.5774505", "0.5743738", "0.56541646", "0.56438035", "0.56242555", "0.56205827", "0.56072426", "0.55967957", "0.55589896", "0.55412775", "0.5524188", "0.5497921", "0.54888105", "0.5486997", "0.5467406", "0.53752804", "0.53...
0.55977243
11
Returns a reference to the connection that is used to communicate with the remote server.
def get_connection(self): return self.application.get_connection()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_connection(self):\n\n return self.REMOTE_CONNECTION", "def get_connection(self):\n if self.conn is None or self.conn.closed != 0:\n self._connect()\n logger.debug(f'The connection object is: {self.conn}.')\n return self.conn", "def get_connection(self):\n c...
[ "0.7870281", "0.7670137", "0.7576816", "0.7563328", "0.7563328", "0.7561932", "0.7561932", "0.75094527", "0.7431763", "0.7395578", "0.7335015", "0.7335015", "0.7335015", "0.7334578", "0.7269218", "0.72369486", "0.7188556", "0.7159404", "0.7074535", "0.7063198", "0.7024341", ...
0.7227063
16
Returns a reference to the object that is used to communicate with the local database.
def get_database(self): return self.database
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_db(self):\n return DB(\n ClientStorage.ClientStorage((self.server, self.port))\n )", "def _get_current_object(self):\n if not hasattr(self.__local, '__release_local__'):\n return self.__local()\n try:\n return getattr(self.__local, self.__name...
[ "0.6918891", "0.6724008", "0.6724008", "0.6723868", "0.6684718", "0.6680489", "0.6670846", "0.65912634", "0.65845156", "0.65604097", "0.65604097", "0.6549198", "0.65159595", "0.64362836", "0.6411684", "0.6393103", "0.639274", "0.6376347", "0.63745874", "0.63585603", "0.635642...
0.65099496
13
Temporarily store a record that will be sent to either the remote server or the local database when send_data is called.
def add_record(self, data): if self.current_trip is None: print "no trip to add data" return self.current_trip.store_data(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_data(self, record):\n self.dbm.addRecord(record)", "def write(self, record):\n if not record:\n return\n\n # Convert to a dict - inefficient, I know...\n if type(record) is DASRecord:\n record = json.loads(record.as_json())\n if type(record) is dict:\n # If our local qu...
[ "0.6219603", "0.61446416", "0.5946963", "0.58653504", "0.5777162", "0.56784236", "0.5678241", "0.5601132", "0.5593206", "0.55822444", "0.55811954", "0.55204266", "0.55039907", "0.54672205", "0.54445916", "0.54055583", "0.54047805", "0.53991383", "0.53935164", "0.53888506", "0...
0.5692598
5
Temporarily store information about an image that will be sent to either the remote server or the local database when send_data is called.
def add_image(self, image_name): if self.current_trip is None: print "no trip to add image" return self.current_trip.store_image(image_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store_image(image_name):\n if request.args.get('state') != login_session['state']:\n response = make_response(\n json.dumps({'error': 'Invalid state parameter.'}), 401\n )\n response.headers['Content-Type'] = 'application/json'\n return response\n if 'username' not ...
[ "0.628332", "0.6205825", "0.61881006", "0.60588", "0.60424596", "0.59300935", "0.59258115", "0.5869609", "0.5860182", "0.58551216", "0.58247596", "0.57824165", "0.57593834", "0.57437706", "0.57415384", "0.57272977", "0.5719149", "0.57167137", "0.57105947", "0.57052565", "0.57...
0.0
-1
Initializes the connection to the local database.
def __init__(self, hostname, username, password, database_name): self.hostname = hostname self.username = username self.password = password self.database_name = database_name self.db = MySQLdb.connect(host=self.hostname, user=self.username, passwd=self.password, db=self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\r\n self.conn = create_connection(DATABASE_PATH)", "def init_database(self):\n init_database(self.engine)", "def init_database(self):\n # init_database(self.engine)", "def init() -> sqlite3.Connection:\n try:\n with open(DATABASE_INIT) as reader:\n ...
[ "0.7681801", "0.7609328", "0.7575548", "0.74583966", "0.7403991", "0.7391041", "0.73773706", "0.7358837", "0.7348299", "0.72500205", "0.72416925", "0.7236791", "0.72280854", "0.71719164", "0.71665066", "0.7148379", "0.71337366", "0.7115323", "0.71076417", "0.70934194", "0.708...
0.0
-1
Adds a new trip to the local database.
def start_trip(self, trip): with closing(self.db.cursor()) as cursor: t = datetime.datetime.fromtimestamp(time.time()).strftime("%Y-%m-%d %H:%M:%S") query = "INSERT INTO Trips (StartTime, EndTime) VALUES('"+t+"', '"+t+"')" #cursor = self.db.cursor() cursor.execute...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_record(self, data):\n if self.current_trip is None:\n print \"no trip to add data\"\n return\n self.current_trip.store_data(data)", "def add_trip(request):\n trip_name = request.POST.get('trip_name', None)\n start_date_tx = request.POST.get('start_date_tx', None)...
[ "0.7222878", "0.6961758", "0.66672313", "0.6545167", "0.6206592", "0.6206592", "0.6012512", "0.59958225", "0.57862896", "0.57742745", "0.57742745", "0.57742745", "0.5772493", "0.57469815", "0.5733229", "0.57141644", "0.5669199", "0.5646852", "0.5645996", "0.56137174", "0.5609...
0.72445005
0
Sets the end time of the trip.
def stop_trip(self, trip_id): print "stopping trip in data_store" with closing(self.db.cursor()) as cursor: t = datetime.datetime.fromtimestamp(time.time()).strftime("%Y-%m-%d %H:%M:%S") query = "UPDATE Trips SET EndTime='"+t+"' WHERE Id = '"+str(trip_id)+"'" cursor.e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_time(self, end_time):\n self._end_time = end_time", "def end_time(self, end_time):\n self._end_time = end_time", "def end_time(self, end_time):\n\n self._end_time = end_time", "def end_time(self, end_time):\n\n self._end_time = end_time", "def end_time(self, end_time):\n...
[ "0.8267125", "0.8267125", "0.8209551", "0.8209551", "0.8209551", "0.74991626", "0.74161017", "0.7324308", "0.72895944", "0.7244008", "0.72076786", "0.7155851", "0.69483006", "0.68755555", "0.68670255", "0.6753626", "0.6753626", "0.6753626", "0.6740387", "0.6666054", "0.663982...
0.64947665
26
Sends multiple records to the database.
def send_multiple_data(self, data_array, trip_id): l = [] for d in data_array: l.append((trip_id, json.dumps(d[0]))) print l if len(l) == 0: return with closing(self.db.cursor()) as cursor: query = "INSERT INTO Data (Trip, DataString) VALUES (%...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _batch_write(self):\n if self.to_put:\n db.put(self.to_put)\n self.to_put = []\n if self.to_delete:\n db.delete(self.to_delete)\n self.to_delete = []", "def _send_batch(self):\n batch = RPLogBatch(self._batch)\n http_request = HttpReques...
[ "0.6489871", "0.62162536", "0.6212522", "0.6182945", "0.6170266", "0.61223555", "0.6017973", "0.60052776", "0.59758145", "0.5963647", "0.5959967", "0.59353185", "0.5929608", "0.59281003", "0.5911985", "0.5907636", "0.5876779", "0.5871515", "0.5868144", "0.5857086", "0.5845604...
0.63451314
1
Sends data to the database.
def send_data(self, data, trip_id): with closing(self.db.cursor()) as cursor: query = "INSERT INTO Data (Trip, DataString) VALUES (%s, %s)" #cursor = self.db.cursor() cursor.execute(query, (trip_id, json.dumps(data[0]))) self.db.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_data(self):\n data = self.datastore.use(self.data_name)\n if data is None:\n self.dbg(\"sockets_warning\", \"Data is none for {}\", [self.data_name])\n encoded_data = json.dumps(data).encode()\n self.conn.sendall(encoded_data)\n self.dbg(\"sockets_verbose\", \...
[ "0.75822634", "0.72609293", "0.68654907", "0.68143797", "0.6558273", "0.65555155", "0.6451891", "0.6403736", "0.6394496", "0.63926274", "0.6380019", "0.6369309", "0.6367393", "0.6349149", "0.63332385", "0.6325644", "0.63236624", "0.6312248", "0.6303979", "0.6262424", "0.62543...
0.69267356
2
Stores the image_name in the database.
def send_image(self, image_name, trip_id): with closing(self.db.cursor()) as cursor: query = "INSERT INTO Images (Trip, ImageName) VALUES (%s, %s)" cursor = self.db.cursor() cursor.execute(query, (trip_id, image_name)) self.db.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store_image(self, image_name):\n self.images.append(image_name)", "def save_image(self):\n self.table_to_image.img.save(self.file_name)\n aws.AWSHandler().upload_image(self.file_name)", "def insert_image(self, image_path: str) -> str:\n mm = self.anki.media.MediaManager(self.col...
[ "0.7422551", "0.6947602", "0.691307", "0.68750376", "0.65975124", "0.6518034", "0.650842", "0.64840186", "0.6478657", "0.62842894", "0.62406915", "0.6171621", "0.6159434", "0.6150037", "0.61339164", "0.61273897", "0.6118631", "0.6089346", "0.60798126", "0.60732806", "0.606016...
0.66888374
4
Save image_name so it can be sent to the appropriate place later.
def store_image(self, image_name): self.images.append(image_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saveImageAs(self, name):\n\t\tself.image.save(name)", "def save_image(self, file_name: str):\n if not file_name.endswith(\".png\"):\n file_name += \".png\"\n self.image.save(file_name)", "def change_image_name(self, name):\n self.image.name = name", "def img_save(self):\n ...
[ "0.7677789", "0.72783726", "0.7195195", "0.71758056", "0.7172256", "0.7129597", "0.7065219", "0.705605", "0.7016702", "0.6999113", "0.6971093", "0.69455695", "0.69274753", "0.68928474", "0.6833291", "0.6816231", "0.67782545", "0.67746085", "0.6763465", "0.675829", "0.6754453"...
0.7107569
6
Save record so it can be sent to the appropriate place later.
def store_data(self, data): self.data.append(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_record(record):\n record. save_details()", "def save(self, record):\n pass", "def save_data(self, record):\n self.dbm.addRecord(record)", "def save(self, record):\n self.collection.insert(record)\n self.record = record\n\n return self", "def save():", "def save(...
[ "0.8233175", "0.7936864", "0.7656279", "0.7390483", "0.7328299", "0.73212284", "0.7174242", "0.71591145", "0.71371806", "0.71148485", "0.71148485", "0.71148485", "0.70850617", "0.70850617", "0.70850617", "0.70850617", "0.70850617", "0.6992412", "0.69729745", "0.6954981", "0.6...
0.0
-1
Returns whether all data about this trip should be stored in the local database or on the remote server.
def is_live(self): return self.live
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isLocal(self, connectionInfo):\n return False", "def persisted(self):\n return True if self._data else False", "def is_local(self):\n try:\n return os.path.isfile(self.get_absolute_path())\n except ValueError:\n logger.error(\"'%s' is not a file\", self.get...
[ "0.656021", "0.63912886", "0.61910176", "0.610415", "0.5872508", "0.5815209", "0.5814444", "0.5800487", "0.5773812", "0.57131344", "0.568525", "0.5665611", "0.5654128", "0.5622926", "0.5613616", "0.56108105", "0.5586732", "0.5568621", "0.55651623", "0.55590314", "0.5545998", ...
0.0
-1
Returns whether this trip received an id from the storage yet.
def has_id(self): return not self.id is None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_receipt_id(self):\n return self.receipt_id_uploaded_at is not None", "def exists(self):\n\n return self.ids[-1] is not None", "def has_id(self):\n return self.is_root() or hasattr(self, self.id_field)", "def has_valid_id(self):\n try:\n project_id = self.track.proje...
[ "0.71493804", "0.68278384", "0.6690638", "0.63286155", "0.63248265", "0.63099545", "0.62518334", "0.6242823", "0.620787", "0.6184917", "0.61646926", "0.6152373", "0.6118187", "0.61119354", "0.61100477", "0.6106007", "0.6102459", "0.6099983", "0.6060453", "0.6060453", "0.60568...
0.7565576
0
Returns the id received from the storage.
def get_id(self): return self.id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getID(self):\n return str(self._storage_id)", "def storage_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"storage_id\")", "def storage_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"storage_id\")", "def storage_id(self) -> pulumi.Input[str]:\n return p...
[ "0.8605927", "0.7899234", "0.76329434", "0.76329434", "0.7469452", "0.73761845", "0.7328387", "0.7303304", "0.72675776", "0.7265474", "0.7242328", "0.7242328", "0.7242328", "0.7242328", "0.7242328", "0.7242328", "0.7217709", "0.7217658", "0.7214174", "0.7199182", "0.71714056"...
0.7169344
35
Sets the id received from the storage.
def set_id(self, id): self.id = id print("self id = " + str(self.id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id):\n self.data['id'] = id", "def id(self, _id):\n self.metadata[\"id\"] = _id", "def set_id(self, id):\n self.__id = id", "def set_id(self, id_):\n\n self.id_ = id_", "def id(self, id):\n \n self._id = id", "def id(self, id):\n \n ...
[ "0.77089494", "0.76720566", "0.7640065", "0.7606066", "0.75123215", "0.75123215", "0.75123215", "0.75123215", "0.75123215", "0.74815494", "0.74815494", "0.74815494", "0.74815494", "0.74815494", "0.74815494", "0.74815494", "0.74815494", "0.74815494", "0.74815494", "0.74815494", ...
0.0
-1
Returns whether there's data to be sent.
def has_data(self): return len(self.data) > 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_data(self) -> bool:\n return bool(self.data)", "def has_data(self):\n return self._data is not None", "def has_data(self):\n\n return self._data is not None", "def has_data(self):\n\n return self._data is not None", "def has_data(self):\n if len(self.channels) > 0...
[ "0.7423077", "0.73794514", "0.7343328", "0.7343328", "0.72381836", "0.6993774", "0.6939404", "0.6916497", "0.6899406", "0.68876123", "0.6847703", "0.6830107", "0.6752344", "0.66728854", "0.66712654", "0.66709226", "0.66582125", "0.6551532", "0.6528431", "0.651103", "0.6507763...
0.7657208
0
Returns whether there are images to be sent.
def has_images(self): return len(self.images) > 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hasImages(self):\n return len(self.getImages()) > 0", "def hasImages(self):\n return len(self.getImages()) > 0", "def hasImage(self):\n if self.getImage():\n return True\n return False", "def has_media(self):\r\n if self.image:\r\n return True\r\n ...
[ "0.8059623", "0.8059623", "0.72129834", "0.7155696", "0.7122366", "0.710892", "0.7077476", "0.69735074", "0.6803033", "0.67114425", "0.6704998", "0.6497115", "0.6279785", "0.6257095", "0.62547874", "0.6247235", "0.6204291", "0.6144256", "0.612747", "0.612648", "0.61152744", ...
0.8047337
2
Returns the next record.
def next_data(self): return self.data.pop()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __next__(self):\n try:\n next_record = next(self.records)\n self.all_records.append(next_record)\n return next_record\n except StopIteration:\n self.pending = False\n raise StopIteration('At the end of the result set.')", "def _next_record(...
[ "0.76863295", "0.71877736", "0.7182566", "0.7102493", "0.7086011", "0.70173824", "0.7000606", "0.7000606", "0.6978749", "0.69307953", "0.6921134", "0.6894797", "0.68756026", "0.68583333", "0.68440753", "0.68065405", "0.67713064", "0.67327094", "0.67327094", "0.67327094", "0.6...
0.0
-1
Returns the next image.
def next_image(self): return self.images.pop()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_next_image(self):\n raise NotImplementedError", "def next(self):\n if self.currentframe < (self.nframes - 1) and self.nframes > 1:\n return self.getframe(self.currentframe + 1)\n else:\n newobj = pixiimage()\n newobj.read(next_filename(\n ...
[ "0.8978619", "0.8245073", "0.80875164", "0.7972798", "0.7777694", "0.75859123", "0.7498662", "0.7287124", "0.7276619", "0.7224484", "0.7143077", "0.7052642", "0.70292777", "0.69167733", "0.68469334", "0.6765168", "0.6747497", "0.67395824", "0.6722203", "0.6667301", "0.6663412...
0.79445535
4
Get the result of the job or, if the job raised an exception, reraise it. This function waits for the result if it's not yet available and the job is present in the queue. Otherwise ``ResultNotFound`` is raised.
async def result( self, timeout: Optional[float] = None, *, poll_delay: float = 0.5, pole_delay: float = None ) -> Any: if pole_delay is not None: warnings.warn( '"pole_delay" is deprecated, use the correct spelling "poll_delay" instead', DeprecationWarning ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def result_info(self) -> Optional[JobResult]:\n v = await self._redis.get(result_key_prefix + self.job_id)\n if v:\n return deserialize_result(v, deserializer=self._deserializer)\n else:\n return None", "def get_result(self, timeout):\n\n backend = self.par...
[ "0.6995088", "0.69176596", "0.6757708", "0.66183496", "0.66156113", "0.65909314", "0.6558447", "0.63526386", "0.62694645", "0.6235645", "0.6160255", "0.6104534", "0.6103073", "0.609301", "0.60777014", "0.60623854", "0.6060369", "0.6058272", "0.6030224", "0.59646595", "0.59605...
0.6706021
3
All information on a job, including its result if it's available, does not wait for the result.
async def info(self) -> Optional[JobDef]: info: Optional[JobDef] = await self.result_info() if not info: v = await self._redis.get(job_key_prefix + self.job_id) if v: info = deserialize_job(v, deserializer=self._deserializer) if info: s = await...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _fetch_data(self) -> JobInfo:\n return await self.api.get_job()", "def query_job_progress():\n pass", "def examine_job(self):\n if self.data is None:\n print(\"Could not download job id\", self.job_id)\n return\n self.duration = self.read_data(\"duration\...
[ "0.751513", "0.70630103", "0.7027783", "0.68640465", "0.66959196", "0.6678606", "0.65782154", "0.65754384", "0.6564774", "0.65311724", "0.65192556", "0.65130925", "0.6488781", "0.64476347", "0.6396794", "0.63836116", "0.63790613", "0.63515383", "0.63410026", "0.63341224", "0....
0.70076716
3
Information about the job result if available, does not wait for the result. Does not raise an exception even if the job raised one.
async def result_info(self) -> Optional[JobResult]: v = await self._redis.get(result_key_prefix + self.job_id) if v: return deserialize_result(v, deserializer=self._deserializer) else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_result(self):\n\t\treturn handle_to_object(call_sdk_function('PrlJob_GetResult', self.handle))", "def get(self):\n if not self.finished():\n self.wait()\n return self._result", "def result(self, job):\n\n assert isinstance(job, six.string_types)\n\n try:\n ...
[ "0.71049714", "0.6664428", "0.6653046", "0.66498166", "0.6640852", "0.66200167", "0.6616095", "0.6598082", "0.6574297", "0.6538799", "0.64958966", "0.64946705", "0.6493544", "0.64834994", "0.64439857", "0.6435248", "0.6433952", "0.64223033", "0.636806", "0.63643026", "0.63222...
0.74217653
0
Status of the job.
async def status(self) -> JobStatus: async with self._redis.pipeline(transaction=True) as tr: tr.exists(result_key_prefix + self.job_id) # type: ignore[unused-coroutine] tr.exists(in_progress_key_prefix + self.job_id) # type: ignore[unused-coroutine] tr.zscore(self._queue_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self):\n return self.job_proto.status", "def status(self) -> str:\n return self._check_job_status()", "def status(self) -> pulumi.Output['outputs.JobStatus']:\n return pulumi.get(self, \"status\")", "def get_status(self):\n\t\treturn call_sdk_function('PrlJob_GetStatus', self....
[ "0.8967504", "0.87950474", "0.83233553", "0.82600874", "0.8072488", "0.7965151", "0.79399073", "0.79399073", "0.7886714", "0.7858171", "0.7853358", "0.7853358", "0.78377676", "0.78345966", "0.78289896", "0.78206897", "0.78206897", "0.78206897", "0.78206897", "0.78206897", "0....
0.79390967
8
Iterates over every file in the dir with the input_format and converts it to the output_format in a sequential way
def convert_files_sequential(self) -> None: for file in os.listdir(self.audios_dir): if file.endswith(self.input_format): self.convert_file(os.path.join( self.audios_dir, file), self.output_format)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_all(input: str, out: str):\n dateien = listdir(input)\n for datei in dateien:\n out_datei = datei.replace(\" \", \"_\") # Leertasten durch Unterstriche ersetzen\n convert_image(input + datei, out + out_datei)", "def convert_files_parallel(self) -> None:\n file_paths = []\n...
[ "0.6980223", "0.68358386", "0.6766979", "0.6410417", "0.6409606", "0.6405167", "0.63713694", "0.61938375", "0.6193601", "0.6110876", "0.6098057", "0.6086324", "0.6071828", "0.60103554", "0.6003108", "0.59726304", "0.5959111", "0.5943927", "0.59355336", "0.58738846", "0.585644...
0.75851184
0
Iterates over every file in the dir with the input_format and converts it to the output_format in a parallel way
def convert_files_parallel(self) -> None: file_paths = [] for file in os.listdir(self.audios_dir): if file.endswith(self.input_format): file_paths.append(os.path.join( self.audios_dir, file)) with Pool(cpu_count()) as p: p.map(self.conv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_files_sequential(self) -> None:\n for file in os.listdir(self.audios_dir):\n if file.endswith(self.input_format):\n self.convert_file(os.path.join(\n self.audios_dir, file), self.output_format)", "def batch_convert(inputfiles, outputdir=None, fnfmt=...
[ "0.72859514", "0.68003356", "0.6771104", "0.6524911", "0.64170337", "0.6294985", "0.6283942", "0.62162393", "0.62076217", "0.6120828", "0.60920906", "0.6085274", "0.6048088", "0.598506", "0.59437376", "0.591172", "0.588044", "0.58707225", "0.5869432", "0.58523726", "0.5832397...
0.74059594
0
Converts the current audio to a new output format
def convert_file(self, file_path: str) -> None: print( f"Converting {os.path.split(file_path)[1]} to {self.output_format}") output = AudioSegment.from_file(file_path, format=self.output_format) output.export(file_path.replace(self.input_format, f'{self.output_f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_audio(self, _in, _out, bitrate, file_format):\n\n # Default output parameter\n # If not current directory, append '/'\n if os.path.isdir(_out):\n _out = '' if _out == '.' else _out + '/'\n _out += self.get_name_from_path(_in,\n ...
[ "0.6940232", "0.6747144", "0.67369866", "0.65247536", "0.6482532", "0.64688534", "0.64507806", "0.63940084", "0.63696307", "0.6359517", "0.6298962", "0.6249563", "0.6241644", "0.6175398", "0.6152512", "0.61390877", "0.604022", "0.5986575", "0.59454113", "0.592195", "0.5919117...
0.63994896
7
Remove all digits from the string and normalize the string with the usual fucnction tools.normalize_string
def preprocess_libcom(libcom): return tools.normalize_string(re.sub(r'[0-9]+', '', libcom))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize(self, s):\n s = normalizing_regexp.sub('_', s)\n if s[0:1] in string.digits:\n s = '_' + s\n return s", "def normalize(s):\n s = s.lower().replace(u' ', u'-')\n s = u''.join([c for c in s if c in string.letters + string.digits])\n return s", "def cleaning(string):\n\n ...
[ "0.77187043", "0.7392623", "0.71890706", "0.7170593", "0.7135604", "0.7041024", "0.7035636", "0.70253444", "0.69565594", "0.6950798", "0.6899988", "0.67778856", "0.6765228", "0.6662732", "0.6572228", "0.6562365", "0.65415466", "0.6540372", "0.652154", "0.65201384", "0.6504509...
0.0
-1
Get the type of number from the originator's type.
def tonFromType(t: str) -> TypeOfNumber: if t in TONS: return TONS[t] raise Exception("Unknown number type (%s) for originator" % t)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def typecode (self) :\r\n return self.numeric_typecode", "def getNumber():", "def _type(self):\n return self._id[1]", "def type(self) -> int:\n raise NotImplemented", "def type_(type_):\n\n try:\n type_ = float(type_)\n if type_.is_integer():\n return int\n ...
[ "0.63508254", "0.6247579", "0.6091169", "0.58599746", "0.5775129", "0.5753174", "0.57295257", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", ...
0.73939365
0
Sends a text message with the given body to the given MSISDN.
async def sendTextSMS( self, body: str, dest: str, source: Optional[Dict[str, str]] = None ) -> None: send_body: SendSMSBody = { "mobileTerminate": { "message": {"content": body, "type": "text"}, "destination": { "address": dest, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _text(self, fromwhom, number, text):\n\n server = smtplib.SMTP(\"smtp.gmail.com\", 587)\n server.starttls()\n server.login(self._smsaddress, self._smspw)\n server.sendmail(str(fromwhom), '{}@vtext.com'.format(number),\n str(text))\n server.quit()", "d...
[ "0.67033255", "0.65979624", "0.627774", "0.6176386", "0.61336595", "0.6129748", "0.61167955", "0.60447645", "0.60149926", "0.5960562", "0.5955417", "0.59533334", "0.59357935", "0.59240836", "0.59178764", "0.5859815", "0.5817715", "0.5783352", "0.57635945", "0.5751583", "0.572...
0.5975685
9
Direct log output to a file (or something like one).
def log_to_file(file, level=logging.WARNING, handler_class=logging.StreamHandler): handler = handler_class(file) handler.setLevel(level) handler.setFormatter( utils.AgentFormatter( "%(asctime)s %(composite_name)s %(levelname)s: %(message)s" ) ) root = logg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logToFile(output, file): \r\n print( output, file=file )", "def _log_to_file(self, message):\n if self.log is not None:\n message = \"[%s] %s\" % (datetime.datetime.utcnow().strftime('%H:%M:%S'), message)\n self.log.write(\"%s\\n\" % (message,))\n self.log.flush(...
[ "0.81656325", "0.7663033", "0.7344489", "0.7279647", "0.72714007", "0.72323406", "0.71945256", "0.7075597", "0.7073431", "0.70726734", "0.7068918", "0.6996329", "0.69961697", "0.69961345", "0.69921046", "0.69412756", "0.6842146", "0.6837088", "0.6822818", "0.68029547", "0.678...
0.6137917
89
Gets keys from keystore and knownhosts store
def get_keys(opts): hosts = KnownHostsStore() serverkey = hosts.serverkey(opts.vip_address) key_store = KeyStore() publickey = key_store.public secretkey = key_store.secret return {"publickey": publickey, "secretkey": secretkey, "serverkey": serverkey}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetSSHKeys():\n keydict = {}\n for rec in database.db.itervalues():\n if 'keys' in rec:\n keydict[rec['name']] = rec['keys']\n return keydict", "def get_hostkey_list(self):\n return self.hostkey", "def list_user_keys(self):\n return AlgoliaUtils_request(self.headers...
[ "0.64135724", "0.63342404", "0.6199463", "0.6130279", "0.61189514", "0.6081735", "0.60500073", "0.604882", "0.602405", "0.60201603", "0.60074025", "0.5991858", "0.5982021", "0.5973131", "0.59317154", "0.5926179", "0.59234756", "0.5888831", "0.5884009", "0.58473575", "0.584668...
0.7595132
0
Get the name of the context
def get_name(self): return self.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_context_template_name(self):\n return getattr(self, 'context_template_name', None)", "def get_context(self) -> str:\n\t\treturn get_type_context(self.name)", "def context_prefix(self) -> str:\n return \"context\"", "def context(self) -> str:\n return self._context", "def contex...
[ "0.84129924", "0.7772264", "0.7745091", "0.7713102", "0.7680596", "0.76675177", "0.7501266", "0.70966166", "0.6971605", "0.6902109", "0.6749705", "0.6698344", "0.6693426", "0.66768056", "0.6643735", "0.66329515", "0.66329515", "0.66209155", "0.6612946", "0.6600654", "0.659902...
0.0
-1
Get the type of the context
def get_type(self): return self.type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_context(self) -> str:\n\t\treturn get_type_context(self.name)", "def default_current_type(context):\n return context.current_parameters.get('type')", "def _resolve_type_from_context(self, cr, uid, context=None):\n if context is None:\n context = {}\n return context.get('defa...
[ "0.82677835", "0.7545189", "0.73423785", "0.70166737", "0.70115364", "0.6984444", "0.69645923", "0.69645923", "0.69645923", "0.69645923", "0.69645923", "0.69645923", "0.69645923", "0.69645923", "0.69645923", "0.69645923", "0.69645923", "0.69645923", "0.69645923", "0.69645923", ...
0.6945335
36
Set the name of the context
def set_name(self, name): self.name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, context, name):\n self._context = context\n self.name = name", "def __init__(self, context, name):\n self.context = context\n self.name = name", "def context_name(self, tab_number: int, context_number: int) -> str:\n return self.conventionalize_namespace(\n...
[ "0.72330034", "0.71889913", "0.6904692", "0.67973226", "0.67308915", "0.6722168", "0.657145", "0.657145", "0.6549711", "0.65137404", "0.6470773", "0.6393023", "0.63807", "0.63506603", "0.6340807", "0.6338339", "0.6334486", "0.6333794", "0.63265616", "0.6295468", "0.6295468", ...
0.6291954
35
Set the type of the context
def set_type(self, type): self.type = type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setContext(self, context: Any, /) -> Any:\n ...", "def type(self, type):\n self._type = type", "def type(self, type):\n self._type = type", "def _set_context_handletype(self, command, action, variable):\n if self._contexts[command].get(variable, None) is not None:\n ...
[ "0.70229733", "0.6788735", "0.6788735", "0.67152965", "0.67081124", "0.6700995", "0.6700995", "0.6650598", "0.6628867", "0.6628867", "0.6628867", "0.6628867", "0.6628867", "0.6628867", "0.6628867", "0.6628867", "0.6628867", "0.6628867", "0.6628867", "0.6628867", "0.6628867", ...
0.6999123
2
Set the active plugin
def set_active_plugin(self, unused): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetActiveObject(self):", "def set_active(self):\n self.active = True", "def set_active(self, active):\n self.active = active", "def set_active(self, active):\n self._active = active", "def control_plugin(self):\n pass", "def _activate(self):\n self.active = True", ...
[ "0.67446715", "0.6735788", "0.6717132", "0.6485941", "0.64724195", "0.64215094", "0.63492775", "0.6326862", "0.6326862", "0.63102853", "0.6224275", "0.6224275", "0.6224275", "0.6224275", "0.60347235", "0.5996666", "0.597586", "0.5957037", "0.57954144", "0.5794472", "0.5779486...
0.8738944
0
Get the name of the active plugin
def get_active_name(self): return self.get_name()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_plugin_name(self):\n return self.plugin_name", "def plugin_name(self):\n return os.path.splitext(os.path.basename(os.path.abspath(inspect.getfile(self.__class__))))[0]", "def plugin_name(self):", "def _get_name(self, plugin):\n return plugin.name if isinstance(plugin, BasePlugin)...
[ "0.8421675", "0.80486786", "0.8036239", "0.77887285", "0.7687859", "0.7389211", "0.7356517", "0.7341011", "0.7196839", "0.7163003", "0.7162646", "0.7147539", "0.71034604", "0.7066108", "0.6998219", "0.6989564", "0.6874517", "0.66317594", "0.65847075", "0.65498024", "0.6542558...
0.692724
16
Return a list of all plugins
def get_plugins(self): return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(self):\n return self.rpc.call(MsfRpcMethod.PluginLoaded)['plugins']", "def list_plugins():\n l = list()\n for dir in os.listdir(PLUGIN_DIRECTORY):\n l.append(dir)\n return l", "def plugin_list(self):\r\n return get_module_list()", "def list_plugins(request):\n plugin...
[ "0.86924815", "0.8555348", "0.8471971", "0.8348018", "0.82457983", "0.81805515", "0.8170836", "0.80438006", "0.7999067", "0.7954532", "0.7929944", "0.79130113", "0.7805088", "0.7800808", "0.77780414", "0.7647384", "0.7632655", "0.7590467", "0.7555945", "0.7551472", "0.753365"...
0.87810713
0
return lexicons from corpus who has been tokenized
def get_lexicons(n_words): lexicons = [] for words in n_words: lexicons.extend(words) return list(set(lexicons))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokens(self):\n\t\tlabels_and_synonyms = list(itertools.chain.from_iterable(list(self.term_to_tokens.values())))\n\t\ttokens = set(list(itertools.chain.from_iterable([word_tokenize(x) for x in labels_and_synonyms])))\n\t\treturn(list(tokens))", "def getLexicon(self):\n #return self._getOb('Lexicon')\n...
[ "0.6437062", "0.6362651", "0.6285286", "0.61697775", "0.61200374", "0.6105283", "0.60897243", "0.6027985", "0.60277593", "0.60257214", "0.59871453", "0.59871453", "0.5984452", "0.5970542", "0.5933215", "0.59287083", "0.59079117", "0.5903032", "0.58871126", "0.5864099", "0.584...
0.6720507
0
Retrieves the vertical edges from a quantum circuit encoding a single image.
def qc_to_edge(qc, mean_diff=True, backend=Aer.get_backend("qasm_simulator"), shots=100, intermediate_results=False): imgs = [] for even in [True, False]: edge_qc = _qc_edge_detect(qc, even_cols=even, mean_diff=mean_diff) edge_qc.measure_all() edge_res = execute(edge_qc, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_band_edges():\n # Vacuum level energy from LOCPOT.\n locpot = Locpot.from_file('LOCPOT')\n evac = max(locpot.get_average_along_axis(2))\n\n vasprun = Vasprun('vasprun.xml')\n bs = vasprun.get_band_structure()\n eigenvals = vasprun.eigenvalues\n efermi = vasprun.efermi - evac\n\n if ...
[ "0.6411886", "0.64002067", "0.62478495", "0.60023993", "0.5739372", "0.5698205", "0.5658221", "0.5611793", "0.55733085", "0.554336", "0.5509162", "0.5456305", "0.54230624", "0.541513", "0.54061604", "0.5401114", "0.53872967", "0.5381429", "0.536832", "0.53622746", "0.53216434...
0.0
-1
Applies the edge detection gates to a quantum circuit.
def _qc_edge_detect(qc, even_cols=True, inplace=False, mean_diff=False): if not inplace: qc = qc.copy() for reg in qc.qregs: if not even_cols: qc = _shift_amplitudes(qc, 1 if not mean_diff else 2, inplace=inplace) if mean_diff: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edges(image):\n #store image width and height and initialize new image\n image_width = image['width']\n image_height = image['height']\n new_image = {'height': image['height'], 'width': image['width'], 'pixels': len(image['pixels'])*[0]}\n \n #sobel operator kernels\n kernel_x = {'height':...
[ "0.56408423", "0.5376207", "0.5343812", "0.53200954", "0.52952576", "0.528185", "0.52520835", "0.52503884", "0.5249026", "0.52237076", "0.51336", "0.5097702", "0.5082932", "0.5044407", "0.50020754", "0.49914232", "0.49709845", "0.49613097", "0.49451944", "0.494035", "0.493373...
0.5462923
1
Given the counts from a quantum circuit that performs edge detection it returns the corresponding image.
def _counts_to_edge(counts, even_cols=True, mean_diff=True): edge = 2**(len(list(counts)[0])//2) img = np.zeros((edge, edge)) for key in counts: # Only if the state is in the form |...1> (i.e. contains a difference) if key[-1] == '1': # Split the binary sequence in half to get t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edges(image):\n #store image width and height and initialize new image\n image_width = image['width']\n image_height = image['height']\n new_image = {'height': image['height'], 'width': image['width'], 'pixels': len(image['pixels'])*[0]}\n \n #sobel operator kernels\n kernel_x = {'height':...
[ "0.6100797", "0.5805904", "0.567878", "0.5650064", "0.5632527", "0.5620697", "0.55422044", "0.5527099", "0.55104095", "0.5466213", "0.5462987", "0.5453492", "0.5443293", "0.54283965", "0.54259276", "0.54232615", "0.54208934", "0.5409337", "0.5404332", "0.53762305", "0.5364585...
0.5446728
12
Apply an nshift gate to a quantum circuit.
def _shift_amplitudes(qc, n, inplace=False): if not inplace: qc = qc.copy() for q_reg in qc.qregs: # Unitary gate representing the shift operation on n qubits shift_matrix = np.roll(np.eye(2**q_reg.size), n, axis=1) # Add the gate to the circuit qc.append(UnitaryGate(shif...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def s_dg(self, q0, ctrl=None):\n self.__add_quantum_gate(kind=PHASE_SHIFT_S_, qid=[q0], ctrl=ctrl)\n return self", "def bshift_nb(a, n):\n return bshift_1d_nb(a, n)", "def fshift_nb(a, n):\n return fshift_1d_nb(a, n)", "def to_instruction(self):\n return self.to_circuit().to_gate()...
[ "0.51957613", "0.5187607", "0.50957566", "0.50402135", "0.503946", "0.50011796", "0.49901596", "0.4960909", "0.4952623", "0.4950438", "0.4923167", "0.48833564", "0.4827508", "0.4827508", "0.48250613", "0.48175824", "0.48156825", "0.480668", "0.48003733", "0.47948095", "0.4788...
0.6484144
0
Internal method used as the callback for write events on ``BooleanIndicator.var``. This changes the colour of the frame (and, if it exists, the label) according to the new state of the variable.
def _on_change(self, *_): colour = self.on_colour if self.value else self.off_colour self.configure(bg=colour) if self.label: self.label.configure(bg=colour)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _color_var_changed(self, *args):\n\n if not self._internal_color_change:\n self._variable = self.color_var.get()\n self._update()\n self._internal_color_change = False", "def _update_color(self, *args):\n\n if self._variable and 'w' in self._mode and not self._dnd_s...
[ "0.67028683", "0.64010644", "0.6204457", "0.5895395", "0.54200166", "0.539929", "0.5381969", "0.53536063", "0.53170514", "0.5299433", "0.5273364", "0.5253764", "0.51905274", "0.5184947", "0.51795423", "0.5172071", "0.51498294", "0.51165545", "0.5115081", "0.5105447", "0.50928...
0.6074048
3
Internal method used as the callback for "" events if the indicator is mutable. This method toggles the indicator's state.
def _on_click(self, _): self.value = not self.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggle(self) -> None:", "def toggle(self) -> None:", "def toggle(self) -> None:\n ...", "def toggle(self):", "def toggle(self, **kwargs):\n self.on = False if self.on else True", "def toggled(self, *args, **kwargs): # real signature unknown\n pass", "def ToggleSpinner(event, st...
[ "0.67930853", "0.67930853", "0.6788461", "0.6518932", "0.62673146", "0.6251159", "0.62254125", "0.61961716", "0.616708", "0.6140764", "0.6074646", "0.6069429", "0.60126656", "0.59714", "0.5924987", "0.59209406", "0.5900425", "0.5893458", "0.58690536", "0.5809568", "0.57843554...
0.6109972
10
Add a widget (of the class specified in the constructor) to the bank.
def add(self, *args, **kwargs): widget = self.widget_cls(self, *args, **kwargs) self.widgets.append(widget) widget.pack(**self.pack_opts) return widget
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, widget: Component) -> None:\n self._add(widget)", "def add_widget():\n\n return render_template('add_widget.html', widget=None)", "def create_widget(self):\n pass", "def add_widget(self, widget, new_name=False):\n # we don't list placeholders\n if isinstance(widge...
[ "0.709838", "0.6903494", "0.67959785", "0.6773084", "0.6761934", "0.6687064", "0.6664474", "0.6661142", "0.6422594", "0.6348762", "0.630266", "0.63022584", "0.6265175", "0.62514853", "0.6231901", "0.62143654", "0.62003225", "0.6136802", "0.6130448", "0.6106662", "0.609994", ...
0.7004985
1
Remove the given widget from the bank. This will fail if the widget is not in the bank.
def remove(self, widget): self.widgets.remove(widget) widget.destroy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_widget(self, widget_position):\r\n\r\n # Remove the specified widget\r\n self.widgets_list.pop(widget_position)\r\n\r\n # Refresh the scroll area\r\n self._refresh()", "def unbindWidget(self, widget):\n\n # Figure out the index into __boundWidgets,\n # as we n...
[ "0.67667335", "0.65547377", "0.64291644", "0.64177626", "0.6086388", "0.6072363", "0.5998136", "0.5850074", "0.58103734", "0.57862264", "0.57408494", "0.56574476", "0.56295663", "0.5590097", "0.55320245", "0.55259603", "0.5507062", "0.54403585", "0.54196113", "0.53926814", "0...
0.742029
0
Move the pointer to reflect a change made to ``Gyro.pointer_frac`` or the radius.
def update_pointer(self): pointer_length = -self.pointer_frac * self.radius # Add pi/2 to the angle because we consider 0 radians to be pi/2 in standard position. x = pointer_length * math.cos(self._radians + math.pi / 2) y = pointer_length * math.sin(self._radians + math.pi / 2) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(self, p):\r\n self.position.setvalue(p)", "def move_forward(self, val):\n val = val * 180 / math.pi\n print(\"gyro diff\", self.gyro - val)\n print(\"gyrof\", self.gyro)\n if math.fabs(self.gyro - val) > 0.6:\n if self.gyro - val > 0:\n self.om_ri...
[ "0.61081266", "0.6020182", "0.58973384", "0.58944005", "0.5837245", "0.58157206", "0.5713067", "0.5684179", "0.56672317", "0.563868", "0.5634927", "0.5633495", "0.56288755", "0.56173927", "0.560045", "0.5566966", "0.5554059", "0.5534108", "0.5516651", "0.55150187", "0.5513884...
0.7390573
0
Change the canvas's scrollregion to reflect a change made to ``Gyro.circ_pad`` or the radius.
def update_scroll_region(self): self.configure(scrollregion=(-self._radius - self.circ_pad, -self._radius - self.circ_pad, self._radius + self.circ_pad, self._radius + self.circ_pad))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __reconfig__(self, event):\r\n x, y = event.width//2, event.height//2\r\n self.canvas.config(scrollregion=(-x, -y, x, y))", "def set_scrollregion(self, event=None):\n self.canvas.configure(scrollregion=self.canvas.bbox('all'))", "def on_configure(self, event):\n self.testCanvas....
[ "0.6519079", "0.6516638", "0.60711473", "0.60119116", "0.5765868", "0.57313836", "0.56846607", "0.55534095", "0.5489553", "0.5466302", "0.54653174", "0.544385", "0.54332244", "0.54172426", "0.54033566", "0.53885525", "0.5371049", "0.5363052", "0.53378415", "0.5244353", "0.523...
0.7807882
0
Internal method used as the callback for "" events if the ``auto_resize`` parameter was set in the constructor. This method updates the radius of the gyro according to any new space allocated/removed by resizing this gyro's parent widget.
def _on_configure(self, event): self.radius = (min(event.width, event.height) - 2 * self.circ_pad) / 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def changeRadius(self):\r\n self.curRadius= self.edit_rad.value()", "def gyroscope(self):\n raw = self.read_raw()\n # Compensate values depending on the resolution\n factor = 0\n if self._gyro_range == GYRO_RANGE_250DPS:\n factor = _GYRO_SENSITIVITY_250DPS\n e...
[ "0.56140345", "0.55083174", "0.54029346", "0.5339717", "0.527671", "0.52446693", "0.52438504", "0.51764804", "0.517351", "0.50903213", "0.50865734", "0.5082968", "0.50645924", "0.50562173", "0.5042392", "0.5042252", "0.50400823", "0.5032706", "0.4988998", "0.4978639", "0.4977...
0.5922251
0
Wrapper around ``tkinter.Canvas.create_oval`` to make constructing circles more intuitive.
def create_circle(self, x, y, r, **kwargs): return self.create_oval(*self.circ_to_oval(x, y, r), **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_oval(centerx, centery, radiusx, radiusy):\r\n global _canvas\r\n global _current_color\r\n if _canvas == None:\r\n raise RuntimeError(\"Canvas is not open yet.\")\r\n else:\r\n oval = Ellipse(radiusx * 2, radiusy * 2, Point(centerx, centery))\r\n _set_not_filled(oval)\r\n ...
[ "0.740658", "0.70530504", "0.69541764", "0.66446006", "0.6630347", "0.65782756", "0.65251106", "0.64284277", "0.639205", "0.6383982", "0.6344532", "0.6344419", "0.63228714", "0.6318555", "0.6304312", "0.6300076", "0.6299974", "0.62963027", "0.6232296", "0.62321067", "0.623210...
0.7324109
1
Convert the given information defining a circle into the information required to define an oval in tkinter.
def circ_to_oval(x, y, r): return x - r, y - r, x + r, y + r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetCircle(circle):\r\n pass", "def circleInfo(r):\n c = 2 * 3.14159 * r\n a = 3.14159 * r * r\n return (c, a)", "def _draw_circle(data, obj, draw_options):\n x, y = obj.center\n ff = data[\"float format\"]\n do = \",\".join(draw_options)\n content = (\n f\"\\\\draw[{do}] ...
[ "0.64137805", "0.63658404", "0.62751997", "0.5953539", "0.5865192", "0.5865192", "0.5847183", "0.5801532", "0.57959116", "0.5792312", "0.5746975", "0.5687916", "0.5637292", "0.5612203", "0.5593851", "0.55668217", "0.5562496", "0.55428964", "0.552284", "0.5478939", "0.5478487"...
0.5321754
33
Reload the data in the listboxes to reflect any changes on the networktables server.
def reload(self): self._populate(self.hierarchy[-1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh_table_list(self):\n selection = self._lb_tables.GetSelection() #preserve table selection\n\n self._tables.clear()\n self._lb_tables.Clear()\n\n tables = self._datafile.query(sciplot.database.Query(\"SELECT TableID, Title FROM `Table`\", [], 1))[0] #get all tables from the da...
[ "0.67903304", "0.63285744", "0.62289697", "0.6204841", "0.61563903", "0.612967", "0.6057776", "0.59787613", "0.5937973", "0.5934907", "0.58289707", "0.581385", "0.58017623", "0.5789915", "0.5759632", "0.5757451", "0.5747672", "0.5747672", "0.5733299", "0.56920296", "0.56646",...
0.0
-1
Wait until the given networktables instance successfully connects and then populate the listboxes with data. This should be called after the ``NTBrowser`` is constructed if the networktables instance containing the root table is suspected to be disconnected.
def reload_when_connected(self, inst, poll_ms=500): if inst.isConnected(): self.reload() else: self.after(poll_ms, utils.named_partial(self.reload_when_connected, inst, poll_ms))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_boxdb(self):\n self.tables = self.list_tables()\n for table in self.tables:\n self.mylist.insert(END, table[0])\n self.mylist.bind('<Double-1>', lambda x: self.select_table())", "def _populate(self, table):\n # Repopulating the listboxes will reset the scroll.\n ...
[ "0.5657485", "0.55829924", "0.5064517", "0.50618094", "0.5032641", "0.4853179", "0.485243", "0.4843599", "0.47780308", "0.4739779", "0.4710635", "0.46127602", "0.4594483", "0.45716617", "0.45681164", "0.45410395", "0.454007", "0.4516985", "0.44975692", "0.44831657", "0.447321...
0.0
-1
A merged yview function for both listboxes so that they can both be controlled via a single scrollbar.
def _merged_yview(self, *args): self._curr_scroll_row = round(float(args[1]) * len(self._items)) self.key_listbox.yview(*args) self.value_listbox.yview(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_scrollbar(self, *args) -> None:\r\n for textbox in self.textboxes:\r\n textbox.yview(*args)", "def _wheel_scroll(self, event):\n # For some unknown reason, when using a single scrollbar to control two listboxes they get out of sync by\n # exactly four listbox rows, with th...
[ "0.65716594", "0.6403848", "0.6171197", "0.5906714", "0.590537", "0.58961487", "0.5853431", "0.5840142", "0.574654", "0.56471264", "0.55247146", "0.549563", "0.5481614", "0.54067636", "0.5331052", "0.5165563", "0.5161623", "0.5130789", "0.51030886", "0.5081447", "0.5072545", ...
0.80449617
0
Internal method used as the callback for "" events.
def _wheel_scroll(self, event): # For some unknown reason, when using a single scrollbar to control two listboxes they get out of sync by # exactly four listbox rows, with the one being hovered over while scrolling being ahead of the other. # Therefore, below we have some (seemingly) effective a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def callback(self):\n pass # pragma: no cover", "def on_event(self, event):\r\n pass", "def on_event(self, event):\n pass", "def on_event(self, event):", "def _(event):\n pass", "def _(event):\n pass", "def _(event):\n pass", "def handle_event(self, event):"...
[ "0.6206736", "0.6205304", "0.605834", "0.6045805", "0.59955037", "0.59955037", "0.59955037", "0.59679073", "0.5958791", "0.590348", "0.58661604", "0.5810327", "0.5806568", "0.57985073", "0.57905966", "0.5782212", "0.5764496", "0.5761716", "0.5695853", "0.56901646", "0.5673518...
0.0
-1
Internal method used as the callback for "" events on the ``NTBrowser.key_listbox`` listbox.
def _key_double_click_callback(self, _): # Theoretically, it should be impossible to double click with more than one row selected, but just in case... if len(self._curr_indices) != 1: return # TODO: Some sort of warning or error idx = self._curr_indices[0] if self.key_listbo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_keybinds(self, listbox):\n if len(listbox.curselection()) != 0:\n self.lnp.load_keybinds(listbox.get(listbox.curselection()[0]))", "def _listbox_select_callback(self, _):\n self._curr_indices = self.key_listbox.curselection() or self.value_listbox.curselection()\n if self...
[ "0.6844881", "0.61751723", "0.5955301", "0.5877633", "0.5862483", "0.5783565", "0.5765389", "0.57143146", "0.565074", "0.5636429", "0.5577938", "0.5542974", "0.55194104", "0.5494066", "0.5493845", "0.54741037", "0.54581296", "0.5409603", "0.534638", "0.52620876", "0.5256907",...
0.52348936
24
Internal method used as the callback for "" events on the ``NTBrowser.value_listbox`` listbox.
def _value_double_click_callback(self, _): # Theoretically, it should be impossible to double click with more than one row selected, but just in case... if len(self._curr_indices) != 1: return # TODO: Some sort of warning or error idx = self._curr_indices[0] # If the selecte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _listbox_select_callback(self, _):\n self._curr_indices = self.key_listbox.curselection() or self.value_listbox.curselection()\n if self._curr_indices:\n kind = None\n for idx in self._curr_indices:\n # Break if any one of the selected rows is a table.\n ...
[ "0.5948485", "0.5464463", "0.54287314", "0.53957975", "0.5314232", "0.52849394", "0.52756107", "0.5226529", "0.5224342", "0.51857364", "0.5114669", "0.50461906", "0.5035057", "0.50216883", "0.49927568", "0.49483776", "0.49319267", "0.4920771", "0.4919687", "0.4893917", "0.485...
0.5732047
1
Create a popup window displaying the type and value of the entry corresponding to the given index.
def _create_entry_popup(self, idx): entry = self._items[idx] frame = style.Frame(self._entry_popup, style=self._style) # Make only the Text widget (which holds the entry's value) resizeable. frame.grid_columnconfigure(1, weight=1) frame.grid_rowconfigure(1, weight=1) s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_entry(var, win):\n\tif var.type.is_range():\n\t\tentry = build_range_entry(var, win)\n\telif var.type.is_enum():\n\t\tentry = build_enum_entry(var, win)\n\telse:\n\t\tentry = Gtk.Label(var.label)\n\tif var.help != \"\":\n\t\tentry.set_tooltip_text(var.help)\n\treturn entry", "def create_enter_window():...
[ "0.6107635", "0.586574", "0.5803055", "0.5757768", "0.56584376", "0.5515487", "0.54225373", "0.54172885", "0.5414938", "0.54008657", "0.53888977", "0.5383401", "0.53501904", "0.53457284", "0.5318706", "0.5294884", "0.5285082", "0.52751756", "0.52650523", "0.52553993", "0.5254...
0.79831636
0
Populate the listboxes with subtables, entries, and entry values from the given table. If the given table is not the root table, the parent table is added first. Secondly, all the subtables of the given table are added. Finally, all the entries in the given table are added.
def _populate(self, table): # Repopulating the listboxes will reset the scroll. self._curr_scroll_row = 0 # Repopulating the listboxes will reset the selection, so make sure the entry defaults to disabled. self._disable_entry() self._clear() # Initialize the _last_table_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_table(self,table):\n \n attr_list = []\n name = None\n comment = \"\"\n new_table = None\n t_id = table.attrib['id']\n \n \n #first cycles the child elements to find table name\n #and creates a table object\n for child in table:\n...
[ "0.5929662", "0.57869035", "0.55826676", "0.5549117", "0.5484225", "0.54469144", "0.54396", "0.5415753", "0.53740215", "0.53524214", "0.52699876", "0.5186455", "0.5172036", "0.5148817", "0.51448447", "0.512716", "0.5127114", "0.51145", "0.51127374", "0.5099474", "0.5071505", ...
0.8036582
0
Add the given key and value to the listboxes and add the given networktables table or entry to the ``NTBrowser._items`` list.
def _append_row(self, key, value, item): self._items.append(item) self.key_listbox.insert(tk.END, key) self.value_listbox.insert(tk.END, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_new(self, item, key):\n if key in self._items:\n raise DuplicateListHeapItemException(key)\n if len(self._items) >= self._max_limit:\n raise MaxItemLimitReachedException()\n self._items[key] = item\n self._listbox.insert(END, key)", "def AddToDictList(d, ...
[ "0.5536693", "0.5482763", "0.5453655", "0.53345376", "0.52900016", "0.5267623", "0.5198815", "0.51870805", "0.51286155", "0.5096395", "0.50895745", "0.5062756", "0.50607955", "0.505846", "0.50101596", "0.49821764", "0.49363694", "0.49264455", "0.491183", "0.4908686", "0.48800...
0.6614177
0
Clear both listboxes and the items list.
def _clear(self): self._items = [] self.key_listbox.delete(0, tk.END) self.value_listbox.delete(0, tk.END)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _remove_all(self):\n self._items.clear()\n self._listbox.delete(0, END)", "def Clear(self):\r\n\r\n self._items = []\r\n self._sizer_element_count = 0", "def clear(self):\n for inp in self.inputlst:\n inp.setText(\"\")", "def clear(self):\n self._items...
[ "0.7925446", "0.7328249", "0.70587397", "0.69114953", "0.6862008", "0.68342716", "0.6832405", "0.6804097", "0.6637174", "0.661914", "0.66162944", "0.66101193", "0.6556318", "0.6546479", "0.6545188", "0.65023035", "0.6499432", "0.6478096", "0.6478096", "0.64723617", "0.6469652...
0.8492629
0
Internal method used as the callback for "" events on the ``NTBrowser.insert_entry`` and command on the ``NTBrowser.insert_button``. This sets the value on the selected entries to whatever is in the tkinter entry.
def _insert_callback(self, _=None): try: value = ntutils.type_cast(self.insert_entry.get(), self._items[self._curr_indices[0]].getType()) for idx in self._curr_indices: ntutils.set_entry_by_type(self._items[idx], value) # Reload when done to assure the new dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _value_double_click_callback(self, _):\n # Theoretically, it should be impossible to double click with more than one row selected, but just in case...\n if len(self._curr_indices) != 1:\n return # TODO: Some sort of warning or error\n idx = self._curr_indices[0]\n # If t...
[ "0.6097229", "0.58054435", "0.57434785", "0.57090974", "0.5661242", "0.56295484", "0.56274754", "0.5625571", "0.55791736", "0.5555046", "0.555382", "0.5523306", "0.5477943", "0.5414632", "0.53940195", "0.5379563", "0.5369047", "0.5358284", "0.5353597", "0.53533155", "0.532508...
0.7391951
0