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
Initialize a new linked list containing the given items. The first node in the linked list contains the first item in .
def __init__(self, items): if len(items) == 0: self._first = None self._rest = None else: self._first = items[0] self._rest = LinkedListRec(items[1:])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, items):\r\n if len(items) == 0: # No items, and an empty list!\r\n self._first = None\r\n else:\r\n self._first = _Node(items[0])\r\n curr = self._first\r\n for item in items[1:]:\r\n curr.next = _Node(item)\r\n ...
[ "0.83739454", "0.7514045", "0.74844074", "0.7438117", "0.70560646", "0.6919856", "0.67227983", "0.6710322", "0.6697007", "0.66781634", "0.6622026", "0.65524465", "0.65173554", "0.6469273", "0.6463215", "0.64528155", "0.64364386", "0.64092153", "0.6385144", "0.63465625", "0.63...
0.77780277
1
Store item at position in this list. Raise IndexError if index is >= the length of .
def __setitem__(self, index, item): # TODO: complete this function! if index >= self.__len__(): raise IndexError else: if index == 0: self._first = item else: self._rest.__setitem__(index-1, item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __setitem__(self, index, newItem):\r\n #if index < 0 or index >= self.size():\r\n # raise IndexError(\"Array index out of bounds\")\r\n self._items[index] = newItem", "def __setitem__(self, index: int, item: Any) -> None:\n # If empty raise indexerror\n if self.is_empty(...
[ "0.7629131", "0.76125854", "0.7422154", "0.7377137", "0.7344196", "0.7304132", "0.7274706", "0.72285616", "0.7209512", "0.7208999", "0.7147858", "0.7123275", "0.7095537", "0.70878774", "0.70825756", "0.70619637", "0.70550114", "0.70175976", "0.6974228", "0.6926821", "0.691515...
0.7947383
0
Return the number of times occurs in this list. Use == to compare items.
def count(self, item): # TODO: complete this function! if item not in self: return 0 else: num_occur = 0 if self._first == item: num_occur += 1 num_occur += self._rest.count(item) return num_occur
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(self, value):\n self.__validate_value(value)\n counter = 0\n for v in self.__list:\n if v == value:\n counter += 1\n return counter", "def count(self):\n return sum(1 for _ in self)", "def count(self, element):\n count = 0\n f...
[ "0.7869159", "0.75559103", "0.7474671", "0.74528986", "0.7343283", "0.7281859", "0.7218688", "0.7205522", "0.7064695", "0.7057718", "0.7028781", "0.70113736", "0.6989967", "0.6975656", "0.69622695", "0.6945205", "0.69255155", "0.6864829", "0.6824261", "0.6775264", "0.6769184"...
0.758594
1
Insert item in to the list at position . Raise an IndexError if index is > the length of the list. Note that it is possible to add to the end of the list (when index == len(self)).
def insert(self, index, item): if index > len(self): raise IndexError elif index == 0: self.insert_first(item) else: self._rest.insert(index-1, item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, index, item):\n\n # Check if -len(self) <= index <= len(self)\n valid_index = (index <= len(self)) and (index >= -len(self))\n\n try:\n if not valid_index:\n raise IndexError\n\n if self.count == self.capacity:\n self._resize...
[ "0.8071151", "0.80658376", "0.8052258", "0.80156034", "0.7884237", "0.7812524", "0.7785804", "0.76542145", "0.7635252", "0.76222324", "0.7612091", "0.74901724", "0.74399555", "0.7413813", "0.7359655", "0.73120105", "0.72784495", "0.7094499", "0.7009153", "0.6994207", "0.69889...
0.8356974
0
Return a new LinkedList whose nodes store items that are obtained by applying f to each item in this linked list. Does not change this linked list.
def map(self, f): if self.is_empty(): pass else: items = [] items.append(f(self._first)) map(f._rest) new_lst = LinkedListRec(items)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map(self, f: Callable[[Any], Any]) -> RecursiveList:\n # If empty, return empty list\n if self.is_empty():\n return RecursiveList([])\n else:\n # Apply f to the first element and make a new list to return\n rl = RecursiveList([f(self._first)])\n ...
[ "0.6886586", "0.62040824", "0.58206326", "0.5771074", "0.5719031", "0.57083845", "0.5648191", "0.5646751", "0.5586226", "0.5547645", "0.5476429", "0.54671377", "0.5460554", "0.5458973", "0.5454752", "0.54406434", "0.5396636", "0.5386853", "0.53583515", "0.52437586", "0.520149...
0.7892843
0
1. calculates max length of feat/gep tensors 2. padds feat/geo tensors with zeros till the max length 3. writes resulting tensor to the file
def write_filtered_pad_feat_geo(self): length_max = self._get_length_max() data_list = range(self.idx_write, len(self.files_refined)) # length_max = 150 progress = tqdm(data_list) for id in progress: progress.set_postfix({'pdb': self.files_refined[id]}) fe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compress(args):\n # This is the sequential version, processing 8 rows one after another.\n x_folders_path = args.input_file\n x_test_images_path = np.asarray(make_mat(x_folders_path))\n # Build model, restore optimized parameters.\n model = CompressionModel(args)\n checkpoint = tf.train.Chec...
[ "0.6039958", "0.57728046", "0.5744389", "0.5502115", "0.5466844", "0.5433579", "0.5422248", "0.5407497", "0.53619576", "0.5324268", "0.5301215", "0.52916783", "0.5289233", "0.52885836", "0.52297246", "0.5225404", "0.52155596", "0.5209802", "0.52026147", "0.52013487", "0.51849...
0.59754586
1
get the max length of feature array among all pdbids
def _get_length_max(self): # data_list = list(range(len(self.files_refined))) data_list = range(self.idx_max_length, len(self.files_refined)) progress = tqdm(data_list) for pdb_id in progress: features_filt, geo_filt = self._get_features_geo_filtered(pdb_id) lengt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_max_rois(self):\n \n maxsize = 0\n for index in self.SampleID:\n rois = self.__getrois__(index);\n maxsize = max(maxsize, rois.shape[0])\n \n return maxsize", "def length(a):\n return max(a.shape)", "def determine_max_length(sequences, ids):\n...
[ "0.70063245", "0.67031974", "0.6578034", "0.6577833", "0.654353", "0.65412873", "0.64995086", "0.64809895", "0.64476216", "0.642505", "0.6413181", "0.6401733", "0.6401651", "0.638045", "0.6361821", "0.6353808", "0.6341069", "0.6327722", "0.6285773", "0.628314", "0.62640816", ...
0.68651325
1
creates a hot vector of an atom type
def atom_to_hot_vector(self, elem: str): hot_vector = np.zeros(22) idx = self.dict_atoms_simple[elem] hot_vector[idx] = 1 return hot_vector
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_one_hot(ind, n):\n vec = np.zeros(n)\n vec[ind] = 1\n return vec", "def to_one_hot(v):\n n = len(v)\n m = max(v) + 1\n out = np.zeros((n, m))\n out[np.arange(n), v] = 1\n return out", "def vec_to_onehot(vec, m=0):\r\n\r\n n = vec.shape[0]\r\n if m == 0:\r\n m = len(n...
[ "0.65515584", "0.64342755", "0.6431607", "0.6298604", "0.62674636", "0.62252426", "0.6173745", "0.6168766", "0.6096443", "0.60652435", "0.6063281", "0.6023734", "0.6019546", "0.59940034", "0.598831", "0.59744394", "0.5963999", "0.5954198", "0.594281", "0.59369165", "0.5905558...
0.77975243
0
selects atoms of "id_pdb" protein within the distance "precision" around "center_lig"
def _get_mask_selected_atoms_pocket( self, pdb_id: int, ): path_protein, path_ligand = self._get_path(pdb_id) center_ligand = self._get_ligand_center(path_ligand) if self.type_filtering == "all" and self.h_filterig == 'h': sel="protein and noh and sqr(x-'{0}')+sqr(y-'{1}...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_points(self, point, precision=5):\n # Generate the geohash.\n (latitude, longitude) = point\n\n hashcode = geohash.encode(latitude, longitude, precision)\n log.debug('Point \"%s\" geohash is: \"%s\"' % (point, hashcode))\n\n results = self.regex_query(self.spatial_index...
[ "0.5119753", "0.5106974", "0.5073792", "0.49484593", "0.49429494", "0.49392182", "0.49106923", "0.4801841", "0.47417852", "0.46974775", "0.46954015", "0.46917465", "0.4655261", "0.46518767", "0.45872286", "0.45733228", "0.45712203", "0.45690605", "0.4567515", "0.45560297", "0...
0.53425086
0
get the geometrical center of a ligand
def _get_ligand_center(self, path_ligand): mol_ligand = Molecule(path_ligand) coor_lig = mol_ligand.coords center = np.mean(coor_lig, axis=0) center = center.reshape(1, -1) return center
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_center(self):\n lon, lat = self.coordinates\n\n dimx = lon.shape[0]\n dimy = lon.shape[1]\n \n return (lon[dimx/2][dimy/2],lat[dimx/2][dimy/2])", "def get_center(self,lonlat=False):\n lon, lat = np.asarray(self.rotator.rots[0][0:2])*180/pi\n if lonlat: return lon...
[ "0.73146564", "0.7097857", "0.7076957", "0.7063528", "0.70455927", "0.6983909", "0.69735634", "0.6866781", "0.6822262", "0.6771345", "0.6769709", "0.6763476", "0.674945", "0.6733786", "0.6720019", "0.66451687", "0.6616574", "0.66154957", "0.6583129", "0.6547878", "0.65317476"...
0.81156254
0
takes all elems in protein
def _get_all_elems(self, protein_id: int): path_protein, _ = self._get_path(protein_id) try: # mol_pocket = Molecule(path_protein) mol_protein = Molecule(path_protein) mol_protein.filter('protein') if (self.type_feature == "bio_properties" or self.type_fea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def elems(self):", "def possible_subpeptides(self):\n ret = [\"\"]\n protein_len = len(self.protein)\n for l in range(1, protein_len):\n for i in range(protein_len):\n if i + l <= protein_len:\n ret += [self.protein[i : i+l]]\n else...
[ "0.62303525", "0.5552091", "0.5510698", "0.5500446", "0.54802835", "0.53920203", "0.53920203", "0.5362717", "0.5361895", "0.5349297", "0.5304554", "0.5291094", "0.52732027", "0.5205366", "0.51758593", "0.51736546", "0.5152028", "0.5149067", "0.5142705", "0.51384175", "0.51371...
0.57472456
1
get a full path to protein/ligand
def _get_path(self, protein_id: int): protein_name = self.files_refined[protein_id] path_protein = os.path.join( self.init_refined, protein_name, protein_name + "_protein.pdb" ) path_ligand = os.path.join( self.init_refined, protein_name, protein_name + "_ligand.m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_fullpath(self, address):\n address = os.path.abspath(address)\n if len(address) < 4 or address[-4:] != \".dta\":\n address = address + \".dta\"\n return address", "def get_plato_path():\n\treturn \"/tsi/\"", "def lpath(file0, file1):\n return os.path.abspath(os.path....
[ "0.66211337", "0.63901454", "0.63766974", "0.63610274", "0.63550186", "0.63381064", "0.6267822", "0.617297", "0.61711824", "0.61469203", "0.6130231", "0.6094284", "0.6089338", "0.60851544", "0.6083939", "0.60728234", "0.6053661", "0.60350275", "0.60183203", "0.60183203", "0.6...
0.7850319
0
Renders and returns a string of the rendered menu.
def render(self, menu): # Get the menu title. try: menu_title = menu["meta"]["title"] except KeyError: # If menu title not found, set to a default title. menu_title = "??????????" render = "\n" + menu_title render += "\n" + "=" * len(menu_titl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render(self,session,context):\n #TODO: at some point this should actually get implemented, but to do so\n # would need to convert self.menu_items from list to a dict, where the\n # keys are the items that should be selected in the menu. \n # to do so would need to update MenuItem as...
[ "0.7988218", "0.76087123", "0.75279605", "0.71491927", "0.6854286", "0.67999434", "0.6798856", "0.67587787", "0.67390203", "0.6681261", "0.6657621", "0.6626091", "0.6576273", "0.6531636", "0.64970994", "0.6481709", "0.6479811", "0.6458487", "0.6414937", "0.63659364", "0.63357...
0.77127457
1
count number of fillin edges after removing nid number of combinations of nhd existing edges (nodes in the subgraph of nhd)
def fill_count(nid): n_edges = G.subgraph(G.neighbors(nid)).number_of_edges() deg = G.degree[nid] n_fill = deg*(deg-1)//2 - n_edges return n_fill
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_fillin(graph, nodes):\n count = 0\n for v1 in nodes:\n for v2 in nodes:\n if v1 != v2 and v2 not in graph[v1]:\n count += 1\n return count / 2", "def num_edges(g):\n total_edges_with_duplicates = sum(len(v) for v in g.values())\n return total_edges_with_d...
[ "0.68112355", "0.6494084", "0.6307327", "0.6232778", "0.62294644", "0.6160811", "0.61596954", "0.6086348", "0.60630405", "0.60320306", "0.6026491", "0.59552574", "0.594635", "0.5942232", "0.5926342", "0.5921132", "0.59107393", "0.59103554", "0.58853024", "0.58828676", "0.5837...
0.7644923
0
Add the QListWisgetItem initialized with txt informations to the User Interface logger_list and to the save_parameters.logger array. =============== =========== ====================== Parameters Type Description txt string the log info to add. =============== =========== ======================
def add_log(self,txt): try: now=datetime.datetime.now() new_item=QtWidgets.QListWidgetItem(now.strftime('%Y/%m/%d %H:%M:%S')+": "+txt) self.ui.logger_list.addItem(new_item) if self.h5saver.h5_file.isopen: self.h5saver.append(self.h5saver.logger_arr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Add_text(self, s):\n self.logger.DeleteAllItems()\n FONT_RATIO = self.GUI_RESOLUTION + (self.GUI_RESOLUTION - 1) * 5\n if self.GUI_RESOLUTION > 1.1:\n font1 = wx.Font(11, wx.SWISS, wx.NORMAL,\n wx.NORMAL, False, self.font_type)\n elif self.GUI_R...
[ "0.5881799", "0.58458656", "0.56814134", "0.5619595", "0.55748296", "0.5516204", "0.54515344", "0.540663", "0.53921944", "0.5337886", "0.5323092", "0.5313274", "0.52923506", "0.52373755", "0.5226844", "0.5185388", "0.51751226", "0.5174729", "0.5174729", "0.5174729", "0.512978...
0.7931131
0
Remove all docks containing Moves or Viewers. See Also quit_fun, update_status
def clear_move_det_controllers(self): try: #remove all docks containing Moves or Viewers if hasattr(self,'move_modules'): if self.move_modules is not None: for module in self.move_modules: module.quit_fun() self.move...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_moves(self):\n [x.set_board() for x in self.pieces if x.get_state() == MOVE]", "def cleanup():\n for s in [missiles, explosions, bonus]:\n\n set_to_remove = set([])\n for m in s:\n if m.isDead:\n set_to_remove.add(m)\n\n s.difference_update(set_t...
[ "0.58050376", "0.5732785", "0.56806105", "0.56256336", "0.5601662", "0.5536522", "0.5464107", "0.5463185", "0.54307175", "0.54176515", "0.5413854", "0.5383799", "0.537846", "0.5367632", "0.53629655", "0.5356074", "0.5353963", "0.5322776", "0.5320462", "0.532009", "0.5315577",...
0.6498112
0
Load and restore a layout state from the select_file obtained pathname file. See Also utils.select_file
def load_layout_state(self, file=None): try: if file is None: file=utils.select_file(save=False, ext='dock') if file is not None: with open(str(file), 'rb') as f: dockstate = pickle.load(f) self.dockarea.restoreState...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_layout(file_name):\n with open(file_name) as layout_file:\n DATABASE[\"layout\"] = ordered_load(layout_file)", "def loadState(self, file):\n if isinstance(file, str):\n with open(file, 'r') as f:\n xml = f.read()\n else:\n xml = file.read()\n ...
[ "0.6230063", "0.58539796", "0.5767025", "0.5591188", "0.555881", "0.5494226", "0.5373943", "0.5372999", "0.53382033", "0.53322387", "0.5284557", "0.52710265", "0.52633137", "0.52633137", "0.52633137", "0.5242723", "0.5234761", "0.52294743", "0.5227755", "0.52208555", "0.52176...
0.77486223
0
Quit the current instance of DAQ_scan and close on cascade move and detector modules. See Also quit_fun
def quit_fun(self): try: try: self.h5saver.close_file() except: pass for module in self.move_modules: try: module.quit_fun() QtWidgets.QApplication.processEvents() QTh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self):\n print 'closing'\n self.comm.close_all_serial() # Close all serial connections opened with SNAPconnect\n print 'closed'\n sys.exit(0) # Exit the program", "def quitDataAcq(self):\r\n\t\t# stop the data acquition if threads still running\r\n\t\tglobal control, payloa...
[ "0.6674686", "0.663018", "0.64640576", "0.64363", "0.63610995", "0.6332642", "0.6332226", "0.6291272", "0.62454903", "0.623352", "0.61810166", "0.61721116", "0.6159734", "0.6145881", "0.6129895", "0.61248255", "0.611556", "0.6087104", "0.6085639", "0.60234964", "0.6013995", ...
0.71952796
0
Save the current layout state in the select_file obtained pathname file. Once done dump the pickle. See Also utils.select_file
def save_layout_state(self, file = None): try: dockstate = self.dockarea.saveState() if file is None: file=utils.select_file(start_path=None, save=True, ext='dock') if file is not None: with open(str(file), 'wb') as f: pickl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_file(self):\n if self.select_path.text() != \"\":\n filepath = self.select_path.text()\n road_network = self.map_selection.currentText()\n if self.map_selection.currentText() == \"User Defined\":\n road_network = self.map_selection_user_defined.text()...
[ "0.6506166", "0.6454797", "0.6402835", "0.6275733", "0.62479436", "0.6210814", "0.6192487", "0.6136867", "0.61263037", "0.6086277", "0.60623175", "0.60475004", "0.60043085", "0.6003689", "0.60000306", "0.5965004", "0.5953231", "0.5944658", "0.5938529", "0.5885336", "0.5870291...
0.7611917
0
Check for changes in the given (parameter,change,information) tuple list. In case of value changed, update the DAQscan_settings tree consequently. =============== ============================================ ============================== Parameters Type Description param instance of pyqtgraph parameter the parameter t...
def parameter_tree_changed(self, param, changes): for param, change, data in changes: path = self.settings.childPath(param) if path is not None: childName = '.'.join(path) else: childName = param.name() if change == 'childAdded':pas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateParameterNodeFromGUI(self, caller=None, event=None):\n\n\t\tif self._parameterNode is None or self._updatingGUIFromParameterNode and not self.active:\n\t\t\treturn\n\n\t\t#wasModified = self._parameterNode.StartModify() # Modify all properties in a single batch\n\t\t#self._parameterNode.EndModify(wasMod...
[ "0.6044912", "0.60374033", "0.5927496", "0.5887439", "0.5804231", "0.5773921", "0.57223433", "0.56518865", "0.5639361", "0.5627822", "0.5608297", "0.5597466", "0.5559683", "0.55548334", "0.5499283", "0.5494966", "0.5484403", "0.5473031", "0.5471835", "0.54695016", "0.54352117...
0.71576345
0
Set a file preset from the converted xml file given by the filename parameter. =============== =========== =================================================== Parameters Type Description filename string the name of the xml file to be converted/treated =============== =========== ========================================...
def set_file_preset(self,filename): if os.path.splitext(filename)[1] == '.xml': self.preset_file = filename self.preset_manager.set_file_preset(filename, show=False) self.move_docks = [] self.det_docks_settings = [] self.det_docks_viewer = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setFile(self, filename):\n self.prepare() #new call on each new file to process\n self.filename = \"%s\" % filename", "def set_preset_mode(self,filename):\n try:\n self.mainwindow.setVisible(False)\n for area in self.dockarea.tempAreas:\n area.window...
[ "0.5829164", "0.5519779", "0.5461985", "0.5307552", "0.5232683", "0.5231247", "0.5187496", "0.5112098", "0.5074602", "0.50464576", "0.49168807", "0.48866105", "0.48481604", "0.4804258", "0.47996974", "0.47971925", "0.47929823", "0.47869778", "0.47837144", "0.47798917", "0.475...
0.68054706
0
Send the command_DAQ signal with "set_ini_positions" list item as an attribute.
def set_ini_positions(self): self.command_DAQ_signal.emit(["set_ini_positions"])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_ini_positions(self):\n try:\n positions=self.scan_moves[0]\n for ind_move,pos in enumerate(positions): #move all activated modules to specified positions\n # if pos[0]!=self.move_modules[ind_move].title: # check the module correspond to the name assigned in pos\n...
[ "0.65206444", "0.5565225", "0.54022473", "0.5384504", "0.5145287", "0.5145287", "0.5145287", "0.5145287", "0.5145287", "0.5145287", "0.5145287", "0.5145287", "0.5145287", "0.5145287", "0.5145287", "0.50860304", "0.5072326", "0.5072326", "0.49873772", "0.49510655", "0.4950132"...
0.83170754
0
Set the date/time and author values of the scan_info child of the scan_attributes tree. Show the 'scan' file attributes. See Also show_file_attributes
def set_metadata_about_current_scan(self): date=QDateTime(QDate.currentDate(),QTime.currentTime()) self.scan_attributes.child('scan_info','date_time').setValue(date) self.scan_attributes.child('scan_info','author').setValue(self.dataset_attributes.child('dataset_info','author').value()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_file_attributes(self,type_info='dataset'):\n dialog=QtWidgets.QDialog()\n vlayout=QtWidgets.QVBoxLayout()\n tree = ParameterTree()\n tree.setMinimumWidth(400)\n tree.setMinimumHeight(500)\n if type_info=='scan':\n tree.setParameters(self.scan_attributes...
[ "0.551714", "0.5440282", "0.53046125", "0.52899736", "0.5286924", "0.5248003", "0.52438426", "0.52438426", "0.5181869", "0.5158462", "0.5115434", "0.50846976", "0.5074747", "0.5050444", "0.5019831", "0.5019831", "0.5000268", "0.49550933", "0.4948447", "0.4942758", "0.4933988"...
0.78501546
0
Set the date value of the data_set_infodate_time child of the data_set_attributes tree. Show the 'dataset' file attributes. See Also show_file_attributes
def set_metadata_about_dataset(self): date=QDateTime(QDate.currentDate(),QTime.currentTime()) self.dataset_attributes.child('dataset_info','date_time').setValue(date) res = self.show_file_attributes('dataset') return res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_get_dt():\n data = io.create_sample_dataset()\n assert data.attrs[\"dt\"] == 1.0\n assert data.piv.dt == 1.0\n data.piv.set_dt(2.0)\n assert data.attrs[\"dt\"] == 2.0", "def setNodeDatum(self, node, value):\n\n if not cmds.attributeQuery('datum', node=node, exists=True):\n ...
[ "0.62531453", "0.6206267", "0.61347795", "0.6099797", "0.5967181", "0.5845252", "0.5718401", "0.5666374", "0.5655639", "0.5612481", "0.5601563", "0.557588", "0.55429155", "0.54330015", "0.5411815", "0.5386389", "0.5386389", "0.52813655", "0.52794474", "0.52794474", "0.5279447...
0.74898064
0
| Set the preset mode from the given filename. | | In case of "mock" or "canon" move, set the corresponding preset calling set_()_preset procedure. | | Else set the preset file using set_file_preset function. | Once done connect the move and detector modules to logger to recipe/transmit informations.
def set_preset_mode(self,filename): try: self.mainwindow.setVisible(False) for area in self.dockarea.tempAreas: area.window().setVisible(False) self.splash_sc.show() QtWidgets.QApplication.processEvents() self.splash_sc.raise_() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_file_preset(self,filename):\n if os.path.splitext(filename)[1] == '.xml':\n self.preset_file = filename\n self.preset_manager.set_file_preset(filename, show=False)\n self.move_docks = []\n self.det_docks_settings = []\n self.det_docks_viewer = [...
[ "0.7156599", "0.6034789", "0.58596665", "0.5840704", "0.5835563", "0.57934976", "0.5777567", "0.5766049", "0.5764263", "0.57255656", "0.5667473", "0.5654134", "0.56322426", "0.5626051", "0.5547577", "0.55469173", "0.55058944", "0.5447592", "0.5425441", "0.53853714", "0.537712...
0.6626212
1
Sets the current scan given the selected settings. Makes some checks, increments the h5 file scans. In case the dialog is cancelled, return False and aborts the scan
def set_scan(self): try: # set the filename and path res = self.create_new_file(False) if not res: return #reinit these objects self.scan_data_1D = [] self.scan_data_1D_average = [] self.scan_data_2D = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_scan(self):\n self.ui.log_message.setText('Starting acquisition')\n self.overshoot = False\n self.plot_2D_ini=False\n self.plot_1D_ini = False\n res = self.set_scan()\n if res:\n\n # save settings from move modules\n move_modules_names = [mo...
[ "0.66779613", "0.56389666", "0.5437402", "0.54135776", "0.5386053", "0.52407885", "0.50568384", "0.5048242", "0.5046069", "0.49726388", "0.49683028", "0.4941879", "0.49254397", "0.4911938", "0.4909159", "0.49013782", "0.4855569", "0.48478332", "0.48153368", "0.4804125", "0.47...
0.6381482
1
Foreach module of the move module object list, stop motion. See Also stop_scan, DAQ_Move_main.daq_move.stop_Motion
def stop_moves(self,overshoot): self.overshoot = overshoot self.stop_scan() for mod in self.move_modules: mod.stop_Motion()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self):\n self.stopAngMovementAll()\n self.stopMovementAll()", "def stop_moving(self):\n self.logger.info('stop moving')\n self.anc350_instrument.stop = True\n self.anc350_instrument.stop_moving('XPiezoStepper')\n self.anc350_instrument.stop_moving('YPiezoStepper...
[ "0.6659773", "0.6369866", "0.63668823", "0.630369", "0.6286686", "0.6217773", "0.61441624", "0.61035544", "0.60714436", "0.60264486", "0.59845763", "0.59644985", "0.5921393", "0.588454", "0.58430815", "0.58115435", "0.5793677", "0.5671151", "0.5671151", "0.5641215", "0.562186...
0.7260226
0
Emit the command_DAQ signal "stop_acquisiion". See Also set_ini_positions
def stop_scan(self): self.ui.log_message.setText('Stoping acquisition') self.command_DAQ_signal.emit(["stop_acquisition"]) if not self.overshoot: self.set_ini_positions() #do not set ini position again in case overshoot fired status = 'Data Acquisition has been stopped b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self):\n print(\"Stopping accessory.\")", "def stop(self):\n self.scion_sh('stop')", "def on_stop(self):\n pass", "def on_stop(self):\n pass", "def on_stop(self):\n pass", "def on_stop(self):\n pass", "def on_stop(self):\n pass", "def on_stop(...
[ "0.61277246", "0.61252224", "0.61175966", "0.61175966", "0.61175966", "0.61175966", "0.61175966", "0.61175966", "0.61175966", "0.60791785", "0.60655814", "0.6048787", "0.59698194", "0.5935116", "0.5927264", "0.58939093", "0.58727676", "0.58689684", "0.58689684", "0.58689684", ...
0.6285996
0
Update the 2D graphic window in the Graphic Interface with the given datas (if not none).
def update_2D_graph(self,datas): try: if "2D" in self.scanner.settings.child('scan_options','scan_type').value(): #scan2D type cartography if not(self.plot_2D_ini):#init the data self.plot_2D_ini=True self.scan_x_axis=self.scan_parameters.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show2d(self, data):\n self.__plot2d.clear()\n self.__plot2d.addImage(legend=\"data\", data=data)\n self.setCurrentIndex(self.__index2d)", "def redraw(self):\n x2, y2 = [[] for i in range(len(self.x))], \\\n [[] for i in range(len(self.x))]\n game_point = [ra...
[ "0.6652105", "0.6480033", "0.6392848", "0.6373413", "0.6372241", "0.6316622", "0.6263822", "0.6242772", "0.62332606", "0.616997", "0.61216587", "0.61146516", "0.60937005", "0.6056487", "0.605595", "0.60478926", "0.60207796", "0.6014414", "0.5973884", "0.5959114", "0.59557223"...
0.65230453
1
Add the scan_optionsplot_form child to the DAQscan_settings tree from the selected value of the given parameter. =============== ================================= ======================== Parameters Type Description param instance of pyqtgraph parameter the parameter to treat =============== ===========================...
def update_plot_det_items(self,param): items=param.value()['selected'] self.settings.child('scan_options', 'plot_from').setOpts(limits=items)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_scan2D_type(self, param):\n try:\n self.settings.child('scan2D_settings', 'step_2d_axis1').show()\n self.settings.child('scan2D_settings', 'step_2d_axis2').show()\n scan_subtype = self.settings.child('scan2D_settings', 'scan2D_type').value()\n self.sett...
[ "0.5666199", "0.5596686", "0.54091656", "0.5221192", "0.5203126", "0.5030914", "0.49853924", "0.49624065", "0.49295855", "0.4927549", "0.49155295", "0.4887674", "0.48843557", "0.48682672", "0.48622483", "0.48564363", "0.48544782", "0.48372853", "0.48309246", "0.4821907", "0.4...
0.6061984
0
Show the txt message in the status bar with a delay of wait_time ms. =============== =========== ======================= Parameters Type Description txt string The message to show wait_time int the delay of showing log_type string the type of the log =============== =========== =======================
def update_status(self,txt,wait_time=0,log_type=None): try: self.ui.statusbar.showMessage(txt,wait_time) if log_type is not None: self.log_signal.emit(txt) logging.info(txt) except Exception as e: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def StatusbarTimer(self):\r\n\t\ttime.sleep(self.statusmsgTimeout)\r\n\t\tself.statusbar.SetStatusText(self.statusmsg)", "def flash_status(text=\"\", duration=0.05):\n status_label.color = WHITE\n status_label.text = text\n time.sleep(duration)\n status_label.color = BLACK\n time.sleep(duration)\n...
[ "0.7081665", "0.6996856", "0.6747514", "0.66980165", "0.65417576", "0.64842546", "0.64424944", "0.64424944", "0.6430523", "0.63779753", "0.6326194", "0.6281613", "0.6228862", "0.62059087", "0.6144765", "0.612524", "0.60996556", "0.60810894", "0.60790706", "0.6026205", "0.5993...
0.80850214
0
| Set the positions from the scan_move attribute. | | Move all activated modules to specified positions. | Check the module corresponding to the name assigned in pos. See Also DAQ_Move_main.daq_move.move_Abs
def set_ini_positions(self): try: positions=self.scan_moves[0] for ind_move,pos in enumerate(positions): #move all activated modules to specified positions # if pos[0]!=self.move_modules[ind_move].title: # check the module correspond to the name assigned in pos ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_stages(self,positions):\n for ind_move,pos in enumerate(positions): #move all activated modules to specified positions\n #self.move_modules[ind_move].move_Abs(pos)\n self.move_modules_commands[ind_move].emit(utils.ThreadCommand(command=\"move_Abs\", attributes=[pos]))", "def...
[ "0.7467515", "0.6947724", "0.6550185", "0.64504737", "0.6210145", "0.6199858", "0.60810655", "0.60117346", "0.58760816", "0.5873726", "0.58373207", "0.58349156", "0.5817869", "0.57891977", "0.57215756", "0.57186145", "0.57167464", "0.5713565", "0.57004696", "0.56890833", "0.5...
0.82506406
0
| Update the move_done_positions attribute if needed. | If position attribute is setted, for all move modules launched, update scan_read_positions with a [modulename, position] list. ============== ============ ================= Parameters Type Description name string the module name position float ??? ============== =...
def move_done(self,name,position): try: if name not in list(self.move_done_positions.keys()): self.move_done_positions[name]=position if len(self.move_done_positions.items())==len(self.move_modules_names): list_tmp=[] for name_tmp in sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_ini_positions(self):\n try:\n positions=self.scan_moves[0]\n for ind_move,pos in enumerate(positions): #move all activated modules to specified positions\n # if pos[0]!=self.move_modules[ind_move].title: # check the module correspond to the name assigned in pos\n...
[ "0.6969691", "0.6139816", "0.5908709", "0.5744122", "0.5650663", "0.5544578", "0.55405074", "0.55050606", "0.54708046", "0.54686624", "0.5464044", "0.54615414", "0.5459722", "0.54332083", "0.53042233", "0.5279307", "0.52247083", "0.5211969", "0.51990247", "0.51911044", "0.516...
0.84063566
0
Send the status signal 'Time out during acquisition' and stop the timer.
def timeout(self): self.timeout_scan_flag=True self.timer.stop() self.status_sig.emit(["Update_Status","Timeout during acquisition",'log']) self.status_sig.emit(["Timeout"])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop_timer(self):\r\n self.countdownTimer.stop()", "def stop_timer(self):\n self.end_time = datetime.now()", "def stop_scan(self):\n self.ui.log_message.setText('Stoping acquisition')\n self.command_DAQ_signal.emit([\"stop_acquisition\"])\n\n if not self.overshoot:\n ...
[ "0.6732306", "0.6624446", "0.6623612", "0.6596136", "0.6428103", "0.6352463", "0.629017", "0.62560344", "0.6242175", "0.6213506", "0.619111", "0.6187021", "0.61418176", "0.60949814", "0.60904163", "0.60898554", "0.6060151", "0.6058167", "0.6037202", "0.60368913", "0.60180306"...
0.8051863
0
Move all the activated modules to the specified positions. =============== ============ ============================================= Parameters Type Description positions tuple list The list of the positions related to indices =============== ============ ============================================= See Also DAQ_Move...
def move_stages(self,positions): for ind_move,pos in enumerate(positions): #move all activated modules to specified positions #self.move_modules[ind_move].move_Abs(pos) self.move_modules_commands[ind_move].emit(utils.ThreadCommand(command="move_Abs", attributes=[pos]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_ini_positions(self):\n try:\n positions=self.scan_moves[0]\n for ind_move,pos in enumerate(positions): #move all activated modules to specified positions\n # if pos[0]!=self.move_modules[ind_move].title: # check the module correspond to the name assigned in pos\n...
[ "0.7278717", "0.6633478", "0.61216366", "0.5976694", "0.5918757", "0.5745256", "0.57365614", "0.56655884", "0.56013227", "0.5571817", "0.55521065", "0.555039", "0.5546684", "0.55117404", "0.55053484", "0.5494978", "0.5477668", "0.54770064", "0.5414701", "0.54118055", "0.54023...
0.7948619
0
Find peak in filtered image
def peak_finder(filt_im, dist, threshold): from skimage.feature import peak_local_max coordinates = peak_local_max(filt_im, min_distance=dist, threshold_abs=threshold) return coordinates
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def peakdet2d(image):\n # define an 8-connected neighborhood\n neighborhood = generate_binary_structure(2,2)\n\n #apply the local maximum filter; all pixel of maximal value \n #in their neighborhood are set to 1\n local_max = maximum_filter(image, footprint=neighborhood)==image\n #local_max is a ...
[ "0.7611833", "0.75127107", "0.7351917", "0.72137237", "0.71414274", "0.7130999", "0.70705295", "0.68659514", "0.68234545", "0.68224365", "0.6820093", "0.67013717", "0.6689779", "0.6589693", "0.65794873", "0.6565677", "0.655181", "0.65445316", "0.64960223", "0.6448608", "0.644...
0.78542244
0
Creates vocabulary that is used to map BPEs to ids and viceversa. It iterates over data, performs tokenization with the BPE tokenizer and true caser and creates a vocabulary of unique symbols that is saved.
def create_bpe_vocabulary(bpe_vocab_fp, bpe_int_fp, data_path, truecaser_fp): bpe = BPE(glossaries=SPECIAL_TOKENS) bpe.load(bpcodes_fp=bpe_int_fp, merges=-1) tcaser = MosesTruecaser(load_from=truecaser_fp, is_asr=True) tcase_func = partial(tcaser.truecase, return_str=True, use_known=True) unsup_tok...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_vocab(data):\n # data = _read_words(filename)\n counter = collections.Counter(data)\n # print('counter', counter) # dictionary for the occurrence number of each word, e.g. 'banknote': 1, 'photography': 1, 'kia': 1\n count_pairs = sorted(counter.items(), key=lambda x: (-x[1], x[0]))\n # p...
[ "0.6357832", "0.62543017", "0.6113525", "0.6069173", "0.6017819", "0.6013648", "0.59880906", "0.5984867", "0.59745556", "0.5970316", "0.5963113", "0.59617347", "0.5948836", "0.5936401", "0.59178555", "0.59036773", "0.5891193", "0.5887666", "0.5862846", "0.58609784", "0.585865...
0.65041125
0
Creates a Converter class instance with the CommonAPIHandler class instance.
def __init__(self, common_api_handler): self.common_api_handler = common_api_handler
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def newConverter(self, value):\r\n return JsonConverter(value, self)", "def converters(self) -> Iterator[Tuple[str, Type[ConverterAPI]]]:", "def __init__(self, api_wrapper):\n\n self.api_wrapper = api_wrapper", "def __init__(self, client):\n self._client = client\n self._argument_...
[ "0.5562537", "0.53939396", "0.53782076", "0.53677505", "0.536641", "0.53500295", "0.53288835", "0.53207904", "0.5240729", "0.5229475", "0.5199164", "0.5126729", "0.5124941", "0.5108102", "0.51042795", "0.5092689", "0.5077401", "0.50703996", "0.50640655", "0.5028293", "0.50157...
0.6730362
0
Calculates the ACE of the model based on data (X,Y).
def ace(model, X, Y, n_bins=10, backend="google"): if backend is None: raise NotImplementedError elif backend == "prototype": raise NotImplementedError elif backend == "google": probabilities, labels = google_metric_formulation(model=model, X=X, Y=Y) metric_value = um.ace(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_accels (self):\n return (self.get_ax (), self.get_ay (), self.get_az ())", "def azizen(self):\n # x0,y0 array pixel coordinates relative to cx,cy\n# ndy0,ndx0=img.shape\n ndy0=self.ndy0\n ndx0=self.ndx0\n x0,y0=np.meshgrid(np.linspace(0,ndx0-1,ndx0)-self.cx,np.li...
[ "0.57355887", "0.5717503", "0.56428075", "0.5639411", "0.55450124", "0.54540753", "0.5409499", "0.53608996", "0.52965295", "0.52900827", "0.52363586", "0.5206994", "0.51986706", "0.51749134", "0.51666576", "0.51596075", "0.5145973", "0.5130768", "0.5117612", "0.5103825", "0.5...
0.6102737
0
Plugin main page. With list of all categories and search menu.
def index(request): main_menu = [ ( buildUrl(request.basePath(), {"path": "/search"}), xbmcgui.ListItem( label=xbmcaddon.Addon().getLocalizedString(30009), iconImage=getMediaResource("search.png"), path=buildUrl(request.basePath(), {"p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def categories_menu():\n categories = ['EU-affairs', 'Economy', 'Security', 'Society', 'World']\n\n for category in categories:\n url = build_url({'mode': 'Topic', 'foldername': category, 'page': 1})\n li = xbmcgui.ListItem(category, iconImage='DefaultFolder.png')\n xbmcplugin.addDirecto...
[ "0.6400513", "0.6388478", "0.60347533", "0.59958863", "0.599536", "0.58903766", "0.58873385", "0.58058244", "0.57688916", "0.57645106", "0.5745873", "0.5706889", "0.5670903", "0.5632183", "0.56179184", "0.560429", "0.5595375", "0.5581772", "0.55693513", "0.5544254", "0.550893...
0.659088
0
Print a recipe with the name `name` and return the instance
def get_recipe_by_name(self, name): for key, val in self.recipes_list.items(): for a, b in val.items(): if name == a: print(str(b))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_recipe_by_name(self, name):\n for key in self.recipe_list.keys():\n if name in self.get_recipes_by_types(key):\n for recipe in self.recipe_list[key]:\n if recipe.name == name:\n print(recipe.__str__())\n retur...
[ "0.6717745", "0.6291671", "0.6284392", "0.5784514", "0.5750448", "0.56267476", "0.561223", "0.5574568", "0.55019253", "0.5437774", "0.541985", "0.5411724", "0.53510624", "0.5349801", "0.5318898", "0.53134686", "0.529557", "0.52849776", "0.5276027", "0.52454233", "0.5224742", ...
0.65596545
1
Send a message when the command /reloadplayers is issued.
def reload_command(update: Update, context: CallbackContext) -> None: player.saveChatID(players) logger.info(f'Player chat ids have been saved in {config.CHAT_ID_JSON}') player.loadPlayers(players) logger.info(f'Players reloaded') update.message.reply_text(f'Players reloaded')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reload_player(id):\n global database\n table = database.Tables.players\n return get_query(table.select().where(table.c.id == id))", "async def update_players():\n if USERS:\n message = json.dumps({\"type\": \"update\", **GAME.get_state()})\n await asyncio.wait([user.send(message) fo...
[ "0.63851124", "0.63306063", "0.6239043", "0.60842466", "0.5970209", "0.58716434", "0.5787298", "0.57728904", "0.57372475", "0.5649972", "0.55818504", "0.5535778", "0.54864216", "0.5485581", "0.5465095", "0.54483074", "0.5431276", "0.5417135", "0.5363092", "0.535481", "0.53463...
0.7901673
0
Gets and sets the countryLetterCode
def country_letter_code(self): if "countryLetterCode" in self._prop_dict: return self._prop_dict["countryLetterCode"] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def country_code(self):\n return self.__country_code", "def country_code(self):\n return self.__country_code", "def get_country_code(self):\n\n return self.country_code", "def get_country_code(self):\n\n return self.country_code", "def get_country_code(self):\n\n return s...
[ "0.7646007", "0.7646007", "0.74890023", "0.74890023", "0.74890023", "0.74890023", "0.74890023", "0.74890023", "0.74890023", "0.74890023", "0.7042643", "0.70039976", "0.6958851", "0.6930168", "0.6893787", "0.68850124", "0.68850124", "0.68662137", "0.67749107", "0.67048216", "0...
0.8383952
0
Gets and sets the marketingNotificationEmails
def marketing_notification_emails(self): if "marketingNotificationEmails" in self._prop_dict: return self._prop_dict["marketingNotificationEmails"] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sender_email_notifications(self):\n return self._sender_email_notifications", "def signer_email_notifications(self):\n return self._signer_email_notifications", "def Emails(self, default=[None]):\n return self.data.get('emails', default)", "def sender_email_notifications(self, se...
[ "0.69371665", "0.6533384", "0.6434023", "0.6230268", "0.6194945", "0.61440927", "0.60741955", "0.60613334", "0.60301644", "0.59481335", "0.59359443", "0.58450764", "0.5823254", "0.5823014", "0.5646714", "0.5590484", "0.5568619", "0.55109143", "0.5490925", "0.54866195", "0.542...
0.8347074
0
Gets and sets the onPremisesLastSyncDateTime
def on_premises_last_sync_date_time(self): if "onPremisesLastSyncDateTime" in self._prop_dict: return datetime.strptime(self._prop_dict["onPremisesLastSyncDateTime"].replace("Z", ""), "%Y-%m-%dT%H:%M:%S.%f") else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_sync(self):\n return self.app.sync_thread.last_sync.strftime('%H:%M')", "def sync_time(self):\n return self.get_sync_time()", "def on_premises_sync_enabled(self):\n if \"onPremisesSyncEnabled\" in self._prop_dict:\n return self._prop_dict[\"onPremisesSyncEnabled\"]\...
[ "0.6325699", "0.587589", "0.5858154", "0.5858154", "0.5850004", "0.57757026", "0.57757026", "0.5724789", "0.5687654", "0.5652039", "0.5625669", "0.55714643", "0.55631775", "0.554318", "0.5526351", "0.5519201", "0.5501846", "0.5501846", "0.5501846", "0.5501846", "0.5501846", ...
0.80928105
1
Gets and sets the onPremisesSyncEnabled
def on_premises_sync_enabled(self): if "onPremisesSyncEnabled" in self._prop_dict: return self._prop_dict["onPremisesSyncEnabled"] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_ldp_sync_enabled(self):\n return self.__ldp_sync_enabled", "def _enable_sync(self, enable_sync: bool = True):\n self.__enable_sync = enable_sync", "def _set_ldp_sync_enabled(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=...
[ "0.6428073", "0.63226694", "0.62949497", "0.5958731", "0.5850597", "0.57621175", "0.5551877", "0.5549039", "0.5424617", "0.53538924", "0.5320379", "0.5318114", "0.53178996", "0.5295462", "0.5259373", "0.5244695", "0.52350914", "0.5211665", "0.5182246", "0.5170122", "0.5141607...
0.8503791
1
Gets and sets the privacyProfile
def privacy_profile(self): if "privacyProfile" in self._prop_dict: if isinstance(self._prop_dict["privacyProfile"], OneDriveObjectBase): return self._prop_dict["privacyProfile"] else : self._prop_dict["privacyProfile"] = PrivacyProfile(self._prop_dict["pri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_profile(self):\n endpoint = '/profile'\n return self.get_request(endpoint)", "def get_user_profile(self):\n return self.user.profile", "def getProfile(self):\n self.profile = LineContact(self, self._getProfile())\n\n return self.profile", "def profile(self) -> Profi...
[ "0.5970012", "0.5945452", "0.57073313", "0.5657435", "0.5657435", "0.56528354", "0.5645841", "0.5632789", "0.56322527", "0.55798125", "0.555526", "0.5460383", "0.54457045", "0.54457045", "0.5418339", "0.53700995", "0.536092", "0.53463423", "0.53403723", "0.5308688", "0.530533...
0.7585365
0
Gets and sets the securityComplianceNotificationMails
def security_compliance_notification_mails(self): if "securityComplianceNotificationMails" in self._prop_dict: return self._prop_dict["securityComplianceNotificationMails"] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def technical_notification_mails(self):\n if \"technicalNotificationMails\" in self._prop_dict:\n return self._prop_dict[\"technicalNotificationMails\"]\n else:\n return None", "def marketing_notification_emails(self):\n if \"marketingNotificationEmails\" in self._prop_...
[ "0.69751585", "0.6532241", "0.63405067", "0.61766267", "0.5517822", "0.53570926", "0.5327254", "0.529896", "0.5265682", "0.52485424", "0.52477956", "0.5233743", "0.5219979", "0.5212109", "0.51795435", "0.51341754", "0.5116517", "0.51135075", "0.50650805", "0.50360894", "0.501...
0.83950746
0
Gets and sets the securityComplianceNotificationPhones
def security_compliance_notification_phones(self): if "securityComplianceNotificationPhones" in self._prop_dict: return self._prop_dict["securityComplianceNotificationPhones"] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def security_compliance_notification_mails(self):\n if \"securityComplianceNotificationMails\" in self._prop_dict:\n return self._prop_dict[\"securityComplianceNotificationMails\"]\n else:\n return None", "def subscribed_osp_settings(self):\n return self._subscribed_osp...
[ "0.5857168", "0.47481012", "0.47196215", "0.47196215", "0.47196215", "0.46024665", "0.46012902", "0.4508265", "0.4456161", "0.44369522", "0.44339985", "0.44333518", "0.4388865", "0.43224573", "0.43134397", "0.4274985", "0.42672578", "0.42493713", "0.42413083", "0.4228379", "0...
0.8340764
0
Gets and sets the street
def street(self): if "street" in self._prop_dict: return self._prop_dict["street"] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def street(self, street):\n\n self._street = street", "def street(self):\n return self._street", "def street_address(self):\n if \"streetAddress\" in self._prop_dict:\n return self._prop_dict[\"streetAddress\"]\n else:\n return None", "def set_Street(self, va...
[ "0.783183", "0.7820453", "0.7319929", "0.7179174", "0.69076365", "0.68732244", "0.67973804", "0.67105806", "0.6677137", "0.6618805", "0.63332087", "0.63008875", "0.6294569", "0.62688804", "0.6228575", "0.62083244", "0.61282", "0.60469615", "0.5996438", "0.5996438", "0.5966137...
0.7868559
0
Gets and sets the technicalNotificationMails
def technical_notification_mails(self): if "technicalNotificationMails" in self._prop_dict: return self._prop_dict["technicalNotificationMails"] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def security_compliance_notification_mails(self):\n if \"securityComplianceNotificationMails\" in self._prop_dict:\n return self._prop_dict[\"securityComplianceNotificationMails\"]\n else:\n return None", "def marketing_notification_emails(self):\n if \"marketingNotific...
[ "0.72383255", "0.67024106", "0.6310228", "0.61527723", "0.58870727", "0.5678961", "0.5668604", "0.56506723", "0.56087625", "0.5606368", "0.55602396", "0.55281776", "0.5463542", "0.5450086", "0.54098886", "0.53999764", "0.5385844", "0.5371181", "0.5366454", "0.5366454", "0.536...
0.834292
0
Gets and sets the verifiedDomains
def verified_domains(self): if "verifiedDomains" in self._prop_dict: return VerifiedDomainsCollectionPage(self._prop_dict["verifiedDomains"]) else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def domains(self, domains):\n\n self._domains = domains", "def AllowedDomains(self)->list:\n return self._allowedDomains", "def domains(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"domains\")", "def actual_domains():\n domains = set([item.strip()\n for ...
[ "0.6851726", "0.64443517", "0.63583946", "0.63004833", "0.6298253", "0.62720436", "0.6231519", "0.62004226", "0.6135281", "0.608775", "0.60724044", "0.6070492", "0.6036177", "0.5973979", "0.5964414", "0.5957335", "0.5919933", "0.5915844", "0.588611", "0.5883396", "0.5857002",...
0.7317793
0
Gets and sets the mobileDeviceManagementAuthority
def mobile_device_management_authority(self): if "mobileDeviceManagementAuthority" in self._prop_dict: if isinstance(self._prop_dict["mobileDeviceManagementAuthority"], OneDriveObjectBase): return self._prop_dict["mobileDeviceManagementAuthority"] else : s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phone_mobile(self, instance):\r\n return instance.user.profile.phone_mobile", "def mobile_phone(self):\n if \"mobilePhone\" in self._prop_dict:\n return self._prop_dict[\"mobilePhone\"]\n else:\n return None", "def mobile_phone(self):\n if \"mobilePhone\" i...
[ "0.4749059", "0.4726899", "0.4726899", "0.4723475", "0.4704215", "0.46767765", "0.4548445", "0.4494811", "0.44466412", "0.44466412", "0.44455937", "0.4413021", "0.43985566", "0.43943882", "0.43872052", "0.437152", "0.4362718", "0.43555802", "0.43432292", "0.43409374", "0.4315...
0.8321553
0
Test case for resource_user_resource_add_user_groups_for_user_post
def test_resource_user_resource_add_user_groups_for_user_post(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_users_groups_post(self):\n pass", "def test_resource_user_resource_set_user_groups_for_user_put(self):\n pass", "def test_resource_user_resource_add_users_post(self):\n pass", "def test_resource_user_resource_add_user_post(self):\n pass", "def test_api_v1_groups_post(se...
[ "0.82436454", "0.81671906", "0.74460876", "0.73422563", "0.7304262", "0.73025596", "0.7296159", "0.713983", "0.70329434", "0.70329434", "0.6849084", "0.6840059", "0.67962676", "0.6764818", "0.6713147", "0.6695165", "0.6665931", "0.6661961", "0.6651971", "0.66383326", "0.66298...
0.949568
0
Test case for resource_user_resource_add_user_post
def test_resource_user_resource_add_user_post(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_resource_user_resource_add_users_post(self):\n pass", "def test_add_user(self):\n pass", "def test_post_user_post(self):\n pass", "def test_api_user_post(self):\n pass", "def test_resource_user_resource_add_user_groups_for_user_post(self):\n pass", "def test_us...
[ "0.883399", "0.7554905", "0.7362358", "0.7336772", "0.72329384", "0.72166926", "0.72166926", "0.71635604", "0.6990422", "0.6944165", "0.6894131", "0.68870056", "0.6824432", "0.68076354", "0.68076354", "0.68076354", "0.6781031", "0.67799467", "0.6756481", "0.6751568", "0.6748"...
0.93442345
0
Test case for resource_user_resource_add_users_post
def test_resource_user_resource_add_users_post(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_resource_user_resource_add_user_post(self):\n pass", "def test_users_post(self):\n pass", "def test_users_post(self):\n pass", "def test_add_user(self):\n pass", "def test_resource_user_resource_add_user_groups_for_user_post(self):\n pass", "def test_post_users...
[ "0.9141933", "0.75679886", "0.75679886", "0.75640416", "0.7506603", "0.74060404", "0.7228901", "0.7180535", "0.7083268", "0.7073483", "0.7039329", "0.7013013", "0.6911373", "0.68960893", "0.68714774", "0.682104", "0.6790674", "0.67737126", "0.67651474", "0.67651474", "0.67651...
0.9336231
0
Test case for resource_user_resource_change_user_avatar_patch
def test_resource_user_resource_change_user_avatar_patch(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_resource_user_resource_get_avatar_file_get(self):\n pass", "def test_resource_user_resource_change_user_patch(self):\n pass", "def test_user_avatar_serving(self):\n User = get_user_model()\n test_user = User.objects.create_user('Bob', 'bob@bob.com', 'pass123',\n ...
[ "0.7562802", "0.7389839", "0.6715897", "0.60947317", "0.60880405", "0.6087778", "0.6076995", "0.60552335", "0.6042653", "0.6041773", "0.6028372", "0.6022853", "0.6014988", "0.5976914", "0.59176534", "0.59106654", "0.5886265", "0.58843976", "0.5870331", "0.58677554", "0.586704...
0.95680916
0
Test case for resource_user_resource_change_user_patch
def test_resource_user_resource_change_user_patch(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_patch_user(self):\n pass", "def test_resource_user_resource_change_user_avatar_patch(self):\n pass", "def test_update_user(self):\n pass", "def test_patch_user(self):\n new_user = self.make_user('new_user')\n url = reverse(\n 'projectroles:api_role_updat...
[ "0.78669316", "0.76529086", "0.7445579", "0.719746", "0.7120976", "0.7110063", "0.7032789", "0.69978964", "0.6989593", "0.6931952", "0.69096875", "0.69092476", "0.6884571", "0.6873923", "0.68736744", "0.6841495", "0.6838705", "0.67565453", "0.6710545", "0.6630291", "0.6619691...
0.94681674
0
Test case for resource_user_resource_find_users_get
def test_resource_user_resource_find_users_get(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_resource_user_resource_get_user_get(self):\n pass", "def test_resource_user_resource_get_user_by_email_address_get(self):\n pass", "def test_resource_user_resource_get_current_user_get(self):\n pass", "def test_users_get(self):\n pass", "def test_users_get(self):\n ...
[ "0.8451211", "0.7752305", "0.77465975", "0.7734184", "0.7734184", "0.7529441", "0.74243814", "0.7295259", "0.72327244", "0.71953094", "0.7041438", "0.6882189", "0.684746", "0.6764927", "0.67365676", "0.6709953", "0.6689331", "0.6677777", "0.6628603", "0.6623493", "0.6618926",...
0.9211182
0
Test case for resource_user_resource_get_avatar_file_get
def test_resource_user_resource_get_avatar_file_get(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_resource_user_resource_change_user_avatar_patch(self):\n pass", "def test_user_avatar_serving(self):\n User = get_user_model()\n test_user = User.objects.create_user('Bob', 'bob@bob.com', 'pass123',\n set_default_avatar=True)\n\n av...
[ "0.7323743", "0.6877225", "0.6818644", "0.6498818", "0.6493186", "0.63726944", "0.6352777", "0.63323724", "0.6304216", "0.6296056", "0.628039", "0.62724555", "0.61974806", "0.6175622", "0.6132429", "0.6130371", "0.6130324", "0.6102433", "0.6083106", "0.60774434", "0.6063673",...
0.95785964
0
Test case for resource_user_resource_get_current_user_get
def test_resource_user_resource_get_current_user_get(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_resource_user_resource_get_user_get(self):\n pass", "def test_get_current(self):\n self.assertEqual(api.user.get_current().getUserName(), TEST_USER_NAME)", "def test_resource_user_resource_find_users_get(self):\n pass", "def get(self):\r\n return get_user(request)", "de...
[ "0.8418081", "0.74915165", "0.72019815", "0.7007737", "0.6998898", "0.695637", "0.6839162", "0.6838583", "0.6736907", "0.67333174", "0.6719712", "0.67011625", "0.66943836", "0.6677189", "0.66528165", "0.66169584", "0.6552954", "0.65320903", "0.649906", "0.6491142", "0.6487751...
0.94497687
0
Test case for resource_user_resource_get_user_by_email_address_get
def test_resource_user_resource_get_user_by_email_address_get(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_user_by_emailuser_email_get(self):\n pass", "def test_resource_user_resource_get_user_get(self):\n pass", "def user(email):\r\n return User.objects.get(email=email)", "def test_get_user(user_store: MockStore, user_email: str):\n # GIVEN a database with a user\n\n # WHEN qu...
[ "0.86324656", "0.75253284", "0.72573936", "0.71740294", "0.7146205", "0.7137798", "0.7132184", "0.7113488", "0.70112", "0.70053416", "0.7004624", "0.6986397", "0.6980885", "0.69266295", "0.68897694", "0.68832684", "0.68475723", "0.6841938", "0.68417424", "0.68409705", "0.6803...
0.9579092
0
Test case for resource_user_resource_get_user_get
def test_resource_user_resource_get_user_get(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_resource_user_resource_get_current_user_get(self):\n pass", "def test_resource_user_resource_find_users_get(self):\n pass", "def test_resource_user_resource_get_user_by_email_address_get(self):\n pass", "def test_api_user_get(self):\n pass", "def test_get_user(self):\n ...
[ "0.89160436", "0.8220227", "0.7937708", "0.76886445", "0.7485996", "0.73820853", "0.72005", "0.7096893", "0.7096893", "0.69726586", "0.6945443", "0.6902139", "0.68669623", "0.68625176", "0.6857196", "0.685426", "0.68481326", "0.6848064", "0.6813843", "0.68119854", "0.6787243"...
0.92044413
0
Test case for resource_user_resource_remove_user_from_user_groups_delete
def test_resource_user_resource_remove_user_from_user_groups_delete(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_groups_group_users_user_delete(self):\n pass", "def test_groups_group_users_user_delete(self):\n pass", "def test_deluser(self):\n self.run_function(\"group.add\", [self._group], gid=self._gid)\n self.run_function(\"user.add\", [self._user])\n self.run_function(\"gro...
[ "0.8203382", "0.8203382", "0.805757", "0.8017475", "0.7963476", "0.78263724", "0.78263724", "0.782173", "0.7564547", "0.7356291", "0.7356291", "0.72409266", "0.7238935", "0.72285354", "0.72242224", "0.7204366", "0.7199144", "0.71891713", "0.71857566", "0.7139048", "0.7114398"...
0.9579116
0
Test case for resource_user_resource_set_user_groups_for_user_put
def test_resource_user_resource_set_user_groups_for_user_put(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_resource_user_resource_add_user_groups_for_user_post(self):\n pass", "def test_groups_group_users_put(self):\n pass", "def test_groups_group_users_put(self):\n pass", "def test_resource_user_resource_remove_user_from_user_groups_delete(self):\n pass", "def test_users_gr...
[ "0.80913395", "0.80515426", "0.80515426", "0.68639123", "0.685416", "0.6789936", "0.67439145", "0.66826963", "0.66794705", "0.66288406", "0.6604435", "0.65601975", "0.65593284", "0.6556658", "0.65404123", "0.6524204", "0.6517538", "0.64963746", "0.6454848", "0.64492613", "0.6...
0.9488719
0
Test that batch Reads will allow read_all_bins with no ops
def test_batch_read_all_bins_pos(self): b = br.Read(("test", "demo", 1), ops=None, read_all_bins=True) assert b.read_all_bins
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_block_missing_batch(self):\n pass", "def test_reading_counter_without_batching(self):\n self._test_reading_counter_template(copy_options={'MAXBATCHSIZE': '1'})", "def test_block_bad_batch(self):\n pass", "def test_batch(self):\n pass", "def has_full_batch(self) -> bool:...
[ "0.6690717", "0.6221007", "0.6105783", "0.59919345", "0.5908246", "0.58860576", "0.58761734", "0.584706", "0.57898694", "0.56910086", "0.5677327", "0.5672258", "0.5624047", "0.5601044", "0.56001467", "0.55973536", "0.55933803", "0.5525978", "0.55243194", "0.5496909", "0.54945...
0.817219
0
Test that batch Reads will always use a new batch_records list.
def test_batch_default_arg_pos(self): b = br.Read(("test", "demo", 1), ops=None) bwr = br.BatchRecords() bwr.batch_records.append(b) assert len(bwr.batch_records) == 1 bwr = br.BatchRecords() assert len(bwr.batch_records) == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_batch(self):\n pass", "def test_batches_are_accessible(\n monkeypatch,\n multibatch_generic_csv_generator,\n multibatch_generic_csv_generator_context,\n):\n\n context: DataContext = multibatch_generic_csv_generator_context\n data_relative_path = \"../data\"\n data_path = os.path...
[ "0.67201746", "0.6547219", "0.64617795", "0.63159215", "0.62892824", "0.62672013", "0.62574714", "0.612008", "0.61138254", "0.6076384", "0.6040956", "0.603392", "0.6027112", "0.60223246", "0.5984337", "0.596963", "0.5913834", "0.59047127", "0.58905107", "0.5845407", "0.584176...
0.6759463
0
Update the factors, resulting in change in the dimensions
def onUpdateFactors(self, evt): if self.blockFactorUpdate: print "Blocking factor update" return x, y, z = self.dataUnits[0].dataSource.getOriginalDimensions() fx = 1 fy = 1 fz = 1 try: fx = float(self.factorX.GetValue()) fy = float(self.factorY.GetValue()) fz = float(self.factorZ.GetValue())...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rebalance(self):\n\n # Compute norms along columns for each factor matrix\n norms = [np.linalg.norm(f, axis=0) for f in self.factors]\n\n # Multiply norms across all modes\n lam = np.prod(norms, axis=0) ** (1/self.ndim)\n\n # Update factors\n self.factors = [f * (lam /...
[ "0.6571209", "0.6276669", "0.62764835", "0.6115042", "0.60019165", "0.60013884", "0.594291", "0.59389067", "0.5907155", "0.5843025", "0.5711148", "0.5672419", "0.5652959", "0.5652877", "0.5635358", "0.55926377", "0.55566674", "0.55367833", "0.55367833", "0.5536621", "0.553272...
0.68815076
0
Creates the GUI for setting the resampled size
def createResample(self): box = wx.StaticBox(self, -1, "Resample now to") self.currDimText = u"Current dataset original dimensions: %d x %d x %d" self.dimsLbl = wx.StaticText(self, -1, self.currDimText % (0, 0, 0)) boxsizer = wx.StaticBoxSizer(box, wx.VERTICAL) panel = wx.Panel(self, -1) boxsizer.Add(pan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Pane_Resized( self, new_sizes ):\r\n if(new_sizes[0] > 200 ):\r\n cb.xtotal = new_sizes[0]-100\r\n self.canvas_one.config(width = new_sizes[0])\r\n self.canvas_scale.config(width = new_sizes[0])\r\n else:\r\n cb.xtotal = 200-100\r\n self.canv...
[ "0.6498354", "0.63386226", "0.6295219", "0.6207969", "0.6043354", "0.60301924", "0.60260755", "0.60126054", "0.6000474", "0.5969267", "0.5954346", "0.5932289", "0.5930187", "0.5924253", "0.5905372", "0.59038717", "0.58730376", "0.5864292", "0.5850218", "0.58474237", "0.584617...
0.73525316
0
Select a half size to be used for resampling
def onSetToHalfSize(self, evt): self.halfResampleZ.Enable(1) if self.dataUnits: x, y, z = self.dataUnits[0].dataSource.getOriginalDimensions() zf = 1 if self.halfResampleZ.GetValue(): zf = 0.5 self.currSize = int(0.5 * x), int(0.5 * y), int(zf * z) self.fourthResampleZ.Enable(0) for obj in [...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def downsample_sam(self, factor):", "def subsample(y, limit=256, factor=2):\n if len(y) > limit:\n return y[::factor].reset_index(drop=True)\n return y", "def downsample(state):\n return state[::2, ::2, :]", "def get_resized_sub_sample(self, off_x, off_y):\n sub_sample = self.original[...
[ "0.66821367", "0.6283318", "0.59744126", "0.5961904", "0.5954585", "0.5949425", "0.59060234", "0.5834289", "0.5813429", "0.57990295", "0.57953787", "0.5726417", "0.5719342", "0.57168734", "0.5709625", "0.569461", "0.56766534", "0.5663706", "0.56595075", "0.56507003", "0.56502...
0.66162187
1
Select a fourth size to be used for resampling
def onSetToFourthSize(self, evt): self.halfResampleZ.Enable(0) self.fourthResampleZ.Enable(1) if self.dataUnits: zf = 1 x, y, z = self.dataUnits[0].dataSource.getOriginalDimensions() if self.fourthResampleZ.GetValue(): zf = 0.25 self.currSize = int(0.25 * x), int(0.25 * y), int(zf * z) fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def downsample_sam(self, factor):", "def sample(self, size=1):\n pass", "def reduce_sample_size(data,classes,times=2):\n data=data[range(0,data.shape[0],times)]\n classes=classes[range(0,classes.shape[0],times)]\n return data,classes", "def _choose_sample(self):\n\n \t #periodically gene...
[ "0.6436063", "0.6256925", "0.6241231", "0.6079577", "0.598289", "0.598289", "0.598289", "0.598289", "0.5905832", "0.5845936", "0.5776135", "0.57633346", "0.56861585", "0.5645118", "0.5645118", "0.55884224", "0.55766916", "0.5545338", "0.5502274", "0.5496958", "0.5489562", "...
0.6551757
0
Return True if the image i2 can be to the right of i1.
def right(i1, i2): return "".join([i1[row][-1] for row in range(len(i1))]) == "".join( [i2[row][0] for row in range(len(i2))] )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_right(self):\n if self.pupils_located:\n return self.horizontal_ratio() <= 0.35", "def _has_right(self, j):\n return (2 * j + 2) < len(self)", "def isRight(self):\n\t\tif self.sq(self.a) == self.sq(self.b) + self.sq(self.c):\n\t\t\treturn True\n\t\telif self.sq(self.b) == self.s...
[ "0.6519159", "0.6493096", "0.6476172", "0.62810856", "0.6208851", "0.61317664", "0.61116636", "0.6103508", "0.6087532", "0.5999861", "0.5941688", "0.5938497", "0.59380716", "0.58896476", "0.58713394", "0.5852274", "0.5774916", "0.577145", "0.57683116", "0.57450664", "0.573638...
0.6787813
0
Converts w_global to the same dtype as w_client. PFNM procedure changes the dtype causing discrepancies between data dtype and model dtype.
def change_global_dtypes(w_global, w_client): result = [] for i in range(len(w_client)): dtype = w_client[i].dtype result.append(w_global[i].astype(dtype)) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_global_weights(self, global_weights):\n self.global_transform.from_vector_inplace(global_weights)", "def _update_dtype(self) -> None:\n self.inv_eps = np.array([self.inv_eps]).astype(self.dtype)[0]", "def convert_global_weights(global_weights: Mapping, local_var_dict: MutableMapping) ...
[ "0.5540853", "0.548035", "0.5475646", "0.54616445", "0.51597744", "0.51043653", "0.5094637", "0.5069668", "0.5053623", "0.5016467", "0.49652094", "0.49614197", "0.48584414", "0.4852252", "0.48344487", "0.48159397", "0.4805115", "0.4801537", "0.48007137", "0.47899008", "0.4788...
0.80209565
0
Computes the network dimensions from the its weights
def compute_net_dimensions(weights): new_dims = [] for i in range(1, len(weights), 2): new_dims.append(weights[i].shape[0]) return new_dims
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_weight_dimensions(weight_shape: np.array) -> np.array:\n dims = len(weight_shape)\n if dims == 4:\n return weight_shape\n return np.append(weight_shape, [1 for _ in range(4 - dims)]).astype(int)", "def __find_net_dims(self):\n\n input_params = INPUT_CHANNELS * INPUT_SIZE ** 2\n ...
[ "0.7643601", "0.7434242", "0.7021509", "0.6931846", "0.6924991", "0.6769189", "0.67655206", "0.6704349", "0.66596615", "0.66505307", "0.6592454", "0.6532682", "0.65255284", "0.65240663", "0.6487564", "0.64749146", "0.64721304", "0.646667", "0.64608335", "0.6393854", "0.637714...
0.8552961
0
Compute GMM models for each digit
def eachDigitGMM(data, cfg): models = {} for j in range(len(data)): train_set = data[j][0] for i in range(1, len(data[j])): train_set = np.concatenate((train_set, data[j][i]), axis=0) estimator = GaussianMixture(n_components=cfg['components'], max_iter=cfg['max_iter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\r\n parametrized_data = loadData('files/parametrized.p')\r\n config = loadConfig('config/gmm.cfg')\r\n\r\n data_ = eachDigitGMM(parametrized_data, config)\r\n\r\n save(data_)", "def gmm(X, k):\n mix = sklearn.mixture.GaussianMixture(n_components=k).fit(X)\n pi = mix.weights_\n m ...
[ "0.6906623", "0.661936", "0.64382786", "0.62845135", "0.60806674", "0.593841", "0.58753103", "0.5845131", "0.58379036", "0.5826022", "0.5762026", "0.5756516", "0.5720188", "0.56962246", "0.5648508", "0.56253916", "0.5614218", "0.5571951", "0.557083", "0.5570502", "0.55684984"...
0.7731218
0
Creates a cuboid from min coordinates and max coordinates, scales it by a scale factor. min and max ara opposite corners of the final cuboid
def __cuboid(cls, min: np.ndarray, max: np.ndarray, scale: float = 1.) -> np.ndarray: max = max.flatten() min = min.flatten() avg = (max + min) / 2 cube = np.zeros((8, 3), dtype=float) cube[0] = (np.array([max[0], max[1], max[2]], dtype=float) - avg) * scale + avg cube[1]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_array(cube, new_max, new_min):\n minimum, maximum = np.min(cube), np.max(cube)\n if maximum - minimum != 0:\n m = (new_max - new_min) / (maximum - minimum)\n b = new_min - m * minimum\n cube = m * cube + b\n return cube", "def scale(self, from_min, from_max, to_min, to...
[ "0.60914046", "0.57667685", "0.5735776", "0.5717235", "0.5637005", "0.56177884", "0.5605949", "0.5592936", "0.55222833", "0.55189645", "0.5509211", "0.550672", "0.5426835", "0.54249674", "0.5418421", "0.541573", "0.54125637", "0.54057217", "0.54026675", "0.5391674", "0.536245...
0.7557332
0
Match this set of Nodes to target set of nodes based on their coordinates (distance) if nodeID is supplied, find the closest nodes to this node or a list of nodes Returns the node ids from target that are closest to this set of nodes and the distance of the found nodes if selected
def match(self, nodes, nodeID: int | list = None, distances: bool = False) -> list: if nodeID is None: source = self.toarray() source_keys = self.keys() elif type(nodeID) is int: source = self[nodeID].coors.reshape(1, 3) source_keys = [nodeID] elif...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findClosestNodes(self, target: hash.hash.Hash):\n # TODO: make more efficient\n # See: http://stackoverflow.com/questions/30654398/implementing-find-node-on-torrent-kademlia-routing-table\n \n nodes = []\n \n for bucket in self.buckets:\n nodes = nodes + buc...
[ "0.62708193", "0.6021189", "0.59817636", "0.5910058", "0.5903073", "0.5894784", "0.5860802", "0.5795183", "0.5762382", "0.5749643", "0.5712168", "0.56886685", "0.56831497", "0.5669823", "0.56181604", "0.556276", "0.55174476", "0.54817003", "0.5468962", "0.545016", "0.5425786"...
0.7419687
0
Creates a permutation matrix for node ordering using a Reverse CuthillMcKee algorithm
def reverse_cuthill_mckee(self, permutation: bool = True) -> [np.ndarray, np.ndarray]: # 1. get the connectivity matrix nodeids, C = self.node_connectivity_matrix() # 2. compute the new node order perm = scipy.sparse.csgraph.reverse_cuthill_mckee(C, False) # 3. create a diction...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rcm_perm(adj_mat):\n _adj_mat = _preprocess(adj_mat)\n graph = csr_matrix(_adj_mat)\n idx = reverse_cuthill_mckee(graph, symmetric_mode=True)\n return reorder(adj_mat, idx)", "def permutation_matrix(order):\n matrix = np.zeros([order,order])\n matrix[-1,0] = 1\n matrix[0:-1,1::] = np.ide...
[ "0.69158185", "0.65334654", "0.6261852", "0.61041516", "0.5897336", "0.5834572", "0.58315396", "0.5738542", "0.57123655", "0.5679085", "0.56454927", "0.5638909", "0.56346756", "0.5628682", "0.56044054", "0.55797595", "0.55649453", "0.55566525", "0.55533034", "0.5550322", "0.5...
0.75701296
0
Check if fetched series is really in series dict.
def test_seriesdict(self): series = self.tvdb.get_series('seinfeld') assert self.tvdb.sid_series[series['id']] == series
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_charts(self):\n return self.__charts is not None", "def _exists(self) -> bool:\n client = MlflowClient()\n all_metrics = client._tracking_client.store.get_all_metrics(\n run_uuid=self.run_id\n )\n return any(self._is_dataset_metric(x) for x in all_metrics)", ...
[ "0.583036", "0.5771205", "0.5721502", "0.56829405", "0.5610772", "0.56102914", "0.55929446", "0.55716205", "0.5556868", "0.5543703", "0.5533181", "0.55242735", "0.5513683", "0.55048233", "0.5499089", "0.5489801", "0.5489597", "0.5480643", "0.5466936", "0.54631066", "0.5451241...
0.6420335
0
Returns a trained sklearn pipeline of [csp, lda]
def get_trained_CSP_LDA(data, labels, window_size=None, preprocessing=LowpassWrapper(), step_size=None): # slide window over trial data to generate many more data points if step_size and window_size and window_size < data.shape[-1]: data, labels = get_windows(data, labels, window_size, step_size) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_sklearn(self):\n import sklearn.pipeline as skp\n\n steps = []\n for step in self.steps:\n steps += [(step[0], step[1].to_sklearn())]\n return skp.Pipeline(steps)", "def create(pdef):\n from sklearn.pipeline import Pipeline\n return [Pipeline(p) for p in pdef]"...
[ "0.7025629", "0.69190943", "0.67792165", "0.6730748", "0.670529", "0.6454828", "0.636034", "0.6229045", "0.618576", "0.6156404", "0.611859", "0.5985514", "0.59795904", "0.5978339", "0.59732825", "0.59604967", "0.5957266", "0.5932507", "0.5930365", "0.5898609", "0.5893132", ...
0.71815854
0
takes the output form a WindowInlet and returns the probability (according to the csp+lda classifier) that the right hand was imagined
def predict_proba(self, window: np.array): data = np.transpose(np.array(window))[self.data_channels] print('data shape in wrapped:', data.shape) proba = self.clf.predict_proba(data) return proba[0][1] # proba = [[prob_left, prob_right]]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _window_hitprobability(self, x, y):\n hm_count = np.zeros_like(y).astype(float)\n hm = np.zeros_like(y).astype(float)\n #skf = StratifiedShuffleSplit(n_splits=self.n_iter, test_size=self.shuffle_test_split, random_state=self.random_state)\n skf = StratifiedShuffleSplit(n_splits=self...
[ "0.62477136", "0.60458094", "0.59196264", "0.5856302", "0.58170736", "0.5776016", "0.5736325", "0.57336974", "0.56787926", "0.56502336", "0.5624942", "0.55831456", "0.55803436", "0.55753154", "0.55709046", "0.55685145", "0.5566319", "0.552953", "0.5490147", "0.54789966", "0.5...
0.6419543
0
calls fit(data, labels) on the csp+lda classifier
def fit(self, data, labels): self.clf.fit(data, labels)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit(self, data: np.array, labels: np.array):\n raise NotImplementedError", "def fit(self, data):\n self.labels = np.array(data['class'])\n self.num_classes = len(data['class'].unique())\n self.all_classes = np.sort(np.unique(self.labels))\n # populating the features datafra...
[ "0.6964673", "0.6742371", "0.6725926", "0.66971344", "0.66852725", "0.663152", "0.6579634", "0.65666497", "0.64772695", "0.64772695", "0.64389485", "0.64251614", "0.6423606", "0.64139354", "0.63765246", "0.6369041", "0.63476217", "0.63209647", "0.6289308", "0.6281771", "0.627...
0.74599844
0
Validate the number of arguments and call a delegate handler.
def processcmd(command, args, expected_nargs, delegate): if len(args) != expected_nargs: raise FormatError("Wrong number of arguments for '" + command + "', expected " + str(expected_nargs) + " but got " + str(len(args))) delegate(userdata, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accept_arguments(method, number_of_arguments=1):\n if 'method' in method.__class__.__name__:\n number_of_arguments += 1\n func = getattr(method, 'im_func', getattr(method, '__func__'))\n func_defaults = getattr(func, 'func_defaults', getattr(func, '__defaults__'))\n number_of_def...
[ "0.57729924", "0.5719926", "0.5693527", "0.56088734", "0.5534906", "0.54928994", "0.54834074", "0.5414944", "0.5400435", "0.5389888", "0.5379765", "0.53202635", "0.530763", "0.5304636", "0.5287145", "0.52742493", "0.5270792", "0.5256097", "0.5236908", "0.52355695", "0.5228352...
0.58143497
0
Transform the raw devlist into a human readable list.
def devlist_handler(userdata, *args): for (dev, connected) in database.devlist(userdata["cursor"]): if dev == "devmaster": continue if connected: print(shlex.quote("+" + dev), end=" ") else: print(shlex.quote("-" + dev), end=" ") print()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _output_vadapter_list_verbose(outf, name, vadapter_list):\n\n if vadapter_list:\n FMT = \"%s\\n%-10s\\n%-20s\\n%-5s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n\"\n# HEADER = (\"id\",\"name\",\"io_module_id\",\"vfabric_id\",\"protocol\",\"init_type\",\"desc\",\"status\...
[ "0.62227356", "0.5772413", "0.57569736", "0.5707236", "0.5700806", "0.56800795", "0.5655333", "0.5608158", "0.55705553", "0.5569611", "0.55440795", "0.5537111", "0.5448807", "0.5446118", "0.5439977", "0.5417143", "0.54102635", "0.5405327", "0.5382883", "0.53770655", "0.537642...
0.60405725
1
Transform the raw guestlist into a human readable list.
def guestlist_handler(userdata, *args): for guest in userdata["guestlist"]: print(shlex.quote(guest), end=" ") print()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_list(self, desc, lst, writeln):\n if not lst:\n return\n val = ', '.join([list_escape(v) for v in lst])\n writeln(\"%s: %s\" % (desc, val))", "def list_to_text(ingridients_list):\n to_return = \"List\\n\"\n for (ingridient, quantity) in ingridients_list:\n to...
[ "0.5813186", "0.5700969", "0.56966585", "0.5681182", "0.56655324", "0.5646942", "0.5607249", "0.5601681", "0.55947936", "0.5556963", "0.5547201", "0.55394006", "0.551841", "0.5476773", "0.5473723", "0.54715216", "0.5467049", "0.54641753", "0.54640037", "0.54564065", "0.545640...
0.63324744
0
retrieve information about organization
def fetch_organization(organization): return fetch_json(organization_url, organization)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_retrieve_l_organization(self):\n pass", "def test_get_organization(self):\n pass", "def org_info(self):\n\n response = self.postman.request('info')\n\n if (response.status_code == requests.codes.ok):\n data = response.json()\n\n self.repos = data['publ...
[ "0.7663464", "0.7498538", "0.742738", "0.72355056", "0.6984059", "0.6942441", "0.68556046", "0.6813534", "0.6796668", "0.67712766", "0.66672313", "0.6606143", "0.6533429", "0.6531706", "0.6509286", "0.6505963", "0.64864504", "0.6475964", "0.64553684", "0.64510405", "0.6366222...
0.75476795
1
retrieve information about funding round
def fetch_funding_round(uuid): return fetch_json(funding_round_url, uuid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_furniture():", "def get_ReddCoin_info(wallet: str, info: dict):\r\n\tresp = requests.get('https://live.reddcoin.com/api/addr/' + wallet)\r\n\tif resp.status_code == 200:\r\n\t\tresponse = json.loads(resp.text)\r\n\t\tinfo['received'] = float(response['totalReceived'])\r\n\t\tinfo['received_dollars'] = in...
[ "0.58193326", "0.56235486", "0.5595207", "0.5539969", "0.5518017", "0.5504899", "0.54936755", "0.5480481", "0.5456606", "0.53925306", "0.538725", "0.5352123", "0.53428936", "0.5233922", "0.5222662", "0.52174175", "0.5200093", "0.51958585", "0.5187113", "0.51531327", "0.514449...
0.69011307
0
retrieve org logo url location
def fetch_logo_url(organization): return fetch_json(image_url, organization)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logo_url(self):\n return self.get_url(\"logo\", \"images/logo.png\")", "def logo_url(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"logo_url\")", "def logo_url(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"logo_url\")", "def logo_uri(self) -> str:\n return...
[ "0.73948944", "0.7267919", "0.7267919", "0.722876", "0.7195375", "0.7034044", "0.68424994", "0.6792979", "0.6792979", "0.6786109", "0.6786109", "0.6753788", "0.66230005", "0.6607808", "0.6594823", "0.65504336", "0.65054303", "0.65054303", "0.645779", "0.6434796", "0.64087206"...
0.76190805
0
r"""Calculates and stores range stats with forward values. Args
def _calculate_range_stats(self, x_copy): # get the min, max values of the data min_val_cur, max_val_cur = torch.aminmax(x_copy) # calculate new epoch range values epoch_min_val = torch.min(self.epoch_activation_min, min_val_cur) epoch_max_val = torch.max(self.epoch_activation_m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateRange(self):\n if self.autoFollow:\n self.xrange = self.param.activeRange()\n self.xrange = self.xrange # call getter & setter again to verify limits", "def range(self) -> ty.Tuple[float, float]:\r\n ...", "def range(self):\n\n return time_stat(self, stat=\"range\")...
[ "0.63491815", "0.6051725", "0.6040286", "0.6033649", "0.59845704", "0.5981012", "0.57792556", "0.57289696", "0.5723835", "0.5707534", "0.5624634", "0.5598468", "0.5587254", "0.55702907", "0.5562683", "0.55540055", "0.5521237", "0.5515974", "0.55151474", "0.54963857", "0.54827...
0.6593853
0
r"""Calculates and stores the per_channel min, max stats with forward values.
def _calculate_min_max_stats(self, x_copy): # get the current min and max vals min_val = self.min_val max_val = self.max_val x_dim = x_copy.size() new_axis_list = [i for i in range(len(x_dim))] # noqa: C416 new_axis_list[self.ch_axis] = 0 new_axis_list[0] = self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nudged_min_max_compute(min_broadcast, max_broadcast, num_bits, narrow_range):\n\n\n dtype = min_broadcast.dtype\n quant_min = 1 if narrow_range else 0\n quant_max = (2 ** num_bits) - 1\n\n # because of need compute each channel, so quant_min and quant_max need to broadcast.\n quant_min_float = t...
[ "0.59609085", "0.5887487", "0.588346", "0.58295965", "0.5721455", "0.5709935", "0.56678444", "0.54986614", "0.5493992", "0.5468857", "0.54509926", "0.5431024", "0.5413653", "0.54097015", "0.54077744", "0.54034144", "0.54014933", "0.54001987", "0.5393418", "0.53803116", "0.534...
0.67637366
0
Tests a progress value source cannot refer to the current section or the current block
def test_invalid_current_location_progress(): schema_path = ( "schemas/invalid/test_invalid_progress_value_source_current_location.json" ) questionnaire_validator = QuestionnaireValidator( _open_and_load_schema_file(schema_path) ) questionnaire_validator.validate() expected_erro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_non_linear_progress_references():\n schema_path = \"schemas/invalid/test_invalid_progress_value_source_non_linear.json\"\n questionnaire_validator = QuestionnaireValidator(\n _open_and_load_schema_file(schema_path)\n )\n questionnaire_validator.validate()\n\n expected_error_m...
[ "0.5731956", "0.5678855", "0.5546579", "0.55384487", "0.5506011", "0.54968566", "0.549316", "0.5454782", "0.54516715", "0.5400708", "0.5395454", "0.5379806", "0.5356293", "0.5338861", "0.5338861", "0.5338861", "0.5338861", "0.53379166", "0.53287905", "0.5304942", "0.5277991",...
0.62779844
0
Tests a progress value source cannot refer to a block in a repeating section except if it is the parent seciont of the value source Nor to a repeating section
def test_invalid_block_in_repeating_section(): schema_path = "schemas/invalid/test_invalid_progress_value_source_block_in_past_repeating_section.json" questionnaire_validator = QuestionnaireValidator( _open_and_load_schema_file(schema_path) ) questionnaire_validator.validate() expected_erro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_value_source_dependency_enable_section_by_progress_hub_flow(self):\n\n self.launchSurvey(\"test_progress_value_source_section_enabled_hub\")\n\n self.assertInBody(\"Choose another section to complete\")\n self.assertInBody(\"Section 1\")\n self.assertNotInBody(\"Section 2\")\n\...
[ "0.5689437", "0.5404265", "0.5371533", "0.53694695", "0.5331952", "0.52998984", "0.5252168", "0.5219894", "0.5195026", "0.5187279", "0.5172216", "0.5122417", "0.5104856", "0.5073841", "0.5040793", "0.5039039", "0.5017145", "0.4977092", "0.49540687", "0.49109757", "0.48936257"...
0.67029315
0
This is the function which is called when playing Pokemon is selected In terms of variables, anything prefixed with u is supposed to mean your and anything prefixed with o is supposed to mean opponents
def pokemon_function(pokemon, oppo_pokemon, uhp=100, ohp=100): print(Figlet(font='barbwire', width=200).renderText("HP : " + str(ohp) + "/100")) print(Figlet(font='banner3', width=200).renderText(oppo_pokemon)) print(Figlet(font='barbwire', width=200).renderText("HP : " + str(uhp) + "/100")) print(Figl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chooseAPokemon(available: typing.Set[str], opponent: bool=False) -> pokemon.Pokemon:\n\n\tutils.setCompleter(available)\n\n\tchoiceStr = \"Choose %s Pokémon\" % (\"your opponent's\" if opponent else 'a')\n\n\twhile True:\n\t\tprint(choiceStr)\n\t\tchoice = input(\"(Pokémon Name, or 'l' list available Pokémon) ...
[ "0.64406544", "0.6069692", "0.604916", "0.59736186", "0.5835608", "0.58242834", "0.580983", "0.58009094", "0.57892954", "0.5730977", "0.5716335", "0.57114285", "0.57090443", "0.5662691", "0.5657727", "0.56185436", "0.5612823", "0.5612479", "0.5574806", "0.55203336", "0.551313...
0.67738265
0
This is the rock paper scissor function.
def rps_function(): randNumber = random.randint(1,3) companswer = "Scissor" if randNumber == 1: companswer = "Rock" elif randNumber == 2: companswer = "Paper" answer = q.select("Select Rock, Paper or Scissors", choices=["Rock", "Paper", "Scissor"]).ask() print(answer, companswe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rock_p_scissor(user_input, comp_choice):\r\n if user_input.lower() == comp_choice:\r\n compare = results[2]\r\n score_update(scoreboard, compare)\r\n banner_text(\"*\")\r\n banner_text(\"Tie! We both chose {0}\".format(user_input))\r\n banner_text(\"*\")\r\n print(s...
[ "0.7926187", "0.73703116", "0.7320837", "0.666478", "0.64771086", "0.64553434", "0.6445867", "0.6426473", "0.64188707", "0.6385392", "0.6307137", "0.6290227", "0.6273507", "0.6219182", "0.615628", "0.612083", "0.6099643", "0.604132", "0.60298204", "0.6012675", "0.59969074", ...
0.75502604
1
takes username and password, confirms password matches db password, returns True or False
def verify_password(self, username, password): try: self.c.execute('SELECT password FROM profiles WHERE name=(?)', (username,)) db_pw = self.c.fetchone()[0] print(password) return db_pw == password except TypeError: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def correct_password(username, password, db):\n\tquery = db((db.User.username == username) & (db.User.password == password))\n\treturn query.count() > 0", "def check_password(self, username, password): # tested\r\n conn = self.get_db()\r\n with conn:\r\n c = conn.cursor()\r\n ...
[ "0.861218", "0.80400485", "0.7986726", "0.7928326", "0.7914342", "0.7905069", "0.7875336", "0.7870443", "0.78657377", "0.7841633", "0.78376216", "0.78015494", "0.7758104", "0.7755465", "0.7719777", "0.7701607", "0.76928484", "0.7687092", "0.76870865", "0.7686983", "0.7653624"...
0.83543
1
Tests that ``Serializer`` can be enabled and disabled correctly.
def test_serializer(): my_serializer = Serializer() assert my_serializer.serialize("test") == "test" my_serializer.serialize = Mock() my_serializer.disable() assert my_serializer("test") == "test" my_serializer.serialize.assert_not_called() my_serializer.enable() my_serializer("test"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_boolean_in_serializer() -> None:\n assert cv.custom_serializer(cv.boolean) == {\n \"type\": \"boolean\",\n }", "def test_write_with_reader_serializer(self):\n transaction = TransactionFactory.build()\n serialized_data = TransactionSerializer(transaction).data\n serializ...
[ "0.64906883", "0.6326578", "0.6096442", "0.58584917", "0.5802942", "0.5798236", "0.576286", "0.5724059", "0.572344", "0.572009", "0.57130533", "0.5687323", "0.5676055", "0.5551296", "0.5540367", "0.5537138", "0.54916525", "0.5475495", "0.54611784", "0.5454063", "0.54074776", ...
0.7458672
0
Tests that ``SerializerMapping`` correctly passes its inputs to the underlying serializers. Also checks that state is retrieved / loaded correctly.
def test_serializer_mapping(): serializer1 = Serializer() serializer1.serialize = Mock(return_value="test1") class Serializer1State(ProcessState): pass serializer2 = Serializer() serializer2.serialize = Mock(return_value="test2") class Serializer2State(ProcessState): pass ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dumps(self):\n result = self.mapper.dumps(self.serialization)\n self.mapper.to_dict.assert_called_once_with(\"custom\")\n self.serialization.assert_called_once_with(\n self.mapper.to_dict.return_value\n )\n self.assertIs(result, self.serialization.return_value...
[ "0.66895884", "0.6504514", "0.6407172", "0.6218765", "0.6105272", "0.6071749", "0.60594106", "0.60369617", "0.5934668", "0.581106", "0.57840157", "0.57135254", "0.5675424", "0.5662678", "0.5645501", "0.56267715", "0.5593252", "0.5585447", "0.5581585", "0.5577482", "0.5569688"...
0.7634884
0
Helper function to save pytorch tensor as jpg image.
def save_tensor(tensor, path, title="NONAME"): image = to_image(tensor) image.save(os.path.join(path, "{}.jpg".format(title)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_tensor_image(fn, x):\n\n if ( 3 == len( x.size() ) ):\n x = x.permute((1, 2, 0))\n \n # Get the CPU NumPy version.\n x = torch.clamp(x, 0, 255)\n x = x.cpu().numpy().astype(np.uint8)\n\n # Save the iamge.\n cv2.imwrite(fn, x, [cv2.IMWRITE_PNG_COMPRESSION, 0])", "def store_ten...
[ "0.7346332", "0.6988003", "0.670727", "0.66723216", "0.65957105", "0.65615886", "0.6526508", "0.6357446", "0.62757653", "0.6271442", "0.62078923", "0.61825883", "0.6181295", "0.6175947", "0.61734766", "0.6105162", "0.6091011", "0.6061136", "0.6027312", "0.60250825", "0.592948...
0.7574364
0
Imports all controllers and register pages
def init_controllers(app): for controller in os.listdir(os.getcwd() + "/controllers"): module_name, ext = os.path.splitext(controller) if module_name.endswith('_controller') and ext == '.py': module = __import__("controllers.%s" % module_name) PYSTHClient....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_one_time_controllers(self):\n self.index_controller = IndexController(self)\n self.opds_feeds = OPDSFeedController(self)\n self.marc_records = MARCRecordController(self)\n self.loans = LoanController(self)\n self.annotations = AnnotationController(self)\n self.ur...
[ "0.65316725", "0.6427963", "0.63743657", "0.6279803", "0.62757796", "0.61138576", "0.6015108", "0.6001349", "0.59471786", "0.5825195", "0.5786634", "0.5748616", "0.57210726", "0.5682311", "0.56795263", "0.5677514", "0.5623811", "0.5607892", "0.5607618", "0.5568051", "0.556537...
0.7429925
0
Call the bootstrap function
def bootstrap(): Bootstrap()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bootstrap(self):\n None", "def _do_bootstrap(self, configs=None):\n pass", "def boot(self):\n\n pass", "def bootstrap(environment: Environment):\n pass", "def network_bootstrap(self, args):\n pass", "def write_bootstrap(self):\n\n for line in Bootstrap.BOOTSTRAP:...
[ "0.80182284", "0.80140054", "0.70418626", "0.6950032", "0.66638505", "0.6519575", "0.648273", "0.64663976", "0.64168626", "0.63539934", "0.63502586", "0.6342842", "0.62229264", "0.616589", "0.6163845", "0.60530704", "0.60484225", "0.60060966", "0.5983313", "0.59652656", "0.59...
0.85955906
0