query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Getters for the list of elements of the level
def _get_elements(self): return self._elements
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __level_entries_list__(self):\n # | - __level_entries_list__\n level_entries_dict = self.level_entries\n level_labels = self.tree_level_labels\n\n level_entries_list = []\n for param_i in level_labels:\n # for name, params_list in level_entries_dict.iteritems():\n ...
[ "0.7440423", "0.7093684", "0.6767582", "0.66954106", "0.66843426", "0.65005785", "0.64462674", "0.643359", "0.64087474", "0.64066654", "0.6395815", "0.6369704", "0.6355646", "0.63206816", "0.6300524", "0.6251306", "0.62428695", "0.6231722", "0.6222661", "0.61766744", "0.61634...
0.6718873
3
Setters for the list of elements of the level
def _set_elements(self, elements): self._elements = elements
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_element(self,data):\n self._element._labels = [list(data[0]), list(data[1])]\n self._element._twin = [list(data[2]), list(data[3])]", "def _set_element(self, data):\n self._element._labels = [list(data[0]), list(data[1])]\n self._element._twin = [list(data[2]), list(data[3])]...
[ "0.6592329", "0.65609664", "0.60820633", "0.5953432", "0.5885628", "0.5877395", "0.5866953", "0.58580905", "0.58551806", "0.5795909", "0.57867515", "0.57466924", "0.5737533", "0.5725041", "0.56824213", "0.5678815", "0.5678107", "0.5669088", "0.5650572", "0.56373256", "0.56371...
0.6262846
2
Getters for start element which is a tuple of the coordinates
def _get_start(self): return self._start
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coordinates_from(self, start):\r\n x, y, z = start\r\n return (\r\n x + self.x,\r\n y + self.y,\r\n z + self.z\r\n )", "def get_start_cell(self):\n return (self.st_row, self.st_col)", "def get_pos(self):\n return (self.x, self.y)", "def ...
[ "0.74906534", "0.7031114", "0.7012537", "0.7004334", "0.6979671", "0.6872923", "0.6853452", "0.68516207", "0.6833578", "0.6783588", "0.6776942", "0.6762346", "0.67243737", "0.670354", "0.6676473", "0.6665707", "0.6665526", "0.66581583", "0.66553247", "0.6619981", "0.660301", ...
0.0
-1
Setters for start element which is a tuple of the coordinates
def _set_start(self, coordinates): self._start = coordinates
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_start_coords(self, x:int, y:int) -> None:\r\n self.start_x = x\r\n self.start_y = y", "def coordinates_from(self, start):\r\n x, y, z = start\r\n return (\r\n x + self.x,\r\n y + self.y,\r\n z + self.z\r\n )", "def coordinates(self):",...
[ "0.7095122", "0.6971883", "0.6610215", "0.6512453", "0.64471847", "0.6387624", "0.6292622", "0.62576914", "0.6186957", "0.6184456", "0.6180708", "0.61720043", "0.61565536", "0.61150855", "0.6073061", "0.606037", "0.60584736", "0.60528666", "0.6041813", "0.60272986", "0.599969...
0.72577804
0
Getters for the position of the end of the level
def _get_end(self): return self._end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end(self) -> pos.Pos:\n return self.__end", "def position_last(self):\n return self._position_last", "def get_end_loc(self) -> Tuple[int, int]:\n assert self.pos_marker\n return self.pos_marker.working_loc_after(\n self.raw,\n )", "def last_pos(self):\n ...
[ "0.71231276", "0.6914629", "0.67150354", "0.66830254", "0.66725457", "0.6512984", "0.6487572", "0.64354104", "0.6432124", "0.6432124", "0.6287319", "0.6261242", "0.62570554", "0.6217301", "0.62051225", "0.6204346", "0.62040514", "0.6192266", "0.6169132", "0.6163551", "0.61615...
0.63790226
10
Setters for the position of the end of the level
def _set_end(self, coordinates): self._end = coordinates
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def horde_end(self):", "def end(self) -> pos.Pos:\n return self.__end", "def end(self):\n self.set_initial_offset(1e6)", "def position(self):\r\n pass", "def move_end_node(self, x, y):", "def end(self, end: pos.Pos) -> None:\n self.__end = end", "def position_at_end(self, bl...
[ "0.635411", "0.62844884", "0.6255174", "0.6210707", "0.61226064", "0.6116746", "0.6058253", "0.6038574", "0.6025989", "0.58778006", "0.58641255", "0.5862518", "0.58546215", "0.58290356", "0.5815667", "0.5782095", "0.5760445", "0.5759511", "0.5714199", "0.57065034", "0.5695607...
0.61515945
4
Getters for the list of spikes in the level
def _get_spikes(self): return self._spikes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self) -> list[float]:", "def get_spikes(self):\n\t\treturn spiketrain.netconvecs_to_listoflists(self.t_vec, self.id_vec)", "def getSpikes(self, compatible_output=False, gather=True):\n global controller\n timer = None\n if conf.config.getboolean(\"Reports\", \"outputTimesForSection...
[ "0.61956644", "0.5953451", "0.5892223", "0.5826972", "0.5796336", "0.57914096", "0.57477033", "0.5735276", "0.5733464", "0.57141876", "0.5683586", "0.5670041", "0.5660167", "0.5659242", "0.5631785", "0.56237555", "0.55452305", "0.5457929", "0.5413642", "0.54100657", "0.539900...
0.6275449
0
Setters for the list of spikes in the level
def _set_spikes(self, listOfSpikes): self._spikes = listOfSpikes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, spikes, position, size=(100, 100), x_range=(-100, 100), y_range=(-100, 100)):\n self.ratemap = np.empty(shape=size)\n self.ratemap[:] = np.nan\n self.size = size\n self.x_range = x_range\n self.y_range = y_range\n self.x_pos_bins = np.linspace(x_range[0]...
[ "0.62325805", "0.62285364", "0.59513015", "0.5906226", "0.57516617", "0.5725869", "0.56792474", "0.5572047", "0.55598605", "0.5543055", "0.54973334", "0.54973334", "0.54973334", "0.54973334", "0.54973334", "0.54973334", "0.54185104", "0.5391921", "0.53644025", "0.53621906", "...
0.72314775
0
Getters for the list of scrolls in the level
def _get_scrolls(self): return self._scrolls
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_scroll(self, event):\n raise NotImplementedError", "def scroll(*args):", "def _on_scroll(self, event):", "def _set_scrolls(self, listOfScrolls):\n self._scrolls = listOfScrolls", "def scrolls(publications, ):\n return (int(publications)) // 11", "def children_list(self):\n ...
[ "0.6164769", "0.60499156", "0.586094", "0.56506693", "0.5509772", "0.54274267", "0.54106253", "0.53923464", "0.5361039", "0.53581995", "0.5320929", "0.5300484", "0.52752745", "0.5220838", "0.52052206", "0.52046984", "0.5188282", "0.5162258", "0.51587117", "0.51358074", "0.513...
0.78128433
0
Setters for the list of scrolls in the level
def _set_scrolls(self, listOfScrolls): self._scrolls = listOfScrolls
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_scrolls(self):\n return self._scrolls", "def scroll(*args):", "def _on_scroll(self, event):", "def set_scroll(self, identifier, **kwargs):\n # scroll is allowed to be set only once\n if self.scroll is not None: raise AssertionError(\n '!! Scroll has already been set to {}'.format(s...
[ "0.6509867", "0.63745624", "0.61840516", "0.6137126", "0.5879936", "0.5810164", "0.5725133", "0.5686556", "0.55222386", "0.5488683", "0.54880834", "0.54756045", "0.5447873", "0.543492", "0.5424347", "0.540691", "0.5397197", "0.5397197", "0.5359283", "0.5328611", "0.5326155", ...
0.73645455
0
Getters for the list of keys in the level
def _get_keys(self, listOfKeys): return self._keys
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetSubkeys(self):", "def keys(self, depth=None):\n if depth is not None:\n levels = self.levels[0:depth]\n else:\n levels = self.levels\n\n return [level.key for level in levels]", "def key_attributes(self):\n\n return [level.key for level in self.levels]",...
[ "0.7221143", "0.7126125", "0.7028147", "0.69974595", "0.6849827", "0.67459285", "0.67159474", "0.66692245", "0.66654426", "0.66515714", "0.662512", "0.66112405", "0.66112405", "0.66070133", "0.6460096", "0.6460096", "0.6452795", "0.6414639", "0.63662666", "0.6331378", "0.6325...
0.63811195
18
Setters for the list of keys in the level
def _set_keys(self, listOfKeys): self._keys = listOfKeys
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_levels(lst_all, lst_chiln, lng_level):\n lng_next = lng_level + 1\n for id_child in lst_chiln:\n dct_child = lst_all[id_child]\n dct_child[ATT_LEVEL] = lng_level\n lst_next = dct_child[ATT_CHILN]\n if lst_next:\n _set_levels(lst_all,...
[ "0.62106353", "0.6073294", "0.6059759", "0.6054648", "0.60144097", "0.5976053", "0.59505826", "0.5905664", "0.58825254", "0.5876824", "0.5862798", "0.58334285", "0.5832255", "0.5832255", "0.5827494", "0.58216745", "0.5820126", "0.58027184", "0.57900196", "0.5781017", "0.57641...
0.6867925
0
Getters for the list of boxes in the level
def _get_boxes(self): return self._boxes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boxes(self) -> dict:\n return self.data[\"boxes\"]", "def get_boxes(self):\r\n\r\n boxes = [(\" \", self.worldbox.tl, self.worldbox.br)]\r\n# boxes = []\r\n boxes += [(\".\", b.tl, b.br) for b in self.wallboxes]\r\n boxes += [(\"x\", b.tl, b.br) for b in self.targetboxes]\r...
[ "0.7172589", "0.697769", "0.6899347", "0.6241453", "0.6183926", "0.61807877", "0.6094649", "0.60684776", "0.60360795", "0.6034314", "0.5913935", "0.58993864", "0.5893196", "0.5861107", "0.5827474", "0.58121175", "0.5772795", "0.5753878", "0.57495", "0.5748847", "0.5685398", ...
0.74243194
0
Setters for the list of Boxes in the level
def _set_boxes(self, listOfBoxes): self._boxes = listOfBoxes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_boxes(self):\n for index in self.box_space.points:\n if self.rank_of_box[index] == self.my_rank:\n self.my_boxes.append(Box(self, index))", "def set_box(self) -> None:\n from pymol import cmd\n\n # Delete Box object in PyMOL\n if \"box\" in cmd.get_...
[ "0.6488099", "0.62966734", "0.6291908", "0.6249032", "0.6207434", "0.62001705", "0.61554664", "0.6131512", "0.6013343", "0.6009452", "0.5989353", "0.5961712", "0.5961302", "0.585783", "0.5741735", "0.5741374", "0.57052207", "0.5686588", "0.56825024", "0.5679052", "0.56784123"...
0.77856565
0
Check if the cell is empty. Return False if it is. True otherwise.
def cellIsEmpty(self, x, y): #If x and y are out of bounds, we return False if x < 0 or y < 0: return False #Else we get the cell that interests us else: cell = self._get_grille()[y][x] if cell.element is None: print("Cell element is None"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_empty(cell):\n return pd.isna(cell)", "def is_empty(self, row, col):\n return self._cells[row][col] != FULL", "def is_empty(self) -> bool:", "def is_empty(self):\n return (self.number_of_rows() == 0 and\n self.number_of_columns() == 0)", "def _empty_cell(self, i_ro...
[ "0.83670914", "0.8365985", "0.80723476", "0.80558836", "0.8039072", "0.80063426", "0.79581493", "0.7913754", "0.7828047", "0.78207636", "0.7802212", "0.7802212", "0.7800878", "0.77960324", "0.77846265", "0.77846265", "0.77846265", "0.77846265", "0.77846265", "0.77846265", "0....
0.0
-1
Check if the player is on a cell where there is a box
def checkPlayerBoxes(self, player, event): playerCoordinates = [player.positionRect.x, player.positionRect.y] element = self._get_grille()[playerCoordinates[1]][playerCoordinates[0]].element #If the player goes left if event.key == K_LEFT: playerCoordinates[0] -= 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_cell(self):\n for player in self.players:\n for cell in self.cell_lst:\n if player.x in cell[0] and player.y in cell[1]:\n player.current_cell = cell\n break", "def is_cell_on_board(cell, board_shape): # TODO: Remove\n return (...
[ "0.7465015", "0.672763", "0.6629412", "0.66279733", "0.6605929", "0.6571107", "0.6549291", "0.6466717", "0.6451506", "0.6445698", "0.64178747", "0.6398614", "0.6392987", "0.63851756", "0.63734686", "0.63638514", "0.6356712", "0.6354886", "0.6336888", "0.63310224", "0.6327387"...
0.70915484
1
We check if the player has reached the end of the level
def checkEndLevel(self, player): playerCoordinates = (player.positionRect.x, player.positionRect.y) #If the player coordinates match the end coordinates, he/she goes to #next level if playerCoordinates == self._get_end(): #We return True because the player has finished the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checking_level_end(level, inventory, x_player, y_player, hamster_energy, board):\n\n next_level = False\n if level == 1 and board[y_player][x_player] == '⇵':\n print_level_title(4)\n you_win = guess_number_game.main()\n if you_win:\n next_level = True\n\n elif level == ...
[ "0.74338865", "0.73416334", "0.707644", "0.6987549", "0.69578713", "0.6906042", "0.68912905", "0.6860396", "0.6851032", "0.6842135", "0.6782858", "0.6637998", "0.6631234", "0.6627323", "0.66188407", "0.6568642", "0.65587145", "0.6540509", "0.6532094", "0.65032136", "0.6489751...
0.8452138
0
We check if the player has landed on a spike
def checkPlayerDies(self, player): listOfSpikesCoordinates = self._get_spikes() playerCoordinates = (player.positionRect.x, player.positionRect.y) if listOfSpikesCoordinates is not None: for spike in listOfSpikesCoordinates: if playerCoordinates == spike: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shooting(self):\r\n return not self.stopped", "def check_player_reached():\n global round_start_timer, round_over\n\n if player1.alive and player1.rect.top < (platform_width // 2):\n add_time_points()\n reset_players()\n player1.wins += 1\n return True\n\n elif pla...
[ "0.6846098", "0.6458586", "0.63440526", "0.6338565", "0.6249835", "0.62253314", "0.62216103", "0.62067175", "0.61905605", "0.6189007", "0.61774755", "0.61774445", "0.6148635", "0.6141195", "0.6140921", "0.6134919", "0.61269647", "0.61019903", "0.60916376", "0.605803", "0.6040...
0.6756985
1
We check if the player is on a scroll. If it is the case, we display the message
def checkPlayerOnScroll(self, player, window): player_x = player.positionRect.x player_y = player.positionRect.y cell = self._get_grille()[player_y][player_x] #If the player is indeed on a scroll, we display the message if cell.element is not None and cell.element.name == "scro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_scroll(self, event):", "def on_scroll(self, event):\n if not self.ignore(event):\n self._on_scroll(event)", "def scroll(self):\n x_position = self._player.get_position()[0]\n half_screen = self._master.winfo_width() / 2\n world_size = self._world.get_pixel_size()[...
[ "0.6754014", "0.61627185", "0.59489286", "0.58599424", "0.58091974", "0.5730006", "0.5727527", "0.5721493", "0.5674587", "0.56674063", "0.5644082", "0.5583983", "0.55697966", "0.55506766", "0.5526234", "0.55249226", "0.54950845", "0.5437477", "0.54235554", "0.54235554", "0.53...
0.81422544
0
We create a list of element objects depending on which element is in the level
def loadingLevelElements(self, listElements): listElementObjects = list() #We gonna check for each element their matching properties in elementsFiles for element in listElements: with open("resources/elementsFiles.txt", "r") as elementFile: for row in elementFile: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init(cls, levels: List[str]) -> List[Level]:\n return [cls(lvl, val) for val, lvl in enumerate(levels)]", "def _extract_elements(self, tree, element_type):\n # creates a new attribute, e.g. 'self.nodes' and assigns it an\n # empty list\n setattr(self, element_type, [])\n et...
[ "0.61770064", "0.607885", "0.5998392", "0.5860755", "0.5860755", "0.56884384", "0.5673194", "0.56302387", "0.55842525", "0.55738896", "0.55426896", "0.55028456", "0.54231566", "0.54140025", "0.5397442", "0.5390939", "0.5374349", "0.5361577", "0.5331796", "0.53304434", "0.5330...
0.5733515
5
Regroup all the methods that loads the elements of the level in self._grille
def loadingLevelForDisplay(self): #We load all the elements and the table of the level selected self._set_grille_csv() self._set_grille_csv() self.whichElementIsInTheLevel() self.fillTableWithElements()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _walk(self, level=0):\n l_dict = self.list_all()\n indent = level * \" \"\n for node in l_dict[\"nodes\"]:\n print(indent + \"node\", node)\n for group in l_dict[\"groups\"]:\n print(indent + \"group: \", group)\n with self.open(group) as hdf_group:...
[ "0.59331065", "0.5700342", "0.56857294", "0.56857294", "0.55181235", "0.5410063", "0.531646", "0.52966934", "0.52694815", "0.5161818", "0.5161818", "0.5161818", "0.5152315", "0.5144395", "0.5108376", "0.5084855", "0.5082084", "0.5080939", "0.5064227", "0.502805", "0.5026813",...
0.5550017
4
We search in _grilleCSV which element is present in the level. And we return a list of those elements.
def whichElementIsInTheLevel(self): listElements = list() #We read each line for row in self._get_grille_csv(): #We read each cell of each line for cell in row: if cell in listElements or cell == "": pass ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Students_at_level(l:list,c:str)->list:\n result=[]\n for s in l:\n if s.level==c:\n result.append(s)\n return result", "def __level_entries_list__(self):\n # | - __level_entries_list__\n level_entries_dict = self.level_entries\n level_labels = self.tree_level_l...
[ "0.5882086", "0.57715577", "0.5668204", "0.55717176", "0.55569273", "0.5481823", "0.5476221", "0.54283863", "0.53939533", "0.53934926", "0.53920054", "0.5376523", "0.534386", "0.5311687", "0.5285689", "0.5260011", "0.5256839", "0.5251279", "0.523684", "0.5231328", "0.52153337...
0.7708357
0
Print the table with all the elements
def printGrille(self): print("Length grille : "+str(len(self._get_grille()))) for row in self._get_grille(): print("(", end="") for cell in row: if cell is None: print(" ,", end="") else: print(cell.element....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_table(self):\n print(\"%-12s%-12s%-12s%-12s%-12s\" % (\"index\",\"balance\",\"payment\",\"interest\",\"amortization\"))\n print(\"-------------------------------------------------------------\")\n for i in self.table[\"index\"]:\n print(\"%-12i%-12i%-12i%-12i%-12i\" % (sel...
[ "0.8166323", "0.7859616", "0.77849823", "0.7783495", "0.7783495", "0.76853085", "0.76337785", "0.74631995", "0.7442437", "0.7415447", "0.730001", "0.72636867", "0.7166242", "0.71564883", "0.7126809", "0.7121239", "0.7118634", "0.71179", "0.7094574", "0.70583606", "0.7041695",...
0.0
-1
Print the csv table that we get from levelx.csv
def printGrilleCSV(self): print("Length grillecsv : "+str(len(self._get_grille_csv()))) for row in self._get_grille_csv(): print("(", end="") for cell in row: if cell == "": print(" ,", end="") else: print(ce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printCsv(self):\n self.printCsvHeader()\n for r in self._records:\n r.printCsv()", "def print_csv():\n # read lines, and make the first a link\n show_played = request.args.get('showPlayed', 'true') == 'true'\n show_out_of_office = request.args.get('showOutOfOffice', 'true') ...
[ "0.6666418", "0.66303885", "0.6604546", "0.6523913", "0.6437784", "0.6363287", "0.6343841", "0.6343841", "0.6269895", "0.62284386", "0.61534876", "0.61516136", "0.61129016", "0.6109725", "0.60965794", "0.60845023", "0.6052538", "0.60187846", "0.60187846", "0.6006817", "0.5988...
0.62843144
8
Set the coordinates of the elements in start, end, spikes, scrolls
def setElementsCoordinates(self, symbol, x, y): #If it is the start element if symbol == "D": self._set_start((x,y)) #If it is the end of the level element elif symbol == "F": self._set_end((x,y)) #If it is a spike elif symbol == "S": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_scroll_length(self):\n size = self.driver.get_window_size()\n self.x_cord = int(size['width'] / 2)\n self.start_y = int(size['height'] * 0.9)\n self.end_y = int(size['height'] * 0.1)", "def set_start_coords(self, x:int, y:int) -> None:\r\n self.start_x = x\r\n se...
[ "0.6339763", "0.6289833", "0.6154443", "0.6154443", "0.6154443", "0.6154443", "0.61308473", "0.61227185", "0.61227185", "0.61227185", "0.61227185", "0.61227185", "0.61227185", "0.61227185", "0.61227185", "0.61227185", "0.61227185", "0.61227185", "0.61215645", "0.6109913", "0....
0.60298187
20
Reset the criterion at pos=start.
def reset(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n self.epsilon = self.start", "def reset(self):\n\t\tself.offsets = self.start_off.copy()", "def reset(self):\n self.test = 0\n self.pos = 0", "def reset(self):\n self.test = 0\n self.pos = 0", "def reset(self, start_pose: np.ndarray) -> Any:\n ret...
[ "0.6549604", "0.643087", "0.63848627", "0.63848627", "0.6272385", "0.62688446", "0.6220705", "0.61710006", "0.6084675", "0.6066697", "0.6003841", "0.5938217", "0.5904411", "0.58518654", "0.5846756", "0.58426327", "0.58426327", "0.58426327", "0.5798954", "0.5788004", "0.577235...
0.0
-1
Evaluate the impurity of the current node, i.e. the impurity of
def node_impurity(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def impurity_improvement(self, impurity):\n\n\t\timpurity_left, impurity_right = self.children_impurity()\n\t\t#return (impurity - impurity_right - impurity_left)\n\t\treturn ((self.weighted_n_node_samples / self.weighted_n_samples) *\n\t\t\t\t\t(impurity - self.weighted_n_right / self.weighted_n_node_samples * ...
[ "0.78295517", "0.7248663", "0.7110147", "0.6886589", "0.6518789", "0.63929516", "0.60269886", "0.59222686", "0.59094167", "0.57904196", "0.5781065", "0.57793313", "0.5759873", "0.5666492", "0.56532997", "0.5626398", "0.5572544", "0.55681336", "0.55646896", "0.5553427", "0.553...
0.8082868
0
Evaluate the impurity in children nodes, i.e. the impurity of
def children_impurity(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def children_impurity(self):\n\n\t\tgini_left = 0.0\n\t\tgini_right = 0.0\n\t\ttotal = 0.0\n\t\ttotal_left = 0.0\n\t\ttotal_right = 0.0\n\n\t\tfor c in range(self.n_classes):\n\t\t\ttmp = self.label_count_left[c]\n\t\t\tgini_left += tmp * tmp\n\t\t\ttmp = self.label_count_right[c]\n\t\t\tgini_right += tmp * tmp\n\...
[ "0.77084464", "0.7573167", "0.7419221", "0.71277595", "0.70864475", "0.6807712", "0.6530234", "0.64339405", "0.5859735", "0.58362544", "0.5586613", "0.55728024", "0.5482493", "0.5471503", "0.53822565", "0.53801626", "0.53689873", "0.53448784", "0.5277155", "0.5187495", "0.517...
0.8106887
0
Weighted impurity improvement, i.e. N_t / N (impurity N_t_L / N_t left impurity N_t_L / N_t right impurity), where N is the total number of samples, N_t is the number of samples in the current node, N_t_L is the number of samples in the left child and N_t_R is the number of samples in the right child.
def impurity_improvement(self, impurity): impurity_left, impurity_right = self.children_impurity() #return (impurity - impurity_right - impurity_left) return ((self.weighted_n_node_samples / self.weighted_n_samples) * (impurity - self.weighted_n_right / self.weighted_n_node_samples * impurity_right -...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def average_impurity(self):\n children = tf.squeeze(tf.slice(self.variables.tree, [0, 0], [-1, 1]),\n squeeze_dims=[1])\n is_leaf = tf.equal(LEAF_NODE, children)\n leaves = tf.to_int32(tf.squeeze(tf.where(is_leaf), squeeze_dims=[1]))\n counts = tf.gather(self.variables.node_sum...
[ "0.7002049", "0.6800746", "0.6706278", "0.63784224", "0.6244614", "0.61719793", "0.5932771", "0.5896449", "0.5837439", "0.5794223", "0.5679852", "0.5576592", "0.55287987", "0.55078816", "0.55039716", "0.54881984", "0.5456553", "0.5454219", "0.54524636", "0.5421927", "0.541978...
0.7847695
0
Reset the criterion at pos=start.
def reset(self): self.pos = self.start self.weighted_n_left = 0.0 self.weighted_n_right = self.weighted_n_node_samples self.label_count_left = np.zeros(self.n_classes) self.label_count_right = np.copy(self.label_count_total)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n self.epsilon = self.start", "def reset(self):\n\t\tself.offsets = self.start_off.copy()", "def reset(self):\n self.test = 0\n self.pos = 0", "def reset(self):\n self.test = 0\n self.pos = 0", "def reset(self, start_pose: np.ndarray) -> Any:\n ret...
[ "0.6549604", "0.643087", "0.63848627", "0.63848627", "0.6272385", "0.62688446", "0.6220705", "0.61710006", "0.6084675", "0.6066697", "0.6003841", "0.5938217", "0.5904411", "0.58518654", "0.5846756", "0.58426327", "0.58426327", "0.58426327", "0.5798954", "0.5788004", "0.577235...
0.5732028
24
Evaluate the impurity in children nodes, i.e. the impurity of the
def children_impurity(self): entropy_left = 0.0 entropy_right = 0.0 for c in range(self.n_classes): tmp = self.label_count_left[c] if tmp > 0.0: tmp /= self.weighted_n_left entropy_left -= tmp * log(tmp) tmp = self.label_count_right[c] if tmp > 0.0: tmp /= self.weighted_n_right entr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def children_impurity(self):\n\t\tpass", "def children_impurity(self):\n\n\t\tgini_left = 0.0\n\t\tgini_right = 0.0\n\t\ttotal = 0.0\n\t\ttotal_left = 0.0\n\t\ttotal_right = 0.0\n\n\t\tfor c in range(self.n_classes):\n\t\t\ttmp = self.label_count_left[c]\n\t\t\tgini_left += tmp * tmp\n\t\t\ttmp = self.label_coun...
[ "0.80401474", "0.76945835", "0.7482643", "0.7301874", "0.70541936", "0.67277575", "0.647042", "0.64216846", "0.57707125", "0.5730074", "0.5528371", "0.55263376", "0.5439895", "0.5436698", "0.54351777", "0.54006016", "0.5383269", "0.52483463", "0.52266777", "0.52072954", "0.51...
0.7062959
4
Evaluate the impurity of the current node, i.e. the impurity of
def node_impurity(self): gini = 0.0 total = 0.0 for c in range(self.n_classes): tmp = self.label_count_total[c] gini += tmp * tmp gini = 1.0 - gini / (self.weighted_n_node_samples * self.weighted_n_node_samples) return gini
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_impurity(self):\n\t\tpass", "def impurity_improvement(self, impurity):\n\n\t\timpurity_left, impurity_right = self.children_impurity()\n\t\t#return (impurity - impurity_right - impurity_left)\n\t\treturn ((self.weighted_n_node_samples / self.weighted_n_samples) *\n\t\t\t\t\t(impurity - self.weighted_n...
[ "0.8082002", "0.7829527", "0.71099573", "0.68861955", "0.6519081", "0.63923365", "0.602748", "0.5922354", "0.59087795", "0.57902724", "0.57801604", "0.5779947", "0.57596517", "0.56658536", "0.5656806", "0.5628024", "0.5573258", "0.5570145", "0.5565813", "0.5553061", "0.553688...
0.72480214
2
Evaluate the impurity in children nodes, i.e. the impurity of the
def children_impurity(self): gini_left = 0.0 gini_right = 0.0 total = 0.0 total_left = 0.0 total_right = 0.0 for c in range(self.n_classes): tmp = self.label_count_left[c] gini_left += tmp * tmp tmp = self.label_count_right[c] gini_right += tmp * tmp gini_left = 1.0 - gini_left / (self.weig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def children_impurity(self):\n\t\tpass", "def impurity_improvement(self, impurity):\n\n\t\timpurity_left, impurity_right = self.children_impurity()\n\t\t#return (impurity - impurity_right - impurity_left)\n\t\treturn ((self.weighted_n_node_samples / self.weighted_n_samples) *\n\t\t\t\t\t(impurity - self.weight...
[ "0.8039218", "0.7484614", "0.7301385", "0.7063674", "0.7054645", "0.6728233", "0.647173", "0.64218664", "0.5771031", "0.5730978", "0.5528201", "0.5526324", "0.54418504", "0.54391795", "0.5437261", "0.5401724", "0.53852344", "0.52498543", "0.5227944", "0.52093345", "0.5187871"...
0.76952016
1
OrgApacheJackrabbitOakSecurityAuthenticationTokenTokenConfiguraProperties a model defined in OpenAPI
def __init__(self, token_expiration=None, token_length=None, token_refresh=None, token_cleanup_threshold=None, password_hash_algorithm=None, password_hash_iterations=None, password_salt_size=None): # noqa: E501 # noqa: E501 self._token_expiration = None self._token_length = None self._token_r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UserToken(self) -> object:", "def auth_token(self):", "def __init__(self, token=None): # noqa: E501\n self.openapi_types = {\"token\": str}\n\n self.attribute_map = {\"token\": \"token\"}\n\n self._token = token", "def setoAuthTokenFromCASSAMLProperties(event):\n user = api.user....
[ "0.5719592", "0.56143516", "0.5582743", "0.54842776", "0.54663646", "0.53200626", "0.5288654", "0.52375376", "0.5168792", "0.5129682", "0.51261246", "0.5079083", "0.505901", "0.50296813", "0.50245816", "0.50245816", "0.50235415", "0.50125885", "0.5008281", "0.50066733", "0.49...
0.0
-1
Sets the token_expiration of this OrgApacheJackrabbitOakSecurityAuthenticationTokenTokenConfiguraProperties.
def token_expiration(self, token_expiration): self._token_expiration = token_expiration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_expiration(self):\n # This is an arbitrary decision setting the expiration time\n # to the current date + expires_in - 10 seconds\n self.expiration = datetime.now() + \\\n timedelta(seconds=(self.expires_in - 10))\n logging.debug('Token expiration set to %s' % self.ex...
[ "0.65515846", "0.6489425", "0.61133724", "0.6036679", "0.58961684", "0.55701935", "0.5387193", "0.536487", "0.5342043", "0.5285386", "0.5218918", "0.5185711", "0.5058732", "0.50248253", "0.49781796", "0.4948664", "0.49243316", "0.48843396", "0.48690245", "0.4849527", "0.48338...
0.7860061
0
Sets the token_length of this OrgApacheJackrabbitOakSecurityAuthenticationTokenTokenConfiguraProperties.
def token_length(self, token_length): self._token_length = token_length
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def token_length(self):\n return 32", "def checklength(config, tokenizer):\n\n # Unpack nested config, handles passing model directly\n if hasattr(config, \"config\"):\n config = config.config\n\n if (\n hasattr(config, \"max_position_embeddings\")\n a...
[ "0.64974827", "0.54974973", "0.54938304", "0.5431286", "0.5425911", "0.53945225", "0.53191924", "0.53072226", "0.5291858", "0.5279412", "0.5225515", "0.51672924", "0.51644915", "0.5126199", "0.50341994", "0.50252384", "0.49880198", "0.49486992", "0.4948699", "0.49478066", "0....
0.77983516
0
Sets the token_refresh of this OrgApacheJackrabbitOakSecurityAuthenticationTokenTokenConfiguraProperties.
def token_refresh(self, token_refresh): self._token_refresh = token_refresh
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_reddit_oauth_refresh_token(site_name, token, _current_parser=None):\n set_value(site_name, OAUTH_CRED_KEYS[CredKeys.refresh], token, _current_parser)", "def set_refresh_token(self, token):\n\n self.__current_request_mock.headers['Cookie'] = f'Refresh-Auth={token}'", "def refresh(self):\n ...
[ "0.70055157", "0.69926065", "0.69331497", "0.6908582", "0.6820355", "0.6664596", "0.66341186", "0.6582922", "0.65732235", "0.65676665", "0.65497774", "0.651406", "0.6422973", "0.6415158", "0.63710177", "0.6363387", "0.62807554", "0.62514967", "0.62255317", "0.6166498", "0.616...
0.8201788
0
Sets the token_cleanup_threshold of this OrgApacheJackrabbitOakSecurityAuthenticationTokenTokenConfiguraProperties.
def token_cleanup_threshold(self, token_cleanup_threshold): self._token_cleanup_threshold = token_cleanup_threshold
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repo_size_limit_threshold_mb(self, repo_size_limit_threshold_mb):\n\n self._repo_size_limit_threshold_mb = repo_size_limit_threshold_mb", "def setCleanupTool(self,value):\n self.PDFreactorConfiguration.in1[\"cleanupTool\"] = value", "def token_length(self, token_length):\n\n self._toke...
[ "0.516139", "0.46267745", "0.4521541", "0.44696322", "0.444375", "0.44179785", "0.4386771", "0.43714768", "0.43595752", "0.43552157", "0.43172798", "0.43127617", "0.43013564", "0.42994827", "0.4276944", "0.4255348", "0.4255348", "0.42459875", "0.42274946", "0.42036274", "0.41...
0.8393153
0
Sets the password_hash_algorithm of this OrgApacheJackrabbitOakSecurityAuthenticationTokenTokenConfiguraProperties.
def password_hash_algorithm(self, password_hash_algorithm): self._password_hash_algorithm = password_hash_algorithm
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password_hash_iterations(self, password_hash_iterations):\n\n self._password_hash_iterations = password_hash_iterations", "def set_password_hash(self, password):\n salt = bcrypt.gensalt()\n self.password_hash = bcrypt.hashpw(password.encode(), salt)", "def hash_password(self):\n ...
[ "0.5773472", "0.5705776", "0.55370224", "0.5362767", "0.5339795", "0.53345174", "0.53082556", "0.51998013", "0.5115244", "0.5096059", "0.5081463", "0.50515366", "0.50405407", "0.5034428", "0.50164604", "0.50102544", "0.49913713", "0.4933232", "0.4923823", "0.491897", "0.48978...
0.7354172
0
Sets the password_hash_iterations of this OrgApacheJackrabbitOakSecurityAuthenticationTokenTokenConfiguraProperties.
def password_hash_iterations(self, password_hash_iterations): self._password_hash_iterations = password_hash_iterations
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_password_hash(self, password):\n salt = bcrypt.gensalt()\n self.password_hash = bcrypt.hashpw(password.encode(), salt)", "def password_hash_algorithm(self, password_hash_algorithm):\n\n self._password_hash_algorithm = password_hash_algorithm", "def set_password(self, password):\n ...
[ "0.61004245", "0.6039315", "0.57552356", "0.56171733", "0.5576066", "0.5576066", "0.5562618", "0.55493253", "0.55397487", "0.5534445", "0.5534032", "0.54852223", "0.5428458", "0.5395618", "0.5395618", "0.5395618", "0.5395618", "0.5382891", "0.5292858", "0.5260845", "0.5180539...
0.7950528
0
Sets the password_salt_size of this OrgApacheJackrabbitOakSecurityAuthenticationTokenTokenConfiguraProperties.
def password_salt_size(self, password_salt_size): self._password_salt_size = password_salt_size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def salt_opts(self):\n if self._salt_opts is None:\n salt_conf = self.config.settings.get('salt.master_config',\n '/etc/salt/master')\n self._salt_opts = salt.config.master_config(salt_conf)\n return self._salt_opts", "def token_...
[ "0.5313568", "0.5256036", "0.5200819", "0.5188654", "0.5129989", "0.5075282", "0.5042031", "0.48906437", "0.48233792", "0.48224723", "0.48160204", "0.48035473", "0.47991824", "0.4790052", "0.47885826", "0.47757542", "0.47442412", "0.47429308", "0.47291636", "0.47253898", "0.4...
0.8290696
0
Returns the model properties as a dict
def to_dict(self): result = {} for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self):\n return self.properties", "def to_dict(self):\n return self.properties", "def get_properties(self):\n return self.properties", "def asdict(self):\n return self._prop_dict", "def json(self):\n rv = {\n prop: getattr(self, prop)\n f...
[ "0.7751993", "0.7751993", "0.73391134", "0.7334895", "0.7297356", "0.727818", "0.7159078", "0.71578115", "0.71494967", "0.71494967", "0.71283495", "0.71275014", "0.7122587", "0.71079814", "0.7060394", "0.7043251", "0.7034103", "0.70233124", "0.69635814", "0.69586295", "0.6900...
0.0
-1
Returns the string representation of the model
def to_str(self): return pprint.pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self) -> str:\n # noinspection PyUnresolvedReferences\n opts = self._meta\n if self.name_field:\n result = str(opts.get_field(self.name_field).value_from_object(self))\n else:\n ...
[ "0.8585799", "0.7814791", "0.77903897", "0.7750947", "0.7750947", "0.7713712", "0.7699211", "0.76708376", "0.76511395", "0.7601015", "0.75830185", "0.7570755", "0.7540716", "0.7523477", "0.75169474", "0.7501407", "0.7487798", "0.7487798", "0.7470098", "0.74518627", "0.7446157...
0.0
-1
For `print` and `pprint`
def __repr__(self): return self.to_str()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pprint(*args, **kwargs):\n if PRINTING:\n print(*args, **kwargs)", "def print_out():\n pass", "def custom_print(*objects):\n print(*objects, sep=OFS, end=ORS)", "def _print(self, *args):\n return _ida_hexrays.vd_printer_t__print(self, *args)", "def _printable(self):\n ...
[ "0.7557754", "0.7338058", "0.6987503", "0.69850004", "0.69455147", "0.6924971", "0.6898882", "0.6898829", "0.6815187", "0.68062454", "0.6751603", "0.6749909", "0.67452943", "0.67000484", "0.66911054", "0.66751033", "0.6657706", "0.6609648", "0.6608622", "0.66017973", "0.65629...
0.0
-1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, OrgApacheJackrabbitOakSecurityAuthenticationTokenTokenConfiguraProperties): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.80886984", "0.80886984", "0.8055307", "0.7983415", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", "0.79673034", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Makes classes based on given thresholds.
def make_classes(y,thresholds,exact_value=False,reverse=False): nthres = len(thresholds) if ~exact_value: # Scale thresholds by standard deviation y_std = np.std(y) # Get standard deviation thresholds = np.array(thresholds) * y_std y_class = np.zeros((y.shape[0],1)) if nthres == 1: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjusted_classes(pred_prob, threshold):\n return [1 if y >= threshold else 0 for y in pred_prob]", "def threshold_probs(probs):\n classes = np.ones(len(probs),)\n classes[probs < 0.5] = 0\n return classes", "def _absorb_classes(self, ground_to='in'):\n # Find number of new class for insi...
[ "0.66689724", "0.6337159", "0.6335962", "0.6220492", "0.6176042", "0.60976267", "0.5937524", "0.5936047", "0.5931283", "0.58739364", "0.58739364", "0.58739364", "0.5836414", "0.583373", "0.5806876", "0.57137614", "0.56987673", "0.5665866", "0.56295145", "0.56280977", "0.56014...
0.75083107
0
Sample even amounts from each class
def select_samples(nsamples,y_class,X): allsamples,nchannels,H,W = X.shape classes = np.unique(y_class) nclasses = len(classes) # Sort input by classes label_by_class = [] input_by_class = [] idx_by_class = [] y_class_sel = np.zeros([nsamples*nclasses,1])#[] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sampleClass(classgroup):\n return classgroup.sample(frac = fraction)", "def sampling_class_portion(data,classes,others=None,class_portion=None,rng=np.random.RandomState(100)):\n u, indices = np.unique(classes,return_inverse=True)\n indices=np.asarray(indices)\n num_u=len(u)\n sample_sizes=...
[ "0.66457224", "0.6243939", "0.6225851", "0.6101531", "0.60999405", "0.60875005", "0.6061041", "0.5998091", "0.59864956", "0.59363395", "0.58778876", "0.58567864", "0.5786057", "0.5782275", "0.5739441", "0.56938636", "0.56783646", "0.56204647", "0.5608712", "0.55946845", "0.55...
0.5224117
68
Returns Data for menus for 7 days for all the dining halls starting at
def fetch_menus(start_date): end_date = start_date + timedelta(days=6) resp = {"start_date": start_date, "data": []} while start_date < end_date: resp["data"].append(fetch_menu(start_date)) start_date += timedelta(days=1) return resp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def menu_weekly(self, building_id):\n din = DiningV2(self.bearer, self.token)\n response = {'result_data': {'Document': {}}}\n days = []\n for i in range(7):\n date = str(datetime.date.today() + datetime.timedelta(days=i))\n v2_response = din.menu(building_id, date...
[ "0.72263306", "0.6923086", "0.6520236", "0.6212212", "0.6193745", "0.5825416", "0.5758301", "0.5734549", "0.5643133", "0.5640257", "0.5608859", "0.5604566", "0.5601826", "0.5500396", "0.54901546", "0.54209644", "0.5410078", "0.5404265", "0.5357528", "0.5349443", "0.5325899", ...
0.6539881
2
Returns a properly formatted JSON response of all menus for a given day
def fetch_menu(date): response = {"date": date, "halal_dishes": []} data = [] halal_courses = ( models.MenuItem.query.with_entities( models.MenuItem.name, models.Course.name, models.Meal.name, models.Menu.date, models.Menu.hours, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def menu_daily(self, building_id):\n today = str(datetime.date.today())\n v2_response = DiningV2(self.bearer, self.token).menu(building_id, today)\n response = {'result_data': {'Document': {}}}\n response[\"result_data\"][\"Document\"][\"menudate\"] = datetime.datetime.strptime(today, '...
[ "0.72208184", "0.7181529", "0.6694624", "0.6550214", "0.6345336", "0.6163772", "0.60734564", "0.605368", "0.60211825", "0.59491235", "0.58835185", "0.5814795", "0.57733625", "0.57486993", "0.5637088", "0.556048", "0.5490696", "0.5483897", "0.54733205", "0.54529405", "0.543593...
0.67796683
2
Checks whether two models parameters are equal
def check_params_equal(param1, param2): for key, val in param1.items(): if np.any(param1[key] != param2[key]): return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def models_are_equivalent(model_a: TopLevelOscalModel, model_b: TopLevelOscalModel) -> bool:\n # this will change the second model as a side-effect\n model_b.metadata.last_modified = model_a.metadata.last_modified\n return model_a == model_b", "def __eq__(self, other: 'ModelParameters') -> bool:\n ...
[ "0.7516173", "0.74578166", "0.7345072", "0.7342032", "0.7218318", "0.72155297", "0.710855", "0.7100062", "0.70620775", "0.6999765", "0.6909127", "0.6865819", "0.68470407", "0.6826237", "0.68185353", "0.67935354", "0.6775829", "0.67686844", "0.6742816", "0.6725789", "0.6703481...
0.6883297
11
Returns mean absolute change across parameters from param1 to param2
def rate_change_param(param1, param2): total_change = [] for key, val in param1.items(): total_change.append(np.mean(np.abs(param1[key] - param2[key]))) return np.mean(total_change)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_absolute_mean_diff(a1, a2):\n diff = np.array(a1) - np.array(a2)\n diff_abs = np.absolute(diff)\n mean_diff = diff_abs.mean()\n return mean_diff", "def mean_absolute_error(x0, x1):\n return MeanAbsoluteError()(x0, x1)", "def _mean_diff(x, y):\n return np.mean(x) - np.mean(y)", ...
[ "0.63603914", "0.63594985", "0.6053924", "0.60095775", "0.5975715", "0.5948787", "0.59298044", "0.591829", "0.5827105", "0.58030134", "0.57447094", "0.5736064", "0.5735196", "0.57252514", "0.57165", "0.5701881", "0.5671757", "0.5671596", "0.56521547", "0.56521547", "0.5639293...
0.7746873
0
Prints model parameter names
def print_param_names(model): for (param_name, param) in model.get_parameters().items(): print(param_name, param.shape)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_model_params(model):\n for param, value in zip(model.param_names, model.parameters):\n print(\"{:0.4f}\\t{}\".format(value, param))", "def _print_model_parameters(labels, parameters, errors):\n for label, parameter, error in zip(labels, parameters, errors):\n print(f\"{label} = {par...
[ "0.8404375", "0.7564573", "0.7433546", "0.74063957", "0.73906106", "0.73810023", "0.73810023", "0.7354682", "0.7354682", "0.7354682", "0.7354682", "0.73462445", "0.73395395", "0.7317706", "0.7309974", "0.7309974", "0.7294344", "0.7041816", "0.70049655", "0.69939125", "0.69919...
0.84604084
0
Returns the index of the parameter in the list of params
def get_param_idx(model, target_name): for i, (param_name, param) in enumerate(model.get_parameters().items()): if param_name == target_name: return i
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parameter_index(self):\n return self._parameter_index", "def index(*, list : Union[List[Any], ConduitVariable], item : Any) -> int:\n return -1 if item not in list else list.index(item)", "def argpos(self, name):\n for argid, arg in enumerate(self):\n if arg.name == name:\n ...
[ "0.74701416", "0.6805807", "0.6738186", "0.6619826", "0.6500323", "0.6223929", "0.61853826", "0.617099", "0.61469775", "0.60978466", "0.60906076", "0.60640705", "0.60425174", "0.60390157", "0.6004774", "0.6004478", "0.60024226", "0.60024226", "0.6002037", "0.59592974", "0.594...
0.7686104
0
Convert given row and column number to an Excelstyle cell name.
def excel_style(col): result = [] while col: col, rem = divmod(col-1, 26) result[:0] = LETTERS[rem] return ''.join(result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cell_name(self, inst_name, row, col):\n return self.bitcell_array.get_cell_name(inst_name + \"{}x\".format(OPTS.hier_seperator) + self.bitcell_array_inst.name, row, col)", "def convert_number_to_excel_colname(n):\n\n assert 0 < n <= 256\n\n alphabet = [chr(x) for x in xrange(65, 91)]\n\n ...
[ "0.6875886", "0.6873031", "0.6624854", "0.646285", "0.6194314", "0.59675694", "0.58355004", "0.5832388", "0.5810062", "0.578682", "0.5703801", "0.5666068", "0.5597809", "0.55182964", "0.5498179", "0.54974335", "0.5480556", "0.5470536", "0.5445592", "0.5410976", "0.5398021", ...
0.5506305
14
Encodes a list of strings to a single string.
def encode(self, strs): s = "" for i in strs: s += str(len(i)) + "#" + i return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_as_str(list_to_encode, sep = \"|\"):\n return sep.join([str(x) for x in list_to_encode])", "def _encode_list(source: list) -> bytes:\n result_data = b\"l\"\n\n for item in source:\n result_data += encode(item)\n\n return result_data + b\"e\"", "def encode (self, strs):\n if...
[ "0.7461567", "0.74273556", "0.7259015", "0.7256169", "0.6790984", "0.67665786", "0.66998994", "0.66811806", "0.6644228", "0.6644228", "0.657613", "0.657575", "0.6484207", "0.6400681", "0.63204384", "0.6311077", "0.6282774", "0.6263477", "0.62125015", "0.6201089", "0.6200855",...
0.61655873
22
Decodes a single string to a list of strings.
def decode(self, s): i, str = 0, [] while i < len(s): sharp = s.find("#", i) l = int(s[i:sharp]) str.append(s[sharp + 1:sharp + l + 1]) i = sharp + l + 1 return str
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode(self, s):\n lststr = s.split(',')\n if s=='': return []\n rst = []\n for i in range(len(lststr)):\n rst.append(lststr[i])\n return rst", "def decode (self, s):\n if s == \"null\": return []\n return s.split(chr(257))", "def parse_string_lis...
[ "0.74293435", "0.731808", "0.6768696", "0.66035104", "0.6487235", "0.64101726", "0.63983387", "0.63753664", "0.63416785", "0.6340276", "0.63346875", "0.62711537", "0.62645596", "0.6239888", "0.61874527", "0.61702603", "0.61587685", "0.6109627", "0.6099251", "0.6020934", "0.60...
0.55744296
58
Encodes a list of strings to a single string.
def encode(self, strs): encoded_str = "" for s in strs: encoded_str += "%0*x" % (8, len(s)) + s return encoded_str
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_as_str(list_to_encode, sep = \"|\"):\n return sep.join([str(x) for x in list_to_encode])", "def _encode_list(source: list) -> bytes:\n result_data = b\"l\"\n\n for item in source:\n result_data += encode(item)\n\n return result_data + b\"e\"", "def encode (self, strs):\n if...
[ "0.7460382", "0.7427196", "0.7259202", "0.72584486", "0.6791328", "0.67686176", "0.6698822", "0.6680194", "0.66430646", "0.66430646", "0.6576623", "0.6574132", "0.6484602", "0.64002955", "0.6322061", "0.63135695", "0.62839377", "0.6264149", "0.6214151", "0.6202491", "0.620223...
0.6098988
27
Decodes a single string to a list of strings.
def decode(self, s): i = 0 strs = [] while i < len(s): l = int(s[i:i+8], 16) strs.append(s[i+8:i+8+l]) i += 8+l return strs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode(self, s):\n lststr = s.split(',')\n if s=='': return []\n rst = []\n for i in range(len(lststr)):\n rst.append(lststr[i])\n return rst", "def decode (self, s):\n if s == \"null\": return []\n return s.split(chr(257))", "def parse_string_lis...
[ "0.74301857", "0.7318614", "0.6768247", "0.6603799", "0.6485542", "0.64098835", "0.6400022", "0.6377622", "0.6343576", "0.6340879", "0.6336597", "0.62724537", "0.6264735", "0.6241324", "0.61732364", "0.61607355", "0.6110379", "0.6100863", "0.60212076", "0.6008144", "0.5989775...
0.6189898
14
Does some caching too, not threadsafe, nothing fancy, but MC and RT are slow as all hell.
def _getFile(url, cachedFile=True, return_filename=False): assert url, "WHY are you trying to load an empty string url?!?! Nothing good will come of this! In fact, I will assure that! %s" % (url) md5 = hashlib.md5(url).hexdigest() filename = os.path.join(config.WEB_CACHE_DIR, md5) if os.path.exists(fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _retrieveCachedData(self):", "def test_untimed(self):\n cache = TimedCache()\n for i in range(500):\n cache[i] = i\n for i in range(500):\n assert i in cache\n assert cache[i] == i", "def test_unsized(self):\n cache = LRUCache()\n for i in...
[ "0.6656628", "0.60921973", "0.58927107", "0.5851966", "0.57940423", "0.5736991", "0.57310474", "0.57250607", "0.57212704", "0.57202816", "0.5697414", "0.56936735", "0.5686549", "0.5651579", "0.5617373", "0.5610684", "0.5570145", "0.55614823", "0.5558657", "0.5538777", "0.5513...
0.0
-1
This clears the file at url out of the cache, if it was in there. You can use this for testing stuff, or clearing munged stuff.
def _clearFile(url): md5 = hashlib.md5(url).hexdigest() filename = os.path.join(config.WEB_CACHE_DIR, md5) if os.path.exists(filename): os.remove(filename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_latest_url(self):\n if os.path.isfile(self.HTTPD_LATEST_URL_FILE):\n os.remove(self.HTTPD_LATEST_URL_FILE)\n logger.debug('deleted latest URL file %s' % (self.HTTPD_LATEST_URL_FILE))", "def download_file_cached(file_url: str, location: str) -> None:\n\titem = os.path.basena...
[ "0.6960745", "0.65934867", "0.6407384", "0.6370004", "0.63664705", "0.63399345", "0.63247496", "0.6270519", "0.6260388", "0.6255713", "0.6162333", "0.61528885", "0.61217046", "0.6118693", "0.6115658", "0.6114848", "0.61089736", "0.6104531", "0.60990155", "0.6096224", "0.60911...
0.8728758
0
This is kind of weird that the caching stuff is just floating around in movieutils, but whatever. This switches to a 'temporary cache' instead of the one that actually stores on disk. So this only caches in memory. It's used by the testcases to make sure that 1)We're not just rescraping files stored on disk (which pres...
def CacheOnDisk(yes_or_no): global GetFile, ClearFile if yes_or_no: GetFile = _getFile ClearFile = _clearFile else: GetFile = _getMemory ClearFile = _clearMemory
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_cached_files(self, cache_key):\r\n pass", "def test_local_cache():", "def load_cache():\n return {}", "def cache(cachedir=None):\n if cachedir is not None:\n os.environ['VIPY_CACHE'] = remkdir(cachedir)\n GLOBAL['CACHE'] = cachedir\n return os.environ['VIPY_CACHE'] if 'VIPY_...
[ "0.7292386", "0.71245205", "0.6606068", "0.6546519", "0.6470035", "0.6470035", "0.6453062", "0.6420985", "0.64110696", "0.638535", "0.63547397", "0.6326919", "0.63250315", "0.6307057", "0.6275266", "0.6275266", "0.6267528", "0.6265138", "0.6252692", "0.6239344", "0.62383515",...
0.6668676
2
Does the replace deal.
def _replace(match): match = match.groups()[0] if match in _html_escapes: ret = _html_escapes[match] else: ret = unicode(chr(int(match[1:])), 'latin-1') return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace(self, *args, **kwargs): # real signature unknown\r\n pass", "def performReplacement(self):\n return _libsbml.Replacing_performReplacement(self)", "def Replace(self, *args):\n return _BRepAlgo.BRepAlgo_AsDes_Replace(self, *args)", "def test_replace(self):\n\n regex = \"...
[ "0.72180206", "0.6558392", "0.65214056", "0.6260158", "0.6219871", "0.6219871", "0.61734754", "0.6159628", "0.6086643", "0.60752386", "0.60336727", "0.5996828", "0.59959346", "0.5965237", "0.5957223", "0.59520376", "0.5898442", "0.58754355", "0.58255816", "0.5815313", "0.5808...
0.0
-1
All metainformation from section 1+3 as multiline string
def get_meta_str(self): s = [] t = "%-32s: %s" s.append(t % ("Edition", self._meta.get("edition", "---"))) s.append(t % ("Master-table", self._meta.get("master", "---"))) cc = self._meta.get("center", "---") cs = self._meta.get("subcenter", "---") if self._tables ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def section_overindented(): # noqa: D416", "def format_sections(self, sections: SectionDict) -> str:", "def Synopsis(self, line):\n nest = 0 # [...] nesting level.\n no_split = 0 # buf[no_split:i] should not be split across lines.\n # String append on buf used below because of no_split lookbehind.\...
[ "0.61869085", "0.60846585", "0.59987414", "0.5969794", "0.57623047", "0.571841", "0.5692296", "0.5684557", "0.56818175", "0.5665133", "0.56437826", "0.5580224", "0.5568865", "0.5556232", "0.5531403", "0.5530892", "0.5473025", "0.5450933", "0.5413128", "0.54026747", "0.5384964...
0.61269915
1
Load all tables referenced by the BUFR
def load_tables(self): if not len(self._meta): raise BufrTableError("No table loaded!") if self._tables is None or self._tables.differs( self._meta['master'], self._meta['mver'], self._meta['lver'], self._meta['center'], self._meta['subcenter']...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_db_tables(self):\r\n\r\n self.list_of_tables = pd.read_json(os.path.join(self.config_path, self.db_config_file),\r\n orient='records')[self.report_type]['table']\r\n\r\n # Loading tables from database\r\n for aux_index, table in enumerate(self...
[ "0.67528474", "0.6654105", "0.6233552", "0.61613905", "0.60914737", "0.6038449", "0.5963201", "0.5953026", "0.59409255", "0.5924329", "0.5912999", "0.5891923", "0.58842725", "0.5881582", "0.58523697", "0.5782399", "0.57753015", "0.5756432", "0.5729028", "0.57129955", "0.56915...
0.69495076
0
List descriptors, with unit and name/description
def get_descr_full(self): desc_text = [] stack = [(self._desc, 0)] while stack: dl, di = stack.pop() while di < len(dl): if dl[di] == 0: di += 1 elif dl[di] > 0 and dl[di] < 100000: desc_text.append(s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_descriptors(self):\n raise NotImplementedError", "def getDescriptors(self, dsc = \"\"):\r\n return \"\"", "def describe():", "def descriptors(mol, functions):\n for name, function in functions:\n yield (name, function(mol))", "def displayable_items(self):\r\n return [s...
[ "0.685895", "0.68118", "0.62780565", "0.6128703", "0.61201423", "0.60672957", "0.59444296", "0.588672", "0.5881655", "0.58519834", "0.5790312", "0.578461", "0.57419616", "0.57373255", "0.57163924", "0.57163924", "0.57062876", "0.5706274", "0.5691928", "0.5691928", "0.56873006...
0.5570313
32
List descriptors, unexpanded, no unit nor name/description
def get_descr_short(self): desc_text = [] stack = [(self._desc, 0)] while stack: dl, di = stack.pop() while di < len(dl): if dl[di] == 0: di += 1 elif dl[di] > 0 and dl[di] < 100000: desc_text.append(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_descriptors(self):\n raise NotImplementedError", "def getDescriptors(self, dsc = \"\"):\r\n return \"\"", "def displayable_items(self):\r\n return [self.descriptor]", "def _list_descriptors():\r\n return [\r\n desc for desc in [\r\n desc for (_, desc) in XModu...
[ "0.7459796", "0.7372628", "0.66935253", "0.6526067", "0.63399196", "0.62956226", "0.61368984", "0.61206937", "0.61160123", "0.6114237", "0.60729814", "0.60644233", "0.60001135", "0.59673566", "0.5961617", "0.5960244", "0.59566087", "0.59566087", "0.5949845", "0.5942501", "0.5...
0.0
-1
Iterator for subsets in Sect. 4
def next_subset(self): i = 0 subset = None self._blob.reset(self._data_s) logger.info("BUFR START") while i < self._subsets: logger.info("SUBSET #%d", i) if subset is not None and subset.inprogress: raise BufrDecodeWarning("Subset decoding ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subsets(arr):\n return chain(*[combinations(arr, i + 1) for i, a in enumerate(arr)])", "def subsets(arr):\n return chain(*[combinations(arr, i + 1) for i, a in enumerate(arr)])", "def subsets(self):\n \n # note subsets have an unusual encoding\n query = \"\"\"\n prefix oboInOw...
[ "0.7174556", "0.7174556", "0.69025904", "0.6892195", "0.6849329", "0.68269324", "0.65913", "0.6559934", "0.6507403", "0.6451254", "0.6391901", "0.63544214", "0.63462824", "0.6321364", "0.6302073", "0.62427986", "0.62091714", "0.6207435", "0.6175938", "0.61639494", "0.61599153...
0.657338
7
Decodes all metadata of the BUFR. This function prepares the iterators for reading data.
def decode(self, data, tables=True): if data is None or not len(data): raise BufrDecodeWarning("Data buffer is empty!") self._blob = data self._meta = {} logger.info("SECT 0..5 DECODE") o, l, r = sect.decode_sect0(self._blob, 0) self._meta.update(r) s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fullunzip_output(self: object, controller: FullDecoder) -> Iterator[str]:\n yield controller.huff_decoder.seq.read()\n yield controller.huff_decoder.header\n yield controller.huff_decoder.unicode\n yield controller.huff_decoder.binary \n yield controller.huff_decoder.decompre...
[ "0.5834121", "0.5826038", "0.5667337", "0.56201667", "0.55763245", "0.5564264", "0.5561101", "0.55353975", "0.55346096", "0.5514427", "0.5511002", "0.55066776", "0.549099", "0.5484095", "0.5469155", "0.5446477", "0.5441658", "0.5429771", "0.54161364", "0.53906053", "0.5369865...
0.0
-1
Parses fastq file and returns percentage of sequences with base pair count over base_pair_limit. >>> parse_sequence_lengths('./test_files/fastq/read1/doc_test_R1.fastq', 1) 1.0 >>> parse_sequence_lengths('./test_files/fastq/read1/doc_test_R1.fastq', 150) 0.25 >>> parse_sequence_lengths('./test_files/fastq/read2/doc_tes...
def parse_sequence_lengths(filepath, base_pair_limit): total_count = 0 limit_count = 0 with open(filepath) as f: line = f.readline() while line: if line.startswith('@'): total_count += 1 seq = f.readline() sep = f.readline() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_sequence_length_report(directory, base_pair_limit):\n\n for filepath in find_fastq_files(directory):\n print(\"%(filepath)s\\n%(percent)1.2f%% sequences over %(base_pair_limit)i\\n\" %\n {\n 'filepath': filepath,\n 'percent': parse_sequence_lengths...
[ "0.6764307", "0.5802329", "0.5756304", "0.55055326", "0.5395995", "0.53483945", "0.5332044", "0.5317592", "0.531458", "0.52290314", "0.518055", "0.51804584", "0.5171881", "0.5151545", "0.51515394", "0.5149465", "0.5130835", "0.50997776", "0.508935", "0.5087203", "0.5056916", ...
0.8040582
0
Recursively find all fastq files in a directory and return list of file paths. >>> find_fastq_files('./test_files/fastq') ['./test_files/fastq/read1/doc_test_R1.fastq', './test_files/fastq/read2/doc_test_R2.fastq', './test_files/fastq/read2/nested_read/doc_test_R2.fastq']
def find_fastq_files(directory): filepaths = [] for dirpath, dirnames, filenames in os.walk(directory): for filename in filenames: if filename.endswith('.fastq'): filepaths.append(os.path.join(dirpath, filename)) return filepaths
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fastq_files(self) -> List[Path]:\n return list(self.sequence_data_paths.fastq_path.glob(\"*.fastq.gz\")) # type: ignore", "def findFiles(target, path):\r\n\tfiles = []\r\n\tlyst = os.listdir(path)\r\n\tfor element in lyst:\r\n\t\tif os.path.isfile(element):\r\n\t\t\tif target in element:\r\n\t\t\...
[ "0.6896931", "0.6678779", "0.6610727", "0.6594567", "0.655162", "0.649314", "0.64682156", "0.646473", "0.6444073", "0.64168435", "0.64084363", "0.64079094", "0.6388692", "0.63645154", "0.6359806", "0.6356913", "0.6343995", "0.6331972", "0.63294595", "0.6327411", "0.63087934",...
0.7965275
0
Prints sequence length report for fastq files. >>> print_sequence_length_report('./test_files/fastq', 50) ./test_files/fastq/read1/doc_test_R1.fastq 0.75% sequences over 50 ./test_files/fastq/read2/doc_test_R2.fastq 0.50% sequences over 50 ./test_files/fastq/read2/nested_read/doc_test_R2.fastq 0.50% sequences over 50
def print_sequence_length_report(directory, base_pair_limit): for filepath in find_fastq_files(directory): print("%(filepath)s\n%(percent)1.2f%% sequences over %(base_pair_limit)i\n" % { 'filepath': filepath, 'percent': parse_sequence_lengths(filepath, base...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seq_length_dist_plot (self):\n if 'seq_length_dist' not in self.fastqc_data or len(self.fastqc_data['seq_length_dist']) == 0:\n log.debug('seq_length_dist not found in FastQC reports')\n return None\n \n if len(self.seq_lengths) < 2:\n html = '<p>All sample...
[ "0.5582171", "0.5474865", "0.5386637", "0.52735984", "0.5259297", "0.51798034", "0.5077845", "0.50574565", "0.49718148", "0.49467772", "0.49403054", "0.4932409", "0.49305895", "0.49275067", "0.4908537", "0.48811987", "0.48619094", "0.48561153", "0.48316237", "0.4814083", "0.4...
0.72994655
0
Remove rows from the queue_str that are to be skipped.
def _skip_q_rows(queue_str, skip_rows): if skip_rows is not None: if isinstance(skip_rows, int): skip_rows = [skip_rows] queue_str = [row for i, row in enumerate(queue_str.split('\n')) if i not in skip_rows] queue_str = '\n'.join(queu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_discarded(self):\n while self.shrink_target.has_discards:\n discarded = []\n\n for ex in self.shrink_target.examples:\n if ex.discarded and (not discarded or ex.start >= discarded[-1][-1]):\n discarded.append((ex.start, ex.end))\n\n ...
[ "0.58652204", "0.5480105", "0.5404816", "0.5341779", "0.53255266", "0.5216241", "0.51934636", "0.51636267", "0.5147229", "0.5136533", "0.5135457", "0.50923824", "0.50681114", "0.50654984", "0.50593674", "0.50584257", "0.50341904", "0.50255984", "0.5017315", "0.5010488", "0.50...
0.80545586
0
Parse the qstat or squeue output string into a dict format keyed by integer job id with nested dictionary of job properties (queue printout columns).
def parse_queue_str(cls, queue_str, keys=0): queue_dict = {} queue_rows = queue_str.split('\n') if isinstance(keys, int): del_index = keys keys = [k.strip(' ') for k in queue_rows[keys].strip(' ').split(' ') if k != ''] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_qstat_tabular(qstat_output):\n def parse_qstat_record(record):\n name, state_code = map(str.strip, record.split('|'))\n return name, Torque._job_states[state_code]\n\n jobs = qstat_output.splitlines()\n parsed = {}\n # @TODO: think of catch-and-log parsi...
[ "0.75117475", "0.7507287", "0.6323845", "0.6291171", "0.587316", "0.57964575", "0.5787086", "0.5692806", "0.56149554", "0.560272", "0.54635954", "0.5456524", "0.53843623", "0.5378146", "0.5361576", "0.53173244", "0.5310565", "0.52956265", "0.529004", "0.5283414", "0.52481925"...
0.66597384
2
Run the HPC queue command and return the raw stdout string.
def query_queue(self, job_name=None, user=None, qformat=None, skip_rows=None):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def torque_job(cmd, pollpath, name, queue):\r\n qsub_call = \"qsub -k oe -N %s -q %s\" % (\"MOTU\", queue)\r\n to_submit = 'echo \"%s; echo $? > %s\" | %s' % (cmd, pollpath, qsub_call)\r\n\r\n return to_submit", "def local_job(cmd, pollpath, name, queue):\r\n to_submit = '%s; echo $? > %s' % (cmd, po...
[ "0.618079", "0.61092997", "0.6096919", "0.5966489", "0.58997905", "0.58965266", "0.58196944", "0.5806906", "0.5799842", "0.57297987", "0.5716591", "0.56797427", "0.56374854", "0.56043684", "0.55768055", "0.557292", "0.5551071", "0.5534841", "0.5533441", "0.5524935", "0.552075...
0.0
-1
Get the HPC queue parsed into dict format keyed by integer job id Returns
def queue(self): if self._queue is None: qstr = self.query_queue(user=self._user) self._queue = self.parse_queue_str(qstr) return self._queue
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getJobDict(self):\n c = \"/cli:python /app:matrix /cmd:getinfo /dev:joblist\"\n self.sendCMDstring(c)\n time.sleep(self.delay)\n answers = self.readandparseCAM()\n joblist = {}\n for a in answers:\n if a['dev']=='joblist':\n for i in range(int...
[ "0.6580104", "0.63603884", "0.6311302", "0.6234682", "0.61344546", "0.611889", "0.61056745", "0.6091005", "0.60406655", "0.5977916", "0.59767085", "0.5933365", "0.59134513", "0.5891405", "0.5852129", "0.58519304", "0.5827456", "0.57827514", "0.57827514", "0.5765983", "0.57642...
0.5369835
62
Get a list of the job names in the queue
def queue_job_names(self): return [attrs[self.QCOL_NAME] for attrs in self.queue.values()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_job_names(self):\n return []", "def list_jobs():\n\n name_to_job_details = redis_controller.get_name_to_job_details()\n return list(name_to_job_details.values())", "def job_names(self):\n resp = self._cmd(uri = '/jenkins_jobs')\n names = []\n for item in resp.get('jobs...
[ "0.8273716", "0.7834548", "0.76624656", "0.7539052", "0.7539052", "0.735248", "0.72475135", "0.72475135", "0.72107977", "0.71837294", "0.7078723", "0.70635825", "0.7042516", "0.6969034", "0.69666624", "0.68644357", "0.6825185", "0.68218863", "0.67994833", "0.67952615", "0.677...
0.8310541
0
Get a list of the job integer ids in the queue
def queue_job_ids(self): return list(self.queue.keys())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_jobs_in_queue() -> List[int]:\n output = subprocess.check_output([\"qstat\"]).decode().splitlines()\n job_ids = []\n for line in output:\n m = REGEX_QSTAT.match(line)\n if m:\n job_ids.append(int(m.group(1)))\n return job_ids", "def job_ids(self):\n return self...
[ "0.8098724", "0.80771327", "0.78428227", "0.7811004", "0.775912", "0.72046375", "0.7141711", "0.71055824", "0.6956485", "0.6750556", "0.673579", "0.66713566", "0.6658379", "0.6580794", "0.6493945", "0.647386", "0.6462457", "0.6444312", "0.6428943", "0.6428943", "0.6425815", ...
0.8492634
0
Check the status of an HPC job using the HPC queue.
def check_status(self, job_id=None, job_name=None): status = None if job_id is not None: if int(job_id) in self.queue: status = self.queue[int(job_id)][self.QCOL_STATUS] elif job_name is not None: if job_name in self.queue_job_names: for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_queue(self):\n if self.get_db('jobid') is None:\n log.debug('jobid not found for calculation.')\n return False\n else:\n # get the jobid\n jobid = self.get_db('jobid')\n # see if jobid is in queue\n _, jobids_in_queue, _ = getstatusoutput('qselect',\n ...
[ "0.7212962", "0.69906795", "0.69142705", "0.68985856", "0.6762104", "0.6701875", "0.6539493", "0.6510221", "0.6506319", "0.64982665", "0.64312536", "0.6420319", "0.6400587", "0.63170016", "0.6303401", "0.62657523", "0.62130135", "0.61849165", "0.6177326", "0.61487484", "0.613...
0.748768
0
Run the PBS qstat command and return the raw stdout string.
def query_queue(cls, job_name=None, user=None, qformat=None, skip_rows=None): if user is None: user = cls.USER if skip_rows is None: skip_rows = cls.QSKIP cmd = 'qstat -u {user}'.format(user=user) stdout, _ = cls.submit(cmd) stdout =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call_qstat(args):\n ssh = connect_server()\n i,o,e = ssh.exec_command(qstat_c + ' '.join(args))\n qstat_output = \"\".join(o.readlines() + e.readlines())\n ssh.close()\n return qstat_output.splitlines()", "def qstat(self, *options):\n if self.in_queue():\n jobid = self.get_db('jobid'...
[ "0.76917225", "0.72987676", "0.70081747", "0.6317742", "0.6080672", "0.59704506", "0.58136725", "0.5801401", "0.57817954", "0.5763257", "0.5761995", "0.5737019", "0.57137257", "0.56746584", "0.562217", "0.5587834", "0.5524168", "0.55098206", "0.547213", "0.546408", "0.542598"...
0.5603212
15
Get the HPC queue parsed into dict format keyed by integer job id Returns
def queue(self): if self._queue is None: qstr = self.query_queue(user=self._user) self._queue = self.parse_queue_str(qstr, keys=self.QSTAT_KEYS) return self._queue
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getJobDict(self):\n c = \"/cli:python /app:matrix /cmd:getinfo /dev:joblist\"\n self.sendCMDstring(c)\n time.sleep(self.delay)\n answers = self.readandparseCAM()\n joblist = {}\n for a in answers:\n if a['dev']=='joblist':\n for i in range(int...
[ "0.6580104", "0.63603884", "0.6311302", "0.6234682", "0.61344546", "0.611889", "0.61056745", "0.6091005", "0.60406655", "0.5977916", "0.59767085", "0.5933365", "0.59134513", "0.5891405", "0.5852129", "0.58519304", "0.5827456", "0.57827514", "0.57827514", "0.5765983", "0.57642...
0.56488335
31
Submit a PBS job via qsub command and PBS shell script
def qsub(self, cmd, alloc, queue, name='reV', feature=None, stdout_path='./stdout', keep_sh=False): if len(name) > self.MAX_NAME_LEN: msg = ('Cannot submit job with name longer than {} chars: "{}"' .format(self.MAX_NAME_LEN, name)) logger.error(msg) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def submit(STAGE_ID, *options):\n if any([opt.startswith(\"-t\") for opt in options]):\n wrapper = \"qsubwrapmpi\"\n else:\n wrapper = \"qsubwrap\"\n options = \" \".join(options)\n cmd = \"%s -v STAGE_ID=%s %s %s\" % (wrapper, STAGE_ID, options, jobscript)\n status, output = getstatus...
[ "0.71585524", "0.7095454", "0.6913012", "0.68427753", "0.67105037", "0.6635338", "0.6621555", "0.6582521", "0.6575965", "0.64710623", "0.6449171", "0.6360658", "0.6262581", "0.6214798", "0.62027866", "0.6189288", "0.61486655", "0.6098876", "0.60129523", "0.5985976", "0.597295...
0.75427103
0
Run the HPC queue command and return the raw stdout string.
def query_queue(cls, job_name=None, user=None, qformat=None, skip_rows=None): job_name_str = '' if job_name is not None: job_name_str = ' -n {}'.format(job_name) if user is None: user = cls.USER if qformat is None: qformat = cls.S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def torque_job(cmd, pollpath, name, queue):\r\n qsub_call = \"qsub -k oe -N %s -q %s\" % (\"MOTU\", queue)\r\n to_submit = 'echo \"%s; echo $? > %s\" | %s' % (cmd, pollpath, qsub_call)\r\n\r\n return to_submit", "def local_job(cmd, pollpath, name, queue):\r\n to_submit = '%s; echo $? > %s' % (cmd, po...
[ "0.618079", "0.61092997", "0.6096919", "0.5966489", "0.58997905", "0.58965266", "0.58196944", "0.5799842", "0.57297987", "0.5716591", "0.56797427", "0.56374854", "0.56043684", "0.55768055", "0.557292", "0.5551071", "0.5534841", "0.5533441", "0.5524935", "0.5520751", "0.550482...
0.5806906
7
Submit an scontrol command.
def scontrol(cmd): cmd = 'scontrol {}'.format(cmd) cmd = shlex.split(cmd) subprocess.call(cmd)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sendCommand1(controlName, command):\n return (_sendCommand1(controlName, command))", "def _control_sim(sid: SimulationID, command: int, direct: bool) -> None:\n from datetime import datetime\n data = _get_data(sid)\n task = data.simulation_task\n if direct:\n if comman...
[ "0.61158484", "0.58385885", "0.58221704", "0.578542", "0.5764538", "0.57640177", "0.5724178", "0.56994617", "0.5611968", "0.5530975", "0.5496334", "0.5483568", "0.54329103", "0.54042935", "0.5398764", "0.53919667", "0.5370302", "0.536005", "0.53475225", "0.53416157", "0.53365...
0.7594123
0
Cancel a slurm job.
def scancel(self, arg): if isinstance(arg, (list, tuple)): for job_id in arg: self.scancel(job_id) elif str(arg).lower() == 'all': self._queue = None for job_id in self.queue_job_ids: self.scancel(job_id) elif isinstance(arg,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cli(ctx, job_id):\n return ctx.gi.jobs.cancel_job(job_id)", "def cancel(self):\n\n query = f\"scancel {self.jobid}\"\n if self.cluster:\n query = f\"scancel {self.jobid} --clusters={self.cluster}\"\n\n cmd = BuildTestCommand(query)\n cmd.execute()\n logger.deb...
[ "0.81184655", "0.77775484", "0.7752752", "0.77182156", "0.7651253", "0.75357336", "0.74445", "0.7247063", "0.7203991", "0.7143121", "0.71266365", "0.70993674", "0.70989627", "0.7088082", "0.7037014", "0.6926576", "0.6873473", "0.66801196", "0.65792006", "0.6534588", "0.652601...
0.7092478
13
Change the priority (quality of service) for a job.
def change_qos(self, arg, qos): if isinstance(arg, (list, tuple)): for job_id in arg: self.change_qos(job_id, qos) elif isinstance(arg, int): cmd = 'update job {} QOS={}'.format(arg, qos) self.scontrol(cmd) elif str(arg).lower() == 'all': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_priority(self, job_id, priority):\n job = Job.get_job_by_id(job_id)\n self.access_handler.check_set_priority(job)\n self.master.set_priority(job, priority)", "def setPriority(self, p):\n self.priority = p", "def set_priority(self, priority):\n self.options[\"priority\"] =...
[ "0.7372553", "0.7036113", "0.6895505", "0.6844057", "0.67064804", "0.65743196", "0.65711", "0.6561583", "0.65599465", "0.64675015", "0.64348304", "0.6413691", "0.6413691", "0.6413691", "0.63784474", "0.632495", "0.62253755", "0.6220823", "0.62136775", "0.61366487", "0.6136188...
0.60004455
23
Temporarily hold a job from submitting. Held jobs will stay in queue but will not get nodes until released.
def hold(self, arg): if isinstance(arg, (list, tuple)): for job_id in arg: self.hold(job_id) elif isinstance(arg, int): cmd = 'hold {}'.format(arg) self.scontrol(cmd) elif str(arg).lower() == 'all': self._queue = None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startingNewStep(self):\n with self.__queueLock:\n self.__submittedJobs = []", "def _queue_job(jid):\n q.put(jid)", "def _queue_job(jid):\n q.put(jid)", "def queue(self):\n if not self.parent_node.is_job:\n return\n\n self.winstance.send_event('Queuing job..')\n ...
[ "0.64678556", "0.6229863", "0.6229863", "0.6202475", "0.619575", "0.5986199", "0.5928837", "0.5924058", "0.59099895", "0.59016895", "0.5852931", "0.58159703", "0.5777437", "0.5706513", "0.5671671", "0.5668714", "0.56282496", "0.56282496", "0.552762", "0.5524798", "0.5470334",...
0.50510496
67
Release a job that was previously on hold so it will be submitted to a compute node.
def release(self, arg): if isinstance(arg, (list, tuple)): for job_id in arg: self.release(job_id) elif isinstance(arg, int): cmd = 'release {}'.format(arg) self.scontrol(cmd) elif str(arg).lower() == 'all': self._queue = None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _release(self):\n\n os.write(self.job_pipe[1], b'+')", "def _release_lock(self, job_info):\n os.remove(self.lock_file)\n self.logger.debug(\"lock release for '%s'\" % job_info)", "def release(self):\n self.acquired = False", "def release(self, bay_uuid):\n # Only the co...
[ "0.6697364", "0.66029674", "0.6311234", "0.6133235", "0.61005574", "0.60507447", "0.60332566", "0.60152566", "0.60146785", "0.60118544", "0.60118544", "0.60118544", "0.59991455", "0.594318", "0.5931199", "0.5915009", "0.59079945", "0.5888168", "0.5885615", "0.588469", "0.5881...
0.63331217
2
Get special sbatch request strings for SLURM features, memory, modules, and conda environments
def _special_cmd_strs(feature, memory, module, module_root, conda_env): feature_str = '' if feature is not None: feature_str = '#SBATCH {} # extra feature\n'.format(feature) mem_str = '' if memory is not None: mem_str = ('#SBATCH --mem={} # node RAM in MB\n' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _GetEnvironmentVars(benchmark_spec):\n return ' '.join([\n 'NUM_GPUS=%s' % benchmark_spec.total_gpus,\n 'OMP_NUM_THREADS=%s' % benchmark_spec.cpus_per_rank\n ])", "def slurm(ctx, alloc, nodes, memory, walltime, feature, conda_env, module,\n stdout_path, verbose):\n\n name = ctx.obj['N...
[ "0.5991726", "0.5722359", "0.5467262", "0.5430195", "0.5405498", "0.53937364", "0.5297909", "0.5296478", "0.5159235", "0.5117139", "0.50537795", "0.5013929", "0.501283", "0.5005968", "0.49504542", "0.49317688", "0.490989", "0.4881221", "0.48775366", "0.48487797", "0.4847411",...
0.6994536
0
Check stdout for a job id and return just the job id if present, otherwise return full stdout.
def _job_id_or_out(out): stdout = re.sub("[^0-9]", "", str(out)) if not stdout: stdout = out return stdout
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getjobid(self, job_dir):\n input = os.path.join(job_dir,'job_id.txt')\n result = None\n if os.path.exists(input):\n contents = file(input).read()\n for c in contents.split('\\n'):\n if c and re.match('^Job <\\\\d*> is submitted to queue <.*>',c) is not ...
[ "0.66317225", "0.6467701", "0.6398876", "0.6239879", "0.6168", "0.6134288", "0.59314007", "0.59240144", "0.58849907", "0.5877714", "0.582274", "0.58160233", "0.5781358", "0.5755716", "0.57437587", "0.57348174", "0.5688087", "0.56809086", "0.5653149", "0.5645773", "0.5628289",...
0.7391676
0
Submit a SLURM job via sbatch command and SLURM shell script
def sbatch(self, cmd, alloc=None, walltime=None, memory=None, nodes=1, feature=None, name='reV', stdout_path='./stdout', keep_sh=False, conda_env=None, module=None, module_root='/shared-projects/rev/modulefiles'): if len(name) > self.MAX_NAME_LEN: msg = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def submit_job(sample_config, jobname, rundir, cliargs, extramodules=[]):\n slurmfile_path = os.path.join(rundir, \"{}.slurm\".format(jobname))\n with open(slurmfile_path, \"w\") as slurmfile:\n slurmfile.write(\"#! /bin/bash -l\\n\")\n slurmfile.write(\"#SBATCH -A {}\\n\".format(cliargs.projec...
[ "0.7767973", "0.7430228", "0.7365613", "0.73106", "0.7287275", "0.7097567", "0.68471104", "0.6811804", "0.67943597", "0.6710504", "0.6694972", "0.66010755", "0.65791327", "0.655623", "0.6522866", "0.65226007", "0.6492101", "0.6465887", "0.6458933", "0.6431161", "0.6384085", ...
0.75273824
1
Calculates the softmax for each row of the input x. Your code should work for a row vector and also for matrices of shape (n, m).
def softmax(x): x_exp = np.exp(x) x_sum = np.sum(x_exp, axis=1, keepdims=True) s = x_exp / x_sum return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(x):\n x = np.array(x)\n if x.ndim == 1:\n return column_softmax(x)\n else:\n ret_arr = np.array([column_softmax(col) for col in x.T])\n return ret_arr.T", "def softmax(x: npt.NDArray) -> npt.NDArray:\n row_wise_max = np.max(x, axis=1).reshape(-1, 1)\n exp_x = np.exp(x - row_wise_max...
[ "0.8463776", "0.8435088", "0.8414381", "0.82625526", "0.8240777", "0.8203867", "0.8156382", "0.81255054", "0.8109221", "0.8072896", "0.8058246", "0.8042024", "0.7988304", "0.7928008", "0.7902256", "0.78875816", "0.7881924", "0.7847789", "0.78416556", "0.7826352", "0.7824393",...
0.7576917
89
Counts the occurences of the regular expressions you will write.
def count_regexp(): # Here's an example regular expression that roughly matches a valid email address. # The ones you write below should be shorter than this email = re.compile("[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+\.[a-zA-Z]{2,5}") ###### Write below ######### subheading = re.compile("\=\=+.*\=\=+")...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def counts(self, regex = \"\\w+\"): \n tokenizer = RegexpTokenizer(r'{}'.format(regex))\n count = []\n for i in tqdm(self.text):\n count.append(len(tokenizer.tokenize(i)))\n return count", "def count_regexp_occ(regexp=\"\", text=None):\n return len(re.findall(rege...
[ "0.6603277", "0.6473146", "0.6473146", "0.6335502", "0.6326465", "0.6281599", "0.62775224", "0.6204243", "0.6147632", "0.6115495", "0.6080672", "0.607526", "0.59416723", "0.58771884", "0.58596057", "0.5846294", "0.5826234", "0.5753396", "0.5752021", "0.573326", "0.5732142", ...
0.749758
0
Returns the overall counts of articles, quotes, sources, people and authors in the database.
def db_stats(args: Dict[str, Any]) -> List[object]: query = [ { "$match": { "body": {"$ne": ""}, "quotesUpdated": {"$exists": True}, "outlet": {"$in": args["outlets"]}, "publishedAt": { "$gte": args["begin_date"]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def correct_counts():\n articles = mongo.db[app.config['ARTICLES_COLLECTION']]\n monitors = mongo.db[app.config['MONITORS_COLLECTION']]\n unique = articles.distinct('feed_source', dict())\n for link in unique:\n count = articles.count({'feed_source': link})\n monitors.update({'metadata.rs...
[ "0.6533682", "0.63933384", "0.63456047", "0.6326299", "0.6283367", "0.62526053", "0.6249434", "0.62403613", "0.61520904", "0.60861903", "0.60609365", "0.6047205", "0.6042536", "0.6018646", "0.6017042", "0.60060835", "0.60059154", "0.598452", "0.5972809", "0.5972233", "0.59621...
0.62628984
5
Returns the counts of articles, quotes, sources, people and authors grouped by the publishing outlet.
def outlet_stats(args: Dict[str, Any]) -> List[object]: query = [ { "$match": { "body": {"$ne": ""}, "quotesUpdated": {"$exists": True}, "outlet": {"$in": args["outlets"]}, "publishedAt": { "$gte": args["begin_da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def daily_article_counts(args: Dict[str, Any]) -> List[object]:\n query = [\n {\n \"$match\": {\n \"outlet\": {\"$in\": args[\"outlets\"]},\n \"publishedAt\": {\n \"$gte\": args[\"begin_date\"],\n \"$lt\": args[\"end_date\"] +...
[ "0.6641451", "0.6594027", "0.609627", "0.60139996", "0.60049236", "0.59390366", "0.58774114", "0.58294153", "0.58186644", "0.5793566", "0.5775842", "0.575149", "0.56283534", "0.5605162", "0.55714655", "0.5557268", "0.5527308", "0.55222803", "0.5514021", "0.55080914", "0.54788...
0.68048644
0
Returns the names of the topN female sources (i.e. people quoted). If sorted in ascending order, the returned values represent the bottomN female sources.
def top_sources_female(args: Dict[str, Any]) -> List[object]: query = [ { "$match": { "body": {"$ne": ""}, "quotesUpdated": {"$exists": True}, "outlet": {"$in": args["outlets"]}, "publishedAt": { "$gte": args["be...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_top_five_countries():\n countries=country_populations.split('\\n')\n top_5=[]\n count=0\n for country in countries:\n if count<6:\n data= country.split('\\t')\n top_5.append(data[1])\n count+=1\n top_5.remove('Country')\n return top_5", "def get_t...
[ "0.61172545", "0.59121114", "0.5909458", "0.5758684", "0.57050043", "0.5610208", "0.557011", "0.556409", "0.55274975", "0.5517988", "0.5496929", "0.54120415", "0.5354707", "0.53357583", "0.5312174", "0.5304028", "0.52824086", "0.5277953", "0.52743703", "0.5156685", "0.5156685...
0.61862856
0
Returns the names of the topN male sources (i.e. people quoted) If sorted in ascending order, the returned values represent the bottomN male sources.
def top_sources_male(args: Dict[str, Any]) -> List[object]: query = [ { "$match": { "body": {"$ne": ""}, "quotesUpdated": {"$exists": True}, "outlet": {"$in": args["outlets"]}, "publishedAt": { "$gte": args["begi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_top_five_countries():\n countries=country_populations.split('\\n')\n top_5=[]\n count=0\n for country in countries:\n if count<6:\n data= country.split('\\t')\n top_5.append(data[1])\n count+=1\n top_5.remove('Country')\n return top_5", "def top_s...
[ "0.61076355", "0.60428524", "0.5827024", "0.5753119", "0.56296337", "0.5583178", "0.5564095", "0.5548946", "0.5536436", "0.5528105", "0.5505326", "0.5449902", "0.5427936", "0.5384758", "0.5322544", "0.52708346", "0.5269185", "0.52411515", "0.5210623", "0.5191965", "0.51891917...
0.6174725
0
Returns the names of the topN unknown sources (i.e. people quoted) If sorted in ascending order, the returned values represent the bottomN unknown sources. This function is useful to identify if the NER module is wrongly identifying nonhuman entities for gender recognition.
def top_sources_unknown(args: Dict[str, Any]) -> List[object]: query = [ { "$match": { "body": {"$ne": ""}, "quotesUpdated": {"$exists": True}, "outlet": {"$in": args["outlets"]}, "publishedAt": { "$gte": args["b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_most_mentioned_domain_names(self, n: int = 15) -> list:\n rex = re.compile(r'https?://[^/]+')\n c = Counter()\n\n for entry in self.entries:\n domains = set(re.findall(rex, entry.summary))\n for domain in domains:\n if domain not in IGNORE_DOMAINS:\...
[ "0.5438144", "0.53108513", "0.5292486", "0.51422256", "0.50795126", "0.50723386", "0.5067788", "0.5062302", "0.50510025", "0.50035435", "0.49705988", "0.49468875", "0.4936847", "0.49250895", "0.49103707", "0.49024624", "0.4894621", "0.48907855", "0.48807895", "0.48807895", "0...
0.5611983
0
Returns the names of the topN male + female sources (i.e. people quoted). If sorted in ascending order, the returned values represent the bottomN male + female sources.
def top_sources_all(args: Dict[str, Any]) -> List[object]: query = [ { "$match": { "body": {"$ne": ""}, "quotesUpdated": {"$exists": True}, "outlet": {"$in": args["outlets"]}, "publishedAt": { "$gte": args["begin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top_sources_female(args: Dict[str, Any]) -> List[object]:\n query = [\n {\n \"$match\": {\n \"body\": {\"$ne\": \"\"},\n \"quotesUpdated\": {\"$exists\": True},\n \"outlet\": {\"$in\": args[\"outlets\"]},\n \"publishedAt\": {\n ...
[ "0.59873754", "0.58804756", "0.5805774", "0.57042825", "0.56672215", "0.56196725", "0.5616829", "0.56092155", "0.5573981", "0.553591", "0.54697627", "0.5401642", "0.5400069", "0.5330378", "0.52876496", "0.525209", "0.524347", "0.52253646", "0.5189811", "0.5183719", "0.5151563...
0.47820303
74
Returns the total number of male, female and unknown sources for all articles written by female authors only, grouped by outlet.
def female_author_sources(args: Dict[str, Any]) -> List[object]: query = [ { "$match": { "body": {"$ne": ""}, "quotesUpdated": {"$exists": True}, "outlet": {"$in": args["outlets"]}, "publishedAt": { "$gte": args[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def male_author_sources(args: Dict[str, Any]) -> List[object]:\n query = [\n {\n \"$match\": {\n \"body\": {\"$ne\": \"\"},\n \"quotesUpdated\": {\"$exists\": True},\n \"outlet\": {\"$in\": args[\"outlets\"]},\n \"publishedAt\": {\n ...
[ "0.63028884", "0.6067728", "0.5979208", "0.5923935", "0.563917", "0.56347656", "0.5618972", "0.55839", "0.5571018", "0.5537448", "0.5448501", "0.543584", "0.5417854", "0.5402827", "0.53901386", "0.5271362", "0.5158223", "0.51473176", "0.5140698", "0.51267785", "0.51085174", ...
0.6584573
0