query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Makes some plots of basis and weights from PCA.
def plot_pca(basis, weights): file_name = '../Data/lhc_512_5.txt' params = np.loadtxt(file_name) ncomp, imsize = basis.shape npix = int(np.sqrt(imsize)) ncol = int(ncomp//2) nsamp, _ = weights.shape # Shows the basis images for i in range(ncomp): plt.subplot(2, ncol, i+1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def biplot(score,coeff,pcax,pcay,labels=None,nm=None):\n pca1=pcax-1\n pca2=pcay-1\n xs = score[:,pca1]\n ys = score[:,pca2]\n n=score.shape[1]\n if nm == None:\n nm = n\n #construct scales to constrain data between -1 and 1\n scalex = 1.0/(xs.max()- xs.min())\n scaley = 1.0/(ys.m...
[ "0.61112005", "0.6107796", "0.605294", "0.6041272", "0.59383196", "0.5867305", "0.5829947", "0.57980055", "0.57948554", "0.5778952", "0.5778892", "0.5736685", "0.5724429", "0.5701874", "0.5699105", "0.56431276", "0.5636154", "0.5602408", "0.56010866", "0.55729365", "0.5569386...
0.71734154
0
Compute the mean square error (mse) and the r squared error (r2) of the predicted set of images.
def mse_r2(true, predicted): # Reshaping set of images # n_imgs, nx, ny = true.shape # true = np.reshape(true, (n_imgs, nx*ny)) # predicted = np.reshape(predicted, (n_imgs, nx*ny)) nx = 33 ny = 33 # Compute MSE se = np.sum((true - predicted)**2, axis=1) mse = se*(nx*ny)**-1 # C...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rmse(actual: np.ndarray, predicted: np.ndarray):\n return np.sqrt(np.mean(np.square(_error(actual, predicted))))", "def calculate_mse(img0, img1):\n mse = skm.mean_squared_error(img0, img1)\n return mse", "def mse(img1, img2):\n err = (np.square(img1 - img2)).mean(axis=None)\n # return the M...
[ "0.7332509", "0.73320276", "0.72431654", "0.72006863", "0.72006863", "0.7062214", "0.7058034", "0.7046866", "0.7036136", "0.70209587", "0.7015327", "0.7009079", "0.69375265", "0.6931622", "0.69304883", "0.6926234", "0.6923181", "0.6911265", "0.6903844", "0.68933755", "0.68732...
0.8477247
0
When select file button is pressed a dialog of filenames is presented to the user. The entire text of the selected files is then added to the selected case.
def add_files_to_case(self): index_list = self.ui.tableWidget.selectionModel().selectedIndexes() rows = [] for i in index_list: rows.append(i.row()) rows = list(set(rows)) # duplicate rows due to multiple columns if len(rows) == 0: return selecte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def selectFiles(self):\n\n filenames = []\n self.fileIDs = \"\"\n self.caseIDs = \"\" # clears any case selections\n cur = self.settings['conn'].cursor()\n cur.execute(\"select id, name, status from source\")\n result = cur.fetchall()\n for row in result:\n ...
[ "0.7599809", "0.7312092", "0.71427107", "0.7118748", "0.70763516", "0.7027887", "0.70081896", "0.6910631", "0.6909173", "0.6898093", "0.6897799", "0.6894666", "0.6867969", "0.6848958", "0.684623", "0.68427694", "0.67669785", "0.67478716", "0.674199", "0.6724243", "0.6709323",...
0.74605596
1
The entire text of the selected file is added to the selected case. Also, a nontext file is linked to the case here. The text positions will be 0 and 0.
def add_file_to_case(self, file_): cur = self.app.conn.cursor() text_len = 0 if file_[2] is not None: text_len = len(file_[2]) - 1 link = {'caseid': self.case['caseid'], 'fid': file_[0], 'pos0': 0, 'pos1': text_len, 'owner': self.app.settings['codername'], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mark(self):\n\n if self.selected_text_file is None:\n return\n # selectedText = self.textBrowser.textCursor().selectedText()\n pos0 = self.ui.textBrowser.textCursor().selectionStart()\n pos1 = self.ui.textBrowser.textCursor().selectionEnd()\n if pos0 == pos1:\n ...
[ "0.67745167", "0.66048443", "0.64684236", "0.64509314", "0.6278228", "0.6071602", "0.60579133", "0.5877363", "0.5813676", "0.57943785", "0.5788398", "0.57818663", "0.5736257", "0.5703492", "0.5703116", "0.5663151", "0.56324875", "0.5624252", "0.55971783", "0.55862516", "0.556...
0.6665885
1
Remove selected files from case.
def remove_files_from_case(self): index_list = self.ui.tableWidget.selectionModel().selectedIndexes() rows = [] for i in index_list: rows.append(i.row()) rows = list(set(rows)) # duplicate rows due to multiple columns if len(rows) == 0: return se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_files(self, files: Set[str]) -> None:\n for f in files:\n src = os.path.join(self.get_directory(), f)\n os.remove(src)", "def clean_files(self):\n self.filenames.clear()", "def _remove_files(self):\n if hasattr(self, 'files'):\n for file in self....
[ "0.69670033", "0.6920205", "0.65350205", "0.65289146", "0.6523229", "0.6520089", "0.6501256", "0.6375232", "0.6366755", "0.63380545", "0.6300556", "0.6276868", "0.62680596", "0.62603486", "0.62171566", "0.6187643", "0.6185476", "0.616471", "0.6157825", "0.61527884", "0.614303...
0.7693116
0
Show or hide table rows if check box hide is checked or not.
def show_or_hide_rows(self): rows = self.ui.tableWidget.rowCount() if self.ui.checkBox_hide.isChecked(): for r in range(0, rows): # Text present so hide if len(self.ui.tableWidget.item(r, 2).text()) > 0: self.ui.tableWidget.hideRow(r) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hideallstate(self):\n if self.hideallcheck.isChecked() == True:\n self.field.setOwnRobotsVisibility(False, self.index)\n self.field.setPathVisibility(False, self.index)\n self.field.setBallVisibility(False, self.index)\n self.field.setTeammateVisibility(False,...
[ "0.5464415", "0.5450269", "0.544036", "0.5378214", "0.5378214", "0.51764005", "0.5109101", "0.5095365", "0.50392693", "0.5015401", "0.4977343", "0.49333766", "0.49240357", "0.4893646", "0.48924047", "0.48620972", "0.481087", "0.48104262", "0.48057994", "0.48027998", "0.476433...
0.7700553
0
Row selection changed. If first row is text, show the text in textEdit.
def row_selection_changed(self): index_list = self.ui.tableWidget.selectionModel().selectedIndexes() rows = [] for i in index_list: rows.append(i.row()) rows = list(set(rows)) # duplicate rows due to multiple columns if len(rows) == 0: return sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handleTableSelectionChange(self):\n self.selectEntireRow()\n self.showSelectedDataset()", "def user_selection(self, selected):\n\n source_index = self.proxy_model.mapToSource(selected)\n self.row = self.table_model.selectedRow(source_index.row())\n\n self.curr_selection()\n...
[ "0.7136895", "0.672994", "0.6510278", "0.64237314", "0.64045364", "0.61852086", "0.60918605", "0.5974532", "0.59213084", "0.58744264", "0.5853039", "0.5832434", "0.58085626", "0.5803898", "0.5799842", "0.57951725", "0.5766497", "0.5761151", "0.57519233", "0.5741872", "0.57338...
0.7985545
0
Open image or media file to view. Check media file link works, as media may have moved. Text files are displayed via row_selection_changed.
def view_file(self): index_list = self.ui.tableWidget.selectionModel().selectedIndexes() index = None if len(index_list) > 0: index = index_list[0].row() if index is None: return # Need the data as a dictionary to view images and audio/video dict...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_media(self, obj):\n for handle in self.selected_handles():\n ref_obj = self.dbstate.db.get_object_from_handle(handle)\n mpath = media_path_full(self.dbstate.db, ref_obj.get_path())\n open_file_with_default_application(mpath)", "def __openFile(self):\n itm =...
[ "0.70973283", "0.6602566", "0.64204323", "0.61612755", "0.61230564", "0.61121106", "0.60914075", "0.6049491", "0.6022753", "0.60044396", "0.5955318", "0.5933987", "0.59316117", "0.58974123", "0.58972645", "0.5885088", "0.5837336", "0.582319", "0.57997763", "0.5786882", "0.577...
0.74040633
0
Load case text for selected_text_file.
def load_case_text(self): self.case_text = [] if self.selected_text_file is None: return cur = self.app.conn.cursor() cur.execute("select caseid, fid, pos0, pos1, owner, date, memo from case_text where fid = ? and caseid = ?", [self.selected_text_file[ID]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(file):\n\n try:\n with open(file) as in_file:\n loaded_text = in_file.read().strip().split(\"\\n\")\n loaded_text = [x.lower() for x in loaded_text]\n return loaded_text\n except IOError as e:\n print(\"{}\\n Error opening {}. Terminationg program.\".fo...
[ "0.6466261", "0.6265181", "0.6237055", "0.62311083", "0.61719495", "0.61592454", "0.6108069", "0.60587436", "0.6046481", "0.5990657", "0.59851503", "0.588781", "0.58720994", "0.58479667", "0.58400893", "0.5826861", "0.5807017", "0.57860124", "0.57841766", "0.57835245", "0.576...
0.7759995
0
Context menu for textBrowser. Mark, unmark, copy, select all.
def text_browser_menu(self, position): if self.ui.textBrowser.toPlainText() == "": return cursor = self.ui.textBrowser.cursorForPosition(position) selected_text = self.ui.textBrowser.textCursor().selectedText() menu = QtWidgets.QMenu() menu.setStyleSheet("QMenu {font...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def text_select_context_menu_click (selectedtext) :\n\tsettings = Composition.CompositionManager.Get[Interfaces.Settings.IApplicationSettingsProvider]()\n\tsettings.GlobalExclude.Add(selectedtext)", "def on_context_menu(self, event):\n self.declaration.context_menu_event()", "def select_editor_contextua...
[ "0.69107985", "0.6675353", "0.6581614", "0.6338795", "0.6309858", "0.62430674", "0.6161751", "0.61062753", "0.6101523", "0.60749346", "0.60675216", "0.6040953", "0.59743303", "0.5966907", "0.592536", "0.5858884", "0.5840029", "0.583531", "0.57941383", "0.57554394", "0.5729040...
0.75562125
0
Check current text selection and return False if not marked and True if marked.
def is_marked(self): pos0 = self.ui.textBrowser.textCursor().selectionStart() pos1 = self.ui.textBrowser.textCursor().selectionEnd() for c in self.case_text: if c['pos0'] <= pos0 <= c['pos1']: return True if c['pos0'] <= pos1 <= c['pos1']: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hasSelectedText(self):\n return self.textCursor().hasSelection()", "def HasSelection(self):\n sel = super(EditraBaseStc, self).GetSelection()\n return sel[0] != sel[1]", "def IsSelected(self):\r\n\r\n return self._hasHilight != 0", "def _can_add_text(self):\n return sel...
[ "0.7856161", "0.69251645", "0.67446756", "0.66529745", "0.63673097", "0.63556296", "0.62504935", "0.62277675", "0.6220633", "0.61411035", "0.6019499", "0.59944403", "0.59551316", "0.59294784", "0.59294784", "0.5870629", "0.5837775", "0.5812784", "0.5779514", "0.57756186", "0....
0.7682713
1
Remove all text highlighting from current file.
def unlight(self): if self.selected_text_file is None: return if self.selected_text_file[FULLTEXT] is None: return cursor = self.ui.textBrowser.textCursor() try: cursor.setPosition(0, QtGui.QTextCursor.MoveMode.MoveAnchor) cursor.setPositi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_highlighting(self):\n for match in vim.eval('getmatches()'):\n if match['group'] == 'PSearchMatches':\n vim.command(\"call matchdelete({0})\".format(match['id']))", "def __unhighlight(self):\n self.unhighlight()", "def clear_highlight(self):\n core = cut...
[ "0.7206986", "0.7137766", "0.7049057", "0.6944913", "0.6892949", "0.6847911", "0.6067839", "0.6041372", "0.58566576", "0.57954323", "0.5773145", "0.5745158", "0.57420564", "0.57248193", "0.57221854", "0.5707038", "0.5656613", "0.5656423", "0.5652253", "0.56450975", "0.5608958...
0.723039
0
Apply text highlighting to current file. Highlight text of selected case with red underlining. format_.setForeground(QtGui.QColor("990000"))
def highlight(self): if self.selected_text_file is None: return if self.selected_text_file[FULLTEXT] is None: return format_ = QtGui.QTextCharFormat() cursor = self.ui.textBrowser.textCursor() for item in self.case_text: try: c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def highlightCode(self, _event=None):\n count = 0\n if self.text.tag_ranges('sel'):\n self.text.tag_add('color' + str(count), tk.SEL_FIRST, tk.SEL_LAST)\n self.text.tag_configure('color' + str(count), foreground='black', background='yellow')\n coun...
[ "0.73625904", "0.7081406", "0.67791414", "0.66204315", "0.65363246", "0.6494588", "0.6297588", "0.62256855", "0.61767644", "0.61758226", "0.61407155", "0.606125", "0.6051572", "0.6048676", "0.60164833", "0.5956007", "0.58919746", "0.58887446", "0.5838698", "0.5821508", "0.579...
0.7963435
0
Mark selected text in file with this case.
def mark(self): if self.selected_text_file is None: return # selectedText = self.textBrowser.textCursor().selectedText() pos0 = self.ui.textBrowser.textCursor().selectionStart() pos1 = self.ui.textBrowser.textCursor().selectionEnd() if pos0 == pos1: retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def highlight(self):\n\n if self.selected_text_file is None:\n return\n if self.selected_text_file[FULLTEXT] is None:\n return\n format_ = QtGui.QTextCharFormat()\n cursor = self.ui.textBrowser.textCursor()\n for item in self.case_text:\n try:\n ...
[ "0.66256595", "0.6417178", "0.63301915", "0.60256416", "0.5986319", "0.59574735", "0.5922415", "0.5900653", "0.5900653", "0.58704287", "0.58704287", "0.5820807", "0.5796124", "0.5772516", "0.57527184", "0.57029754", "0.56840825", "0.5661256", "0.5641625", "0.56144583", "0.559...
0.72556025
0
Remove case marking from selected text in selected file.
def unmark(self, position): if self.selected_text_file is None: return if len(self.case_text) == 0: return cursor = self.ui.textBrowser.cursorForPosition(position) self.ui.textBrowser.setTextCursor(cursor) location = self.ui.textBrowser.textCursor().sele...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_files_from_case(self):\n\n index_list = self.ui.tableWidget.selectionModel().selectedIndexes()\n rows = []\n for i in index_list:\n rows.append(i.row())\n rows = list(set(rows)) # duplicate rows due to multiple columns\n if len(rows) == 0:\n retu...
[ "0.6281262", "0.62588793", "0.5885497", "0.56027263", "0.5555215", "0.5555215", "0.5484803", "0.54414994", "0.5382209", "0.53529084", "0.52868575", "0.5248693", "0.5205808", "0.51960534", "0.51928306", "0.5141761", "0.5141761", "0.51227355", "0.50720865", "0.50587964", "0.505...
0.68767476
0
Automark text in one or more files with selected case. Each selected_file is a tuple of id, name,fulltext, mediapath, memo, owner, date
def automark(self): index_list = self.ui.tableWidget.selectionModel().selectedIndexes() rows = [] for i in index_list: rows.append(i.row()) rows = list(set(rows)) # duplicate rows due to multiple columns if len(rows) == 0: return selected_files =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def selectFiles(self):\n\n filenames = []\n self.fileIDs = \"\"\n self.caseIDs = \"\" # clears any case selections\n cur = self.settings['conn'].cursor()\n cur.execute(\"select id, name, status from source\")\n result = cur.fetchall()\n for row in result:\n ...
[ "0.660735", "0.63067484", "0.6029698", "0.60066223", "0.59928775", "0.59761703", "0.59170103", "0.58575195", "0.58572716", "0.58405566", "0.58404976", "0.5827184", "0.57653266", "0.5730854", "0.56902236", "0.5616098", "0.5498412", "0.5475154", "0.54671156", "0.54535323", "0.5...
0.6344962
1
To generate a homogeneous Poisson point pattern in space S X T, it basically
def __homogeneous_poisson_sampling(T, S, maximum): _S = [T] + S # sample the number of events from S n = utils.lebesgue_measure(_S) N = tf.random.poisson(lam=maximum * n, shape=[1], dtype=tf.int32) # simulate spatial sequence and temporal sequence separately. points ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def homogenous_poisson_gen():\n pass", "def inhomogenous_poisson_gen():\n pass", "def toy_poisson_1d(seed=default_seed):\n\n X = np.arange(0,100,5)[:,None]\n F = np.round(np.sin(X/18.) + .1*X) + np.arange(5,25)[:,None]\n E = np.random.randint(-5,5,20)[:,None]\n Y = F + E\n\n kernel = GPy....
[ "0.7008877", "0.70041984", "0.6226595", "0.6033562", "0.60180074", "0.5884325", "0.5813987", "0.57646567", "0.57316214", "0.5635626", "0.56014806", "0.5587823", "0.55146223", "0.5510471", "0.55041295", "0.5473622", "0.5464378", "0.5455472", "0.54425746", "0.53956705", "0.5387...
0.70617217
0
generate samples with batch_size by thining algorithm, return sampling sequences and corresponding elementwise loglikelihood value.
def sampling(self, T, S, batch_size, keep_latest_k): points_list = [] size_list = [] # generate inhomogeneous poisson points iterately for b in range(batch_size): homo_points = self.__homogeneous_poisson_sampling(T, S, self.maximum) points = self._inhomogen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample_batch(self, batch_size):\n batch = []\n\n # Sample using prorities\n if(self.with_per):\n T = self.buffer.total() // batch_size\n for i in range(batch_size):\n a, b = T * i, T * (i + 1)\n s = random.uniform(a, b)\n i...
[ "0.6539411", "0.6458321", "0.6340587", "0.63209933", "0.630707", "0.6266073", "0.6266073", "0.625791", "0.62345713", "0.6177827", "0.6166631", "0.6160624", "0.61466736", "0.612205", "0.6086653", "0.60320735", "0.6026833", "0.600623", "0.597137", "0.59568256", "0.59458864", ...
0.6672451
0
Decorator to pass in instance_uuid as instance_id
def uuidize(f): @functools.wraps(f) def wrapper(*args, **kwargs): if 'instance_id' in kwargs and 'instance_uuid' in kwargs: kwargs['instance_id'] = kwargs['instance_uuid'] del kwargs['instance_uuid'] return f(*args, **kwargs) return wrapper
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_instance_id(self):\n return self.__instance_id", "def uuid(self):\n raise NotImplementedError", "def uuid(self):\n raise NotImplementedError", "def uuid(self):\n raise NotImplementedError", "def get_uuid(self, obj):\n return IUUID(obj, None)", "def get_uuid(self, o...
[ "0.67995924", "0.6435182", "0.6435182", "0.6435182", "0.6259262", "0.6259262", "0.62581223", "0.61940676", "0.6163332", "0.5998131", "0.5985018", "0.5976193", "0.5933036", "0.5872257", "0.5870427", "0.5870427", "0.5848155", "0.58157057", "0.5784641", "0.5778465", "0.5777457",...
0.8623325
0
Utility to return a message with kwarg variables appended
def _log_kwargs(msg='', **kwargs): kwarg_msg = ' '.join([('%s: |%s|' % (str(key), kwargs[key])) for key in kwargs]) return "%s %s" % (msg, kwarg_msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_message(self, *args, **kwargs):\n\n message = ''\n message += ', '.join([str(key) + ': ' + str(val) for key, val in kwargs.items()]) + '; ' if kwargs else ''\n message += ', '.join(str(val) for val in args) if args else ''\n\n return message", "def format(self, kwmsg):\n ...
[ "0.7438445", "0.6609422", "0.63775367", "0.63635904", "0.63608533", "0.62179434", "0.6209629", "0.6205746", "0.61822826", "0.6123762", "0.6027747", "0.60020286", "0.59981364", "0.59943974", "0.59677136", "0.5967563", "0.59581226", "0.594761", "0.5929051", "0.5896314", "0.5854...
0.7287521
1
gets mac address and ips from melange for an interface, gets port from quantum for that interface, then updates the allowed address pairs in quantum to match what is in melange Takes no action if unnecessary by CONF or if vif cannot be found
def _update_port_allowed_address_pairs(self, tenant_id, instance_id, interface_id, network_id): if (CONF.quantum_use_port_security and CONF.quantum_default_tenant_id == tenant_id): # get the whole vif record vif = self.m_conn.ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_port_ip_address(self):\n leases = None\n req = dict(ip='0.0.0.0')\n instances = self.get_vms_for_this_req(**req)\n if instances is None:\n return\n\n for vm in instances:\n if not leases:\n # For the first time finding the leases fi...
[ "0.5800621", "0.56767285", "0.56355685", "0.56091154", "0.5490392", "0.54267025", "0.5423052", "0.5410452", "0.5391861", "0.53898084", "0.538573", "0.5363289", "0.5357894", "0.5292384", "0.52906984", "0.52846986", "0.52736956", "0.5267511", "0.5242984", "0.52397585", "0.52001...
0.673502
0
Advance to the next profile in the current file.
def advance_file_position_to_next_profile(self, fid): # Each profile record is made up of 80 data characters # (including blanks at the end of the profile) # and return characters (LF+CR). fid.seek(self._calculate_next_profile_position()) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def advance(self) -> None:\n self.current_token = self.jack_file_tokens[self._token_idx]\n self._token_idx += 1", "def next_file(self):\n raise NotImplementedError()", "def nextPicture(self):\n\t\tif self.currentPicture == self.totalPictures-1:\n\t\t\tself.currentPicture = 0\n\t\telse:\n\t...
[ "0.64586663", "0.6085671", "0.5835374", "0.5825647", "0.58250195", "0.5777023", "0.5766665", "0.5716173", "0.57027316", "0.57027316", "0.5684653", "0.5662056", "0.5639793", "0.5639627", "0.5628434", "0.5587666", "0.5563301", "0.5563301", "0.5563301", "0.5563301", "0.5551133",...
0.7001547
0
Return the file position to the start of the profile.
def return_file_position_to_start_of_profile(self, fid): fid.seek(self.file_position, 0) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pos(self):\n return self.file.tell()", "def get_file_position(self, mode):\r\n return bass_call_0(BASS_StreamGetFilePosition, self.handle, mode)", "def starting_position(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"starting_position\")", "def get_position(self):...
[ "0.681188", "0.6521577", "0.6516624", "0.6506252", "0.64529335", "0.64495826", "0.6444314", "0.6391559", "0.62811625", "0.62764347", "0.6224913", "0.62020075", "0.62020075", "0.62020075", "0.6185171", "0.61651117", "0.61568314", "0.61335886", "0.6129055", "0.61160004", "0.608...
0.7984832
0
Returns true if this is the last profile in the data file.
def is_last_profile_in_file(self, fid): return self._calculate_next_profile_position() == os.fstat(fid.fileno()).st_size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_last(self) -> Optional[bool]:\n return pulumi.get(self, \"is_last\")", "def is_last(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"is_last\")", "def isLast(self):\n index = self.parentNode.idevices.index(self)\n return index == len(self.parentNode.idevices...
[ "0.69448036", "0.65554166", "0.6446005", "0.63820344", "0.6316995", "0.60817087", "0.5886655", "0.58826596", "0.58378875", "0.5808014", "0.57928777", "0.5792088", "0.5735816", "0.5724117", "0.5715869", "0.56836313", "0.5673833", "0.56549674", "0.56470406", "0.56379104", "0.55...
0.8079507
0
Returns a list of keys in the primary header.
def primary_header_keys(self): return [d for d in self.primary_header]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keys(self):\n return [k for k, v in self._headers]", "def keys(self) -> List:\n pass", "def keys(self) -> List[str]:\n raise NotImplementedError", "def key_columns(self):\n return [str(column) for id, column in self._columns.iteritems() if column.is_key]", "def keys(self):\r\n ...
[ "0.73658276", "0.70956033", "0.7050593", "0.6924669", "0.6828751", "0.6824346", "0.6806696", "0.68024904", "0.67742836", "0.6763231", "0.67398864", "0.67392325", "0.67380315", "0.6735044", "0.67280453", "0.67249167", "0.6717226", "0.6676533", "0.66698045", "0.665202", "0.6630...
0.91860604
0
return the cruise number
def cruise(self): return self.primary_header['Cruise number']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maCruise(self):\n return .77", "def getNumber():", "def getChrNum(self):\n chrLookup = {\"X\":23,\"x\":23,\"Y\":24,\"y\":24}\n if self.chr.startswith(\"chr\"):\n num = self.chr[3:]\n if num in (\"X\",\"x\",\"Y\",\"y\"):\n num = chrLookup[num]\n ...
[ "0.6323028", "0.60737234", "0.59981036", "0.586891", "0.5847294", "0.5836213", "0.58244544", "0.5757564", "0.5728439", "0.5711663", "0.5686197", "0.5684461", "0.5636235", "0.5636235", "0.56309515", "0.5627673", "0.56155443", "0.56026185", "0.55899507", "0.556885", "0.5544796"...
0.8592072
0
return the originator cruise ID
def originator_cruise(self): # decide if there is an originator cruise code object by looking for something with data type '1' in the character header cruise = None if 'entries' in self.character_data_and_principal_investigator: for obj in self.character_data_and_principal_investiga...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def source_computer_id(self) -> str:\n return pulumi.get(self, \"source_computer_id\")", "def source_computer_id(self) -> str:\n return pulumi.get(self, \"source_computer_id\")", "def cruise(self):\n return self.primary_header['Cruise number']", "def recid(self):\n return self.rec...
[ "0.6497666", "0.6497666", "0.63244545", "0.62699574", "0.62401617", "0.6209456", "0.6149779", "0.6148121", "0.61367226", "0.60899115", "0.6029654", "0.59821427", "0.59728366", "0.5929902", "0.59158194", "0.59058", "0.58951896", "0.58922875", "0.5880611", "0.5879405", "0.58566...
0.70046216
0
return the originator station ID
def originator_station(self): # decide if there is a station code object by looking for something with data type '2' in the character header station = None if 'entries' in self.character_data_and_principal_investigator: for obj in self.character_data_and_principal_investigator['entr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def station_id(self) -> str:\n return self._station_id", "def unique_id(self) -> str:\n return str(self.coordinator.gios.station_id)", "def station(unit, date):\r\n req = 'select ParentLocId from PI_PlaceRelationship where RelationId = 4 and LocId = \"{}\" and EndDate > \"{}\"'.format(unit,d2d...
[ "0.7285652", "0.6812059", "0.65527874", "0.6491249", "0.6453471", "0.6050535", "0.6019179", "0.6019179", "0.6019161", "0.59847265", "0.59809613", "0.59809613", "0.5934799", "0.5903671", "0.5888546", "0.5888137", "0.5888137", "0.58826435", "0.58826435", "0.5865075", "0.5855892...
0.7152931
1
Returns the contents of secondary header if it exists, otherwise None.
def extract_secondary_header(self, index): header = None for item in self.secondary_header['entries']: if item['Code'] == index: header = item['Value'] return header
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getHeaderVal2(self, key):\n lowerKey = key.lower()\n if key in self.header.header.keys():\n return self.header.header[key]\n elif lowerKey in self.header.header.keys():\n return self.header.header[lowerKey]\n else:\n print('error: bStack.getHeaderVal...
[ "0.620934", "0.6046969", "0.59697276", "0.5900436", "0.5695183", "0.56296515", "0.54620403", "0.5399244", "0.5356341", "0.53513354", "0.5280269", "0.5278987", "0.5261967", "0.525186", "0.52477497", "0.5237682", "0.5227424", "0.52173036", "0.5211859", "0.518127", "0.51782846",...
0.7348706
0
Returns a numpy masked array of depth quality control flags. Set the originator option if the originator flags are required.
def z_level_qc(self, originator=False): data = np.ma.array(np.zeros(self.n_levels()), mask=True, dtype=int) for i in range(self.n_levels()): if self.profile_data[i]['Missing']: continue if originator: data[i] = self.profile_data[i]['Originator depth error flag'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mask(self):\n if self.__mask is None:\n # need this to be *exactly* the numpy boolean False\n return nomask\n return self.__mask", "def var_level_qc(self, index, originator=False):\n data = np.ma.array(np.zeros(self.n_levels()), mask=True, dtype=int)\n if in...
[ "0.54861605", "0.5434514", "0.54197353", "0.53197765", "0.5294576", "0.52716345", "0.5260115", "0.524445", "0.5227943", "0.5212965", "0.5184435", "0.5177439", "0.5145151", "0.5117524", "0.51014876", "0.50980514", "0.5093009", "0.50760245", "0.50760245", "0.50760245", "0.50760...
0.61880827
0
Returns the variable index for a variable. Either the variable code can be specified or s can be set to True to return the salinity index. Otherwise temperature index is returned.
def var_index(self, code=1, s=False): if s: code = 2 index = None for i, var in enumerate(self.primary_header['variables']): if var['Variable code'] == code: assert index is None, 'Appears to be two sets of same data in profile' index = i ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indices_of_var(v):\n name = v.varName\n indices = name[2:].split(',')\n i, j = int(indices[0]), int(indices[1])\n return i, j", "def index(self, varname):\n if not isinstance(varname, str):\n raise TypeError(\"argument must be str\")\n varname = self._find...
[ "0.6094319", "0.5992637", "0.5731462", "0.5673416", "0.56549484", "0.5598223", "0.5402393", "0.5396196", "0.5295413", "0.52647763", "0.5249398", "0.52176803", "0.5161581", "0.509128", "0.5044002", "0.49797586", "0.4964434", "0.4964078", "0.49553072", "0.49425614", "0.49309742...
0.7424934
0
Returns the data values for a variable given the variable index.
def var_data(self, index): data = np.ma.array(np.zeros(self.n_levels()), mask=True) if index is not None: for i in range(self.n_levels()): if self.profile_data[i]['variables'][index]['Missing']: continue data[i] = self.profile_data[i]['variables'][index]['Valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLinIterValues( self, var, index = 0 ):\n\n values = self.getLinIterData( var, index )\n return values[2]", "def get_variable_values(self, vars):\n raise NotImplementedError()", "def get_data(self, index=0):\n if index is None:\n return [dd.da...
[ "0.7106677", "0.66892207", "0.66811925", "0.65154123", "0.6507422", "0.646576", "0.6418683", "0.63002825", "0.617449", "0.61602163", "0.6159303", "0.6150149", "0.61370397", "0.61308724", "0.61231256", "0.60778934", "0.6051899", "0.605164", "0.6031409", "0.6006571", "0.6005764...
0.72681504
0
Returns a list of dicts of metadata associated with a variable denoted by index
def var_metadata(self, index): if index is not None: metadata = [] for m in self.primary_header['variables'][index]['metadata']: meta = { 'value': m['Value'] / 10**m['Value precision'], 'code': m['Variable-specific code'], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def t_metadata(self):\n index = self.var_index()\n return self.var_metadata(index)", "def s_metadata(self):\n index = self.var_index(s=True)\n return self.var_metadata(index)", "def getVar(inmeta):\n meta = AutoVivification()\n with open(inmeta) as fp:\n for line in f...
[ "0.66395146", "0.657106", "0.61420757", "0.61139995", "0.607735", "0.60406494", "0.5940418", "0.58379537", "0.57568055", "0.57276076", "0.57131696", "0.5711036", "0.56675327", "0.564926", "0.5644001", "0.5615673", "0.5606115", "0.5578653", "0.55681884", "0.55648166", "0.55572...
0.7705391
0
return the salinity metadata, if available
def s_metadata(self): index = self.var_index(s=True) return self.var_metadata(index)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metadata(self) -> pulumi.Output[Optional['outputs.SecurityAssessmentMetadataPropertiesResponse']]:\n return pulumi.get(self, \"metadata\")", "def metadata(self) -> pulumi.Output[Optional['outputs.SecurityAssessmentMetadataPropertiesResponse']]:\n return pulumi.get(self, \"metadata\")", "def m...
[ "0.59349567", "0.59349567", "0.588296", "0.58103037", "0.5779363", "0.5764766", "0.5734396", "0.5719792", "0.5718881", "0.57090056", "0.568534", "0.567004", "0.56124866", "0.558504", "0.5567398", "0.55636936", "0.55431485", "0.5529838", "0.55256444", "0.5514203", "0.5514203",...
0.60768515
0
Returns level data as a pandas data frame. Profile metadata recorded as custom attributes on the dataframe.
def df(self): # populate dataframe with level data columns = { "z": self.z(), "z_level_qc": self.z_level_qc(), "z_unc": self.z_unc(), "t": self.t(), "t_level_qc": self.t_level_qc(), "t_unc": self.t_unc(), "s": self.s(),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_reactome_hierarchy_df() -> pd.DataFrame:\n return pd.read_csv(REACTOME_HIERARCHICAL_MAPPINGS_PATH, sep='\\t')", "def to_dataframe(self, include_metadata: bool = True) -> pd.DataFrame:\n # Get all our data first with async\n # Note that all our pandas work will tax CPU so we wouldn't expe...
[ "0.61326367", "0.60237515", "0.60217154", "0.59482", "0.592096", "0.5915685", "0.5874256", "0.5874256", "0.5874256", "0.5874256", "0.5874256", "0.5869173", "0.5836051", "0.58339447", "0.58162373", "0.58150154", "0.5766248", "0.57555896", "0.57363296", "0.5733595", "0.57188636...
0.7697623
0
Returns a data series containing primary header of the current profile
def header(self): data = {} data['latitude'] = self.latitude() data['latitude_unc'] = self.latitude_unc() data['longitude'] = self.longitude() data['longitude_unc'] = self.longitude_unc() data['uid'] = self.uid() data['n_levels'] = self.n_levels() data['y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _horizontal_header(self):\n return self.header()", "def _horizontal_header(self):\n return self.header()", "def header(self):\n return self[0]", "def header(self) -> List:\n return self.rows[0]", "def first_header():\n return \"\"\"\n<th>Target\n<th>Date\n<th colspan=\"2\...
[ "0.64102864", "0.64102864", "0.6335023", "0.62913215", "0.60832685", "0.6059192", "0.6058631", "0.6040735", "0.6023438", "0.60070777", "0.5971422", "0.59401476", "0.59113216", "0.5908255", "0.59058255", "0.5874509", "0.58718234", "0.5869801", "0.58629376", "0.5793363", "0.579...
0.7370823
0
Given a valid (IPv4) IP address, return a defanged version of that IP address. A defanged IP address replaces every period "." with "[.]".
def defangIPaddr(address): address_as_list = list(address) length_of_address = len(address_as_list) for i in range(length_of_address): if address_as_list[i] == ".": address_as_list[i] = "[.]" return "".join(address_as_list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def safe_addr(ip_addr):\n return '.'.join(ip_addr.split('.')[:2] + ['xxx', 'xxx'])", "def filter_ip_address(self, string):\n count = string.count('.')\n newstring = string\n if count < 3:\n # Not enough components to matter\n return newstring\n\n dot_split = s...
[ "0.7697277", "0.7319066", "0.68061745", "0.6796537", "0.6741873", "0.6540487", "0.649368", "0.63472986", "0.6228145", "0.59975916", "0.59913415", "0.5963269", "0.59367293", "0.59113383", "0.5905575", "0.5866596", "0.58397835", "0.582544", "0.58252937", "0.5804415", "0.5760137...
0.73443043
1
This view returns a list of all courses.
def list_all_courses(request): courses = Course.objects.all() courses = [dict(course_name = c.course_name, course_code = c.course_code, course_year = c.year, course_url = '/course/%s/' % c.course_code.lower()) for c in courses] response = {'courses': courses} return render_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def course_listing(request):\r\n if GlobalStaff().has_user(request.user):\r\n # user has global access so no need to get courses from django groups\r\n courses = _accessible_courses_list(request)\r\n else:\r\n try:\r\n courses = _accessible_courses_list_from_groups(request)\r\...
[ "0.81252503", "0.7970566", "0.7938835", "0.7740521", "0.75059247", "0.74730605", "0.747094", "0.7467073", "0.7453179", "0.7405879", "0.7360561", "0.72404325", "0.70759976", "0.7071681", "0.70332766", "0.70184034", "0.6910547", "0.6848491", "0.682735", "0.6808897", "0.6771157"...
0.83171123
0
Get all user ids based on name of folders under "public_dataset/"
def get_user_ids() -> List[str]: listOfFiles = os.listdir('public_dataset') listOfFiles.remove('data_description.pdf') try: listOfFiles.remove('.DS_Store') except: pass return listOfFiles
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_session_ids(user_id: str) -> List[str]:\n listOfSessions = os.listdir('public_dataset/'+user_id)\n try:\n listOfSessions.remove('.DS_Store')\n except:\n pass\n return listOfSessions", "def local_user_ids(steam):\n if steam is None:\n return None\n # The userdata direct...
[ "0.73738235", "0.7166007", "0.6606021", "0.6443705", "0.6379112", "0.63501024", "0.6274118", "0.62501055", "0.62358475", "0.61600703", "0.61323065", "0.6101705", "0.6071845", "0.6023387", "0.6020886", "0.6019847", "0.6011264", "0.5994475", "0.5981317", "0.59687907", "0.589318...
0.763626
0
Get all session ids for a specific user based on folder structure e.g. "public_dataset/100669/100669_session_13" has user_id=100669, session_id=13
def get_user_session_ids(user_id: str) -> List[str]: listOfSessions = os.listdir('public_dataset/'+user_id) try: listOfSessions.remove('.DS_Store') except: pass return listOfSessions
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_session_ids_for_task(user_id: str, task_name: str) -> List[str]:\n listOfSessions = os.listdir('Plots/Research/'+user_id+'/'+task_name)\n try:\n listOfSessions.remove('.DS_Store')\n except:\n pass\n return listOfSessions", "def local_user_ids(steam):\n if steam is None:\n ...
[ "0.7234155", "0.64891356", "0.6317786", "0.623503", "0.60883653", "0.6014238", "0.59397954", "0.5935082", "0.57786095", "0.5704666", "0.5618625", "0.56115544", "0.55442506", "0.553197", "0.5504939", "0.54119486", "0.53995836", "0.5365967", "0.53602356", "0.53527534", "0.53404...
0.800213
0
Get all session ids for a specific user and task based on folder structure e.g. "public_dataset/100669/100669_session_13" has user_id=100669, session_id=13
def get_user_session_ids_for_task(user_id: str, task_name: str) -> List[str]: listOfSessions = os.listdir('Plots/Research/'+user_id+'/'+task_name) try: listOfSessions.remove('.DS_Store') except: pass return listOfSessions
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_session_ids(user_id: str) -> List[str]:\n listOfSessions = os.listdir('public_dataset/'+user_id)\n try:\n listOfSessions.remove('.DS_Store')\n except:\n pass\n return listOfSessions", "def local_user_ids(steam):\n if steam is None:\n return None\n # The userdata direct...
[ "0.7328738", "0.60029215", "0.5648203", "0.5603645", "0.5575271", "0.55561566", "0.55468357", "0.55285466", "0.5505926", "0.5423922", "0.5409763", "0.5390888", "0.53891826", "0.53674144", "0.53345513", "0.5258402", "0.5182635", "0.5168376", "0.51601136", "0.513915", "0.513219...
0.7566754
0
Combine accelerometer, gyroscope, and activity labels for a specific session of a user
def get_user_session_data(user_id: str, user_session_id: str) -> DataFrame: activity_df = read_file(user_id, user_session_id, 'Activity.csv') accel_df = read_file(user_id, user_session_id, 'Accelerometer.csv') gyro_df = read_file(user_id, user_session_id, 'Gyroscope.csv') measurements_df = accel_df.joi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feature_list(user_id: str, session: str, tap_feature: str, task_name: str, window: DataFrame):\n if window.shape[0] == 0:\n return None\n #Add user ID, session, task name\n features = [user_id, session, task_name]\n\n #Add orientation\n orientation = mode(window['Phone_orientation_accel']...
[ "0.5068103", "0.48550618", "0.47635156", "0.4737972", "0.47350296", "0.4701941", "0.46496907", "0.46420303", "0.46216983", "0.461062", "0.45927304", "0.4569354", "0.4546855", "0.45429146", "0.45310783", "0.4522676", "0.45213246", "0.4519421", "0.45122227", "0.45062613", "0.44...
0.5247065
0
Adds the Euclidean norm of the accelerometer and gyroscope data
def add_magnitude_columns(data: DataFrame): data['M_accel'] = data[['X_accel','Y_accel','Z_accel']].apply(np.linalg.norm, axis = 1) data['M_gyro'] = data[['X_gyro','Y_gyro','Z_gyro']].apply(np.linalg.norm, axis = 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def norm(self):", "def norm(self):\n return np.sqrt(np.dot(self._data, self._data))", "def norm(self):\n raise NotImplementedError", "def norm(self):\n # TODO: implement\n return", "def norm(self):\n return math.sqrt(sum([x*x for x in self.mV]))", "def norm(self):\n\t\treturn n...
[ "0.65737027", "0.62713337", "0.61886215", "0.61312336", "0.6103076", "0.6101492", "0.599665", "0.5944298", "0.5938198", "0.591555", "0.5907996", "0.59041804", "0.5890714", "0.58686596", "0.5850779", "0.58359885", "0.5789611", "0.5770915", "0.57617897", "0.57581675", "0.574952...
0.6359628
1
Return a dataframe of the relative times at which tap events occur.
def get_tap_events(user_id: str, user_session_id: str) -> DataFrame: full_df = pd.DataFrame() for tap_file in tap_file_names: columns = tap_file_important_columns[tap_file] data = read_file(user_id, user_session_id, tap_file) time_data = pd.DataFrame() time_data['Start'] = data[c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_times(self):\n times = []\n for i in range(1, len(self.events)):\n times.append(self.events[i-1].elapsed_time(self.events[i]))\n return times", "def getTimes( self ):\n\n pars\t= ( _EVENT_TIME, 0, 0, 0 )\n values = self.adbGetE...
[ "0.6776355", "0.64633656", "0.6301473", "0.610719", "0.597576", "0.59644234", "0.59297544", "0.59297544", "0.59297544", "0.589159", "0.58347505", "0.5790734", "0.57504827", "0.57383585", "0.5738113", "0.57378346", "0.56966096", "0.56897324", "0.56846184", "0.56791633", "0.565...
0.6853497
0
This is a step of the processing of the data from the accelerometer/gyroscope. It adds a new column for each kind of tap, indicating whether a tap of that kind is in progress.
def add_columns_for_taps(full_data: DataFrame, tap_data: DataFrame): for tap_file in tap_file_names: tap_type = tap_file_to_feature_name[tap_file] data = tap_data[tap_data['Type'] == tap_type].reset_index(drop = True) lead_file = 'Accelerometer.csv' time_column_name = x_columns[lead...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mark_tap_start_and_end(data: DataFrame, delta_in_ms: int):\n\n lead_file = 'Accelerometer.csv'\n time_col = x_columns[lead_file]\n\n delta = delta_in_ms * 1000000\n\n for tap_file in tap_file_names:\n tap_feature = tap_file_to_feature_name[tap_file]\n # Step 1: Put a 2 at the start an...
[ "0.626239", "0.5580731", "0.5003521", "0.49078733", "0.48890755", "0.48783615", "0.48759088", "0.4853689", "0.4851357", "0.48206225", "0.47803137", "0.47471297", "0.47058022", "0.4700807", "0.4691376", "0.46603593", "0.4647413", "0.4630025", "0.45931166", "0.45842057", "0.456...
0.6911792
0
Locates each individual tap event and puts special values in the column to indicate the start and end
def mark_tap_start_and_end(data: DataFrame, delta_in_ms: int): lead_file = 'Accelerometer.csv' time_col = x_columns[lead_file] delta = delta_in_ms * 1000000 for tap_file in tap_file_names: tap_feature = tap_file_to_feature_name[tap_file] # Step 1: Put a 2 at the start and a 3 at the e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_columns_for_taps(full_data: DataFrame, tap_data: DataFrame):\n for tap_file in tap_file_names:\n tap_type = tap_file_to_feature_name[tap_file]\n data = tap_data[tap_data['Type'] == tap_type].reset_index(drop = True)\n\n lead_file = 'Accelerometer.csv'\n time_column_name = x_c...
[ "0.5943405", "0.57823676", "0.5738286", "0.534211", "0.52757245", "0.5235189", "0.52053845", "0.5152484", "0.5096135", "0.5053855", "0.5003967", "0.49919787", "0.49579182", "0.49561313", "0.49047977", "0.49045599", "0.49045599", "0.4898684", "0.4891326", "0.48886275", "0.4879...
0.6248036
0
Take the natural log of the specified column
def log_column(data: DataFrame, column: str): return data[column].map(lambda x: np.log(np.absolute(x)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_prob_from_logits(x):\n axis = len(x.shape) - 1\n m = x.max(dim=axis, keepdim=True)[0]\n return x - m - torch.log(torch.exp(x - m).sum(dim=axis, keepdim=True))", "def ln(x):\n return log(x, const.e)", "def log(df, cols, base=2, invert=None):\r\n if base == 2:\r\n for c in cols:\r\n ...
[ "0.69506574", "0.678407", "0.66785324", "0.66712946", "0.666371", "0.66378677", "0.6517011", "0.6511074", "0.64745414", "0.64531463", "0.644632", "0.6446281", "0.6436689", "0.64360815", "0.6432946", "0.64302266", "0.6428101", "0.64183277", "0.64153445", "0.640937", "0.6388755...
0.77828926
0
Make plots for each reading showing the times series during the tap, and write them to the Plots folder. The plots will have the mean within each time segment marked.
def plot_tap(file: str, before: DataFrame, during: DataFrame, after: DataFrame, time_col: str): print("Making plots at time " + str(before[time_col].iloc[0])) for file_name in file_names: for y in y_columns[file_name]: ax = before.plot(time_col, y, kind = 'scatter', color = 'blue', label ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_plots(self):\n if not os.path.exists(self.output_folder):\n os.makedirs(self.output_folder)\n self.sse_plot()\n self.avg_sse_plot()", "def initial_plots(runs):\n for run in runs.keys():\n meta = runs[run]\n plot_pdfs(meta)\n plot_priorsamps(meta)...
[ "0.67501664", "0.63098764", "0.6244525", "0.62386", "0.61215127", "0.6111329", "0.605923", "0.6054306", "0.6047053", "0.6033733", "0.60212713", "0.5992883", "0.59579474", "0.5934605", "0.5910154", "0.589949", "0.58453524", "0.5829939", "0.5825189", "0.58133894", "0.5805124", ...
0.68030167
0
This will create a list of motionrelated features characterizing each tap of the given user and session
def get_feature_vector(user_id: str, session: str) -> DataFrame: #Find the time windows during which the reader is doing the desired task activity_data = read_file(user_id, session, 'Activity.csv') task_number = mode(activity_data['TaskID']) task_name = task_names[(task_number - 1) % len(task_names)] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feature_list(user_id: str, session: str, tap_feature: str, task_name: str, window: DataFrame):\n if window.shape[0] == 0:\n return None\n #Add user ID, session, task name\n features = [user_id, session, task_name]\n\n #Add orientation\n orientation = mode(window['Phone_orientation_accel']...
[ "0.65042937", "0.58511", "0.5717541", "0.56386614", "0.55402297", "0.5528694", "0.5486018", "0.5403201", "0.5337727", "0.5314406", "0.5313272", "0.53073186", "0.5303535", "0.52877325", "0.524555", "0.5222801", "0.52193296", "0.5213846", "0.5202224", "0.51974803", "0.5184841",...
0.6129802
1
Uses some metric TBD to evaluate a distance between the two users' feature vectors
def get_distance(user_id1: str, user_id2: str) -> float: features1 = get_feature_vector(user_id1) features2 = get_feature_vector(user_id2) pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetDist(feature_1, feature_2):\n return np.linalg.norm(feature_1 - feature_2)", "def euclidean_distance(user1: User, user2: User) -> float:\r\n common_animes = set.intersection(set(user1.neighbor_anime.keys()),\r\n set(user2.neighbor_anime.keys()))\r\n return sqrt...
[ "0.70376164", "0.68441004", "0.6769662", "0.6710365", "0.6704376", "0.6573292", "0.65396273", "0.6442715", "0.6419095", "0.6325092", "0.63205504", "0.6293817", "0.62658757", "0.62401307", "0.62383014", "0.6234865", "0.6229674", "0.61967367", "0.6192722", "0.6184472", "0.61837...
0.8190472
0
Writes a .csv file of features for each user in the given location. If label is True, the first row of the files will be a header.
def write_all_users(folder_name: str, label: bool): make_directory(folder_name) for user in get_user_ids(): print("Analysis of user: " + user) subfolder_name = folder_name + "/" + user make_directory(subfolder_name) for session in get_user_session_ids(user): print("Se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeFeatures(features, labels, output_filename):\n\twith open(output_filename, 'w') as csvfile:\n\t fieldnames = features[0].keys()\n\t fieldnames.append('label')\n\t writer = csv.DictWriter(csvfile, fieldnames=fieldnames)\n\n\t writer.writeheader()\n\t for i in range(len(features)):\n\t \tf...
[ "0.7046409", "0.65013045", "0.63628066", "0.61785483", "0.61771864", "0.6093858", "0.60692143", "0.6046009", "0.5960273", "0.594843", "0.5785874", "0.57570076", "0.57210046", "0.571924", "0.5612553", "0.56121415", "0.5561343", "0.5466026", "0.5433147", "0.5433038", "0.5402878...
0.7268666
0
Will make a directory with the given name, unless such a directory already exists, in which case nothing will happen
def make_directory(name: str): try: os.mkdir(name) except: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_directory_if_needed(directory_name):\n if not os.path.isdir(directory_name):\n os.makedirs(directory_name)", "def create_directory(path, name):\n new_path = os.path.join(path, name)\n if not os.path.isdir(new_path):\n subprocess.run(['mkdir', new_path])", "def make_dir_if_need...
[ "0.8227327", "0.8119038", "0.78837943", "0.7879888", "0.78108305", "0.7782611", "0.7776862", "0.77424526", "0.77424526", "0.77287775", "0.7720759", "0.77165735", "0.7680433", "0.76724714", "0.75956064", "0.7593501", "0.7579252", "0.757156", "0.75657177", "0.75417477", "0.7540...
0.8610117
0
The tool this action is a method of. (May be None)
def tool(self): return self._tool
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def obtain_action(self):\r\n\t\treturn", "def tool(self):\n if self._tool is None:\n return SE3()\n else:\n return self._tool", "def tool(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"tool\")", "def tool(self):\n tool_type = self.__class__...
[ "0.6823224", "0.678028", "0.67726797", "0.6660057", "0.6566384", "0.6510465", "0.6404679", "0.63478595", "0.63472354", "0.63340336", "0.6235975", "0.6235975", "0.6235975", "0.6235975", "0.6235975", "0.6235975", "0.6136724", "0.6131193", "0.60622597", "0.60507506", "0.6038814"...
0.7286446
0
An environment with some Scheme standard procedures.
def standard_env(): env = Env() env.update(vars(math)) # gives us sin, cos, sqrt, pi env.update({ '+': op.add, '-': op.sub, '*':op.mul, '/': op.truediv, '>': op.gt, '<': op.lt, '>=': op.ge, '<=': op.le, '=': op.eq, 'begin': lambda *x: x[-1], 'or': op.or_, 'even?...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def standard_env():\n \"\"\"An environment with some Scheme standard procedures.\"\"\"\n env = Env()\n env.update(\n {\n \"+\": op.add,\n \"-\": op.sub,\n \"*\": op.mul,\n \"/\": op.truediv,\n \"car\": lambda x: x[0],\n \"cdr\": lamb...
[ "0.82678694", "0.6152458", "0.5960297", "0.584735", "0.57988155", "0.5716739", "0.54847705", "0.5483914", "0.5445518", "0.5431235", "0.5369716", "0.5353979", "0.5348337", "0.534168", "0.5328177", "0.53272533", "0.53268397", "0.53201205", "0.52317595", "0.52317595", "0.5223902...
0.65491146
1
Verifica se a categoria existe em todas as letras.
def category_exists(self, category: str) -> bool: return all(category in self.data[letter] for letter in self.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _verify_basic_categories(self):\n for cat in CATEGORIES:\n if not Category.objects.filter(name=cat).exists():\n self.add_category(cat)", "def test_categories_add(self):\n categories = [category.category for category in self.note.categories.all()]\n self.assertIn...
[ "0.68643826", "0.65396655", "0.6447354", "0.6423177", "0.6365938", "0.6034636", "0.5962784", "0.59085315", "0.584652", "0.5841601", "0.58201087", "0.5816927", "0.5771564", "0.5758775", "0.559042", "0.5577145", "0.5576167", "0.55607396", "0.55607396", "0.5521435", "0.54990447"...
0.6557177
1
Edit a comment. Requires HTTP POST and "can change comments" or "can moderate comments", permission. Users can also only edit comments they own, unless they are granted "comments.can_moderate" permissions. If ``POST['submit'] == "preview"`` or there are errors, a preview template ``comments/preview.html`` will be rende...
def edit(request, comment_id, next=None): comment = get_object_or_404( get_model(), pk=comment_id, site__pk=settings.SITE_ID ) # Make sure user has correct permissions to change the comment, # or return a 401 Unauthorized error. if not (request.user == comment.user and request.user.has_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(self):\n modified_content = self.request.get('comment_edit')\n comment_id = self.request.get('comment_id')\n comment = Comments.get_by_id(int(comment_id))\n user = self.get_active_user()\n\n if user.key().id() == comment.submitter_id:\n comment.content = modif...
[ "0.6931212", "0.69125295", "0.6838766", "0.6713624", "0.66921437", "0.64680856", "0.6270694", "0.62142336", "0.61379904", "0.6110858", "0.61102504", "0.59949285", "0.59053326", "0.5895494", "0.5882727", "0.5831428", "0.57694393", "0.5735642", "0.573556", "0.56685895", "0.5643...
0.72437614
0
Returns a `mu` value corresponding to an area under the ROC curve. Under the signal detection theory framework, when the positive and negative score distributions are modeled as Gaussians with unit variance, this function finds a separation in means that yields a given AUC. mu is equivalent to the sensitivity index, d'
def auc_to_mu(auc): return np.sqrt(2) * scipy.stats.norm.ppf(auc)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def roc_auc(y_true, y_score, pos_label=..., ascending_score=...):\n ...", "def reg_auroc(y_true, y_pred, th=0.5):\n y_true = np.where(y_true < th, 1, 0)\n y_score = np.where(y_pred < th, 1, 0)\n reg_auroc_score = sklearn.metrics.roc_auc_score(y_true, y_score)\n return reg_auroc_score", "def calc...
[ "0.5588348", "0.5521685", "0.5497163", "0.5482069", "0.54366106", "0.5420568", "0.54193854", "0.5410214", "0.53788114", "0.53528005", "0.53356016", "0.5305437", "0.529486", "0.52760977", "0.5267704", "0.5251772", "0.52025825", "0.5185603", "0.51713854", "0.5145581", "0.514553...
0.59110963
0
Generates the scores for a single reader.
def reader_score(): reader_ranef_negative, reader_ranef_positive = sigma_r * rng.randn(2) error_term = np.sqrt(1 - sigma_c**2) * rng.randn(num_cases) reader_score = (mu + delta_mu) * disease reader_score += reader_ranef_negative * (1 - disease) reader_score += reader_ranef_positive * disease rea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _scan_scores(self,handle, consumer):\n read_and_call(handle, consumer.scores, start=\"Smith-Waterman\")", "def update_scores(read_scores, result):\n\n\t# check that there are some results for this read\n\tassert len(result) > 0\n\t# write this read to output\n\tfor sim_match in result.keys():\n\n\t\t#...
[ "0.6255468", "0.58662325", "0.5689173", "0.5652576", "0.5598593", "0.55352265", "0.55189174", "0.5504589", "0.5471471", "0.5432648", "0.54194653", "0.54157305", "0.5404302", "0.53856426", "0.5372259", "0.533972", "0.5336711", "0.53053385", "0.52998555", "0.52965283", "0.52870...
0.6479283
0
Simulates a singlemodality reader data according to the RoeMetz model. This is the sort of data you might acquire when seeking to compare the performance of multiple readers with a standalone algorithm. Continuous "suspicion scores" are produced by both a model and the readers, but they can be thresholded to simulate b...
def simulate_model_vs_readers(disease, model_auc, reader_auc, sigma_r, sigma_c, num_readers, rng=np.random): mu = auc_to_mu(model_auc) d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulate_single_modality(disease,\n mu,\n delta_mu,\n sigma_r,\n sigma_c,\n num_readers,\n rng=np.random):\n if sigma_c < 0 or sigma_c > 1:\n ...
[ "0.58857113", "0.58756906", "0.55608004", "0.5548108", "0.54858565", "0.5459243", "0.54199636", "0.5406073", "0.5349795", "0.5342734", "0.5308023", "0.5295146", "0.5277245", "0.5275046", "0.52688444", "0.52575064", "0.5236231", "0.52356595", "0.5231033", "0.52271736", "0.5221...
0.64828056
0
Computes the 2sided pvalue for a tstatistic with the specified d.o.f.
def _two_sided_p_value(t, df): return 2 * scipy.stats.t.cdf(-np.abs(t), df=df)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _one_sided_p_value(t, df):\n return scipy.stats.t.sf(t, df=df)", "def _p_value(self):\n p_value = chi2.sf(self.test_statistic, 2)\n\n return p_value", "def _tstat_generic(value1, value2, std_diff, dof, alternative, diff=0):\n\n tstat = (value1 - value2 - diff) / std_diff\n if alternati...
[ "0.68148166", "0.635963", "0.59294915", "0.59291756", "0.5869865", "0.5867593", "0.58343273", "0.58018786", "0.5522177", "0.54848075", "0.5471973", "0.5449782", "0.54324764", "0.54098445", "0.54015267", "0.5346402", "0.53168315", "0.531237", "0.53113824", "0.5309784", "0.5298...
0.7478272
0
Computes the 1sided pvalue for a tstatistic with the specified d.o.f.
def _one_sided_p_value(t, df): return scipy.stats.t.sf(t, df=df)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _two_sided_p_value(t, df):\n return 2 * scipy.stats.t.cdf(-np.abs(t), df=df)", "def fD(self, vpd):\n\t if vpd < 0.1:\n\t return 1.\n\t else:\n\t return 3/13./sqrt(vpd/1000.)", "def pofd(self):\n return self.table[0, 1] / (self.table[0, 1] + self.table[1, 1])", "def _p_value(se...
[ "0.66497636", "0.6062942", "0.59336257", "0.58911395", "0.58727777", "0.5768678", "0.5765754", "0.57613516", "0.5737039", "0.57043195", "0.56871516", "0.56455255", "0.5643148", "0.5641853", "0.56283367", "0.55456716", "0.55343145", "0.5526232", "0.54990625", "0.54945636", "0....
0.7691578
0
Wraps index_fom_fn to acccept (disease, score) vectors.
def fom_fn(indices, reader_idx_vector): idx_values = set(reader_idx_vector) assert len(idx_values) == 1 idx = idx_values.pop() assert idx in ([-1] + list(reader_indices)), idx unrecognized = set(indices) - set(example_indices) assert unrecognized == set(), unrecognized return index_fom_fn(i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model_vs_readers_orh_index(example_indices,\n reader_indices,\n index_fom_fn,\n coverage=0.95,\n margin=0):\n\n def fom_fn(indices, reader_idx_vector):\n \"\"\"Wraps index_fom_fn to accce...
[ "0.59032357", "0.54225093", "0.52509314", "0.5245321", "0.5230781", "0.5219626", "0.5194253", "0.51824915", "0.5174531", "0.51368845", "0.5055017", "0.50405216", "0.50282276", "0.502258", "0.49983007", "0.49819922", "0.49674502", "0.4957773", "0.49574274", "0.49560648", "0.49...
0.6301212
0
Performs the ORH procedure to compare a standalone model against readers. This function uses the ObuchowskiRocketteHillis analysis to compare the quality of a model's predictions with that of a panel of readers that all interpreted the same cases. I.e., the reader data occurs in a dense matrix of shape [num_cases, num_...
def model_vs_readers_orh(disease, model_score, reader_scores, fom_fn, coverage=0.95, margin=0): if margin < 0: raise ValueError('margin parameter should be nonnegative.') num_cases, num_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model_vs_readers_orh_index(example_indices,\n reader_indices,\n index_fom_fn,\n coverage=0.95,\n margin=0):\n\n def fom_fn(indices, reader_idx_vector):\n \"\"\"Wraps index_fom_fn to accce...
[ "0.6117741", "0.54087925", "0.54066885", "0.5242778", "0.5207955", "0.5201614", "0.519627", "0.5183446", "0.5078315", "0.50693494", "0.5066249", "0.503917", "0.50329924", "0.502089", "0.5012984", "0.50017047", "0.49997708", "0.49859002", "0.49853367", "0.49727893", "0.4961691...
0.6756479
0
An alias for `dual_modality_orh`, kept for backward compatibility.
def two_treatment_orh(*args, **kwargs): return dual_modality_orh(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_modality(self):\n return self._modality", "def change_modality(self, new_modality):\n raise NotImplementedError", "def modal(image, selem, out=None, mask=None, shift_x=False, shift_y=False):\n\n return _apply(_crank8.modal, _crank16.modal, image, selem, out=out,\n mask...
[ "0.5828373", "0.5521631", "0.5268918", "0.5122006", "0.50041944", "0.49817193", "0.49683288", "0.49280772", "0.48526505", "0.48431662", "0.48264137", "0.48069292", "0.4785869", "0.47820333", "0.47731036", "0.47571263", "0.4755001", "0.47361046", "0.47241923", "0.47087532", "0...
0.75222385
0
Convert python to JSON by replacing single quotes with double quotes and stripping trailing commas Note that this checker might be oversensitive if additional JSON errors with the nested dictionary Used before SafeDictHook to check for redundant keys. We use a placeholder in block text because JSON cannot process it an...
def jsonify(text): # remove comments because they might corrupt the JSON re_block_comments = re.compile(r'([\"]{3}.*?[\"]{3})',flags=re.M+re.DOTALL) text = re_block_comments.sub('"REMOVED_BLOCK_COMMENT"',text) # note that this fails if you use hashes inside of dictionary values re_comments = re.compile(r'(#.*?)\n'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_json_quotes(json_data):\n lines = []\n for line in json_data.splitlines():\n if ':' in line:\n key, value = line.split(':', maxsplit=1)\n value = value.strip()\n lines.append(key + ': ' + value.strip('\",') + (',' if value.endswith(',') else ''))\n els...
[ "0.6101548", "0.60665554", "0.6039736", "0.5973466", "0.5965454", "0.59043264", "0.56827843", "0.56486374", "0.5458422", "0.5438886", "0.5437395", "0.539824", "0.5383692", "0.5371119", "0.5345633", "0.53277117", "0.5322137", "0.53118145", "0.5297029", "0.5265412", "0.52639145...
0.68492764
0
Expand all op nodes to the given basis.
def run(self, dag): # Walk through the DAG and expand each non-basis node for node in dag.gate_nodes(): if node.name in self.basis: # If already a base, ignore. continue # TODO: allow choosing other possible decompositions decomposition_rules = node....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_expand(g, op, block):\n\n x = g.get_node(op.input(\"X\")[0])\n if op.input(\"Shape\"):\n sizes = g.get_node(op.input(\"Shape\")[0])\n else:\n sizes = op.attr(\"shape\")\n\n if isinstance(sizes, _expr.Expr):\n sizes = try_infer_value(sizes, parameters=g.get_params())[0]\...
[ "0.56806636", "0.56788045", "0.5609273", "0.55485564", "0.5548129", "0.54040587", "0.52648944", "0.518253", "0.51816136", "0.5165354", "0.51469094", "0.5050234", "0.5043392", "0.5037604", "0.49747393", "0.49306676", "0.49135447", "0.4849872", "0.4849872", "0.48495495", "0.484...
0.60018677
0
Compile the AST into a bytecode
def ast_to_bytecode(ast): bc = compile_ast(ast, ast.scope) return bc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compile(cls, module_ast, filename):\n compiler = cls(filename)\n compiler.visit(module_ast)\n\n module_ops = [(SetLineno, 1)]\n extend_ops = module_ops.extend\n\n # Generate the startup code for the module\n for start in STARTUP:\n start_code = compile(start...
[ "0.69451076", "0.6880073", "0.6878707", "0.68005747", "0.67566556", "0.67168176", "0.6529854", "0.64560026", "0.6446436", "0.6423977", "0.6411034", "0.63917476", "0.6340888", "0.6338778", "0.6334012", "0.63297427", "0.6328317", "0.63082427", "0.6300762", "0.6297357", "0.62907...
0.8348027
0
Reset the current epoch's progress every new epoch
def on_epoch_begin(self, epoch, logs={}): self.current_progress = 0 self.loss = 0 self.accuracy = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_epoch(self):\n self.ix = 0", "def set_epoch(self, epoch):\r\n pass", "def on_train_begin(self):\n self.epoch_tqdm = self.tqdm(total=self.trainer.total_epochs,\n unit='epoch',\n leave=True,\n ...
[ "0.7894786", "0.68834776", "0.68710005", "0.68561596", "0.67527735", "0.67445993", "0.67407787", "0.67324847", "0.6667862", "0.6618142", "0.6615541", "0.659098", "0.65909296", "0.6580884", "0.65741605", "0.6461013", "0.6439226", "0.641213", "0.64069456", "0.6395008", "0.63840...
0.7316069
1
Given a data point, append new node to linked list.
def append(self, data): new_node = Node(data) current_node = self.head while current_node.next!=None: current_node = current_node.next current_node.next = new_node #when we are at the last node, set it's pointer to point at the new Node
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(self, data):\n if not self.head:\n self.head = DListNode(data=data)\n return\n curr = self.head\n while curr.next:\n curr = curr.next\n curr.next = DListNode(data=data, prev=curr)", "def append(self, data):\n if self.head is None:\n ...
[ "0.76220006", "0.747702", "0.7363767", "0.7332331", "0.72958094", "0.7197168", "0.7193461", "0.7193461", "0.7162837", "0.714711", "0.71415627", "0.70632493", "0.70528865", "0.7026272", "0.6981679", "0.6967536", "0.69511336", "0.6921676", "0.68736476", "0.6815803", "0.68100655...
0.75516033
1
Return the index at the given data point in the linked list
def get_index(self, data): current_node = self.head current_index = 0 while current_node.next != None: current_node = current_node.next if current_node.data == data: return current_index current_index += 1 print("data doesn't ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(self, data):\n\n traverse = self.head\n index = 0\n while traverse.next != None:\n\n if traverse.data == data:\n return index\n traverse = traverse.next\n index += 1\n\n if traverse.data == data:\n return index", "de...
[ "0.7930216", "0.7905522", "0.7863779", "0.78147644", "0.77501416", "0.76755315", "0.7358543", "0.71234745", "0.706917", "0.69959533", "0.6918794", "0.6905238", "0.67796844", "0.67350304", "0.6718491", "0.6688518", "0.6673004", "0.66494036", "0.65912384", "0.65364593", "0.6528...
0.7952277
0
Given the index, will erase the node in the linked list
def erase(self, index): if index >= self.length(): print("ERROR") return None current_index = 0 current_node = self.head while True: last_node = current_node current_node = current_node.next if current_index == index: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def erase(self, index):\n node = self._get_node_at(index) \n if node is None:\n raise IndexError('List index out of range.') \n if node == self.head: \n if node.next_node is None:\n self.tail = None \n else: \n node.next_nod...
[ "0.86580855", "0.8498837", "0.8386962", "0.836057", "0.82192457", "0.82032645", "0.81427", "0.8103172", "0.8099474", "0.80821234", "0.8024515", "0.79906446", "0.79616684", "0.79434097", "0.79299194", "0.79077476", "0.7847517", "0.78380835", "0.78185445", "0.7800675", "0.77607...
0.8852697
0
Given the data point, will delete the node in the linked list
def delete(self, data): current_node = self.head current_index = 0 index = self.get_index(data) while current_node.next != None: last_node = current_node current_node = current_node.next if current_index == index: last_node.next...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, data):\n if self.head.data == data:\n self.head = self.head.next\n return\n prev, curr = self.lookup(data)\n if curr is None:\n raise AttributeError('Data node not found.')\n prev.next = curr.next\n curr = None\n return", ...
[ "0.8042581", "0.7689726", "0.75389934", "0.721128", "0.7150525", "0.71124315", "0.7111399", "0.71054244", "0.7086867", "0.70839566", "0.7073029", "0.7016989", "0.6971378", "0.6966138", "0.694801", "0.6915151", "0.68923706", "0.68759763", "0.68745667", "0.68702126", "0.6810878...
0.79490376
1
NMC diffusivity as a function of stochiometry, in this case the diffusivity is taken to be a constant. The value is taken from Peyman MPM. References
def NMC_diffusivity_PeymanMPM(sto, T): D_ref = 8 * 10 ** (-15) E_D_s = 18550 arrhenius = np.exp(E_D_s / pybamm.constants.R * (1 / 298.15 - 1 / T)) return D_ref * arrhenius
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Nsat(self, m):\n result = (m - self.kappa * self.mMinHod)\n if result>0.:\n result /= self.m1\n result **= self.alpha\n result *= self.Ncen(m)\n else:\n result = 0.\n return result", "def Nsat(self, m):\n result = (m - self.kappa * self.mCut)\n if...
[ "0.6880065", "0.6615266", "0.6472032", "0.6333169", "0.632034", "0.6175014", "0.61480594", "0.61480594", "0.61378735", "0.61342615", "0.61112505", "0.61079407", "0.59707457", "0.59698695", "0.59507924", "0.59083015", "0.58945155", "0.5889738", "0.5874483", "0.5851936", "0.581...
0.70094794
0
Nickel Managanese Cobalt Oxide (NMC) Opencircuit Potential (OCP) as a function of the stochiometry. The fit is taken from Peyman MPM. References Peyman MPM manuscript (to be submitted)
def NMC_ocp_PeymanMPM(sto): u_eq = ( 4.3452 - 1.6518 * sto + 1.6225 * (sto**2) - 2.0843 * (sto**3) + 3.5146 * (sto**4) - 2.2166 * (sto**5) - 0.5623e-4 * np.exp(109.451 * sto - 100.006) ) return u_eq
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def graphite_ocp_PeymanMPM(sto):\n\n u_eq = (\n 0.063\n + 0.8 * np.exp(-75 * (sto + 0.001))\n - 0.0120 * np.tanh((sto - 0.127) / 0.016)\n - 0.0118 * np.tanh((sto - 0.155) / 0.016)\n - 0.0035 * np.tanh((sto - 0.220) / 0.020)\n - 0.0095 * np.tanh((sto - 0.190) / 0.013)\n ...
[ "0.6118903", "0.6068508", "0.58394", "0.5727134", "0.56680244", "0.55649835", "0.5558325", "0.5498825", "0.5482988", "0.54439884", "0.5436478", "0.5405408", "0.5393144", "0.53485477", "0.5344366", "0.534232", "0.53415734", "0.5340031", "0.53214604", "0.53160346", "0.5296659",...
0.65505815
0
Sets the sat_company_account_id of this EditAccountingJournalItem.
def sat_company_account_id(self, sat_company_account_id): if sat_company_account_id is None: raise ValueError("Invalid value for `sat_company_account_id`, must not be `None`") # noqa: E501 self._sat_company_account_id = sat_company_account_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_id(self, account_id):\n self._account_id = account_id", "def account_id(self, account_id):\n\n self._account_id = account_id", "def account_id(self, account_id):\n\n self._account_id = account_id", "def account_id(self, account_id):\n\n self._account_id = account_id", ...
[ "0.6178081", "0.6147414", "0.6147414", "0.6147414", "0.6147414", "0.6147414", "0.6147414", "0.6134564", "0.5944026", "0.5931777", "0.5931777", "0.57107115", "0.5660232", "0.5629784", "0.5591194", "0.5558076", "0.54987", "0.54695153", "0.5431011", "0.5368474", "0.5368474", "...
0.7790871
0
Sets the cargo of this EditAccountingJournalItem.
def cargo(self, cargo): if cargo is None: raise ValueError("Invalid value for `cargo`, must not be `None`") # noqa: E501 if cargo is not None and cargo < 0: # noqa: E501 raise ValueError("Invalid value for `cargo`, must be a value greater than or equal to `0`") # noqa: E501 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_cargo(self, total_cargo):\n\n self._total_cargo = total_cargo", "def cargo_fuel(self, cargo_fuel):\n\n self._cargo_fuel = cargo_fuel", "def cargo_gas(self, cargo_gas):\n\n self._cargo_gas = cargo_gas", "def dry_cargo(self, dry_cargo):\n\n self._dry_cargo = dry_cargo", ...
[ "0.5894072", "0.51697636", "0.515634", "0.5031346", "0.50103515", "0.4902964", "0.47004157", "0.4674612", "0.46719876", "0.4623271", "0.4567104", "0.45393223", "0.45121405", "0.44361523", "0.44219348", "0.4409397", "0.43817514", "0.4378921", "0.43769842", "0.4371719", "0.4345...
0.67557865
0
Sets the abono of this EditAccountingJournalItem.
def abono(self, abono): if abono is None: raise ValueError("Invalid value for `abono`, must not be `None`") # noqa: E501 if abono is not None and abono < 0: # noqa: E501 raise ValueError("Invalid value for `abono`, must be a value greater than or equal to `0`") # noqa: E501 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def journal_iso_abbreviation(self, journal_iso_abbreviation):\n\n self._journal_iso_abbreviation = journal_iso_abbreviation", "def complete_attribut(self,nom,contenu):\n self.nom=nom\n self.contenu=contenu", "def editable(self, editable):\n\n self._editable = editable", "def set_a...
[ "0.51553214", "0.5155304", "0.50390625", "0.50350344", "0.49702317", "0.49430567", "0.4928677", "0.49141398", "0.49060485", "0.48198193", "0.47946447", "0.47436208", "0.47399092", "0.47399092", "0.47218883", "0.47188574", "0.46752125", "0.46752125", "0.46725613", "0.46255463", ...
0.6751695
0
Sets the comments of this EditAccountingJournalItem.
def comments(self, comments): self._comments = comments
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comments(self, comments):\n\n self.container['comments'] = comments", "def comments(self, comments):\n if comments is not None and len(comments) > 1000:\n raise ValueError(\"Invalid value for `comments`, length must be less than or equal to `1000`\") # noqa: E501\n\n self._co...
[ "0.7108144", "0.65711296", "0.6474661", "0.6419131", "0.64177847", "0.6257858", "0.6126435", "0.6126435", "0.6126435", "0.6126435", "0.6126435", "0.6126435", "0.6126435", "0.6126435", "0.6126435", "0.6126435", "0.5982231", "0.5982231", "0.59577405", "0.5947953", "0.58393097",...
0.7272099
1
Override ExperimentConfig according to flags.
def config_override(params, flags_obj): # Change runtime.tpu to the real tpu. params.override({ 'runtime': { 'tpu': flags_obj.tpu, } }) # Get the first level of override from `--config_file`. # `--config_file` is typically used as a template that specifies the common # override fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def customize_experiment_config(self, config):\n # TODO: use ConfigList from Coach launcher, and share customization code.\n hyperparams_dict = json.loads(os.environ.get(\"SM_HPS\", \"{}\"))\n\n # Set output dir to intermediate\n # TODO: move this to before customer-specified so they ca...
[ "0.69408005", "0.6118065", "0.5987085", "0.59833956", "0.59729207", "0.5912382", "0.5890735", "0.58508605", "0.5849696", "0.5837483", "0.5785152", "0.5770095", "0.57107866", "0.5698733", "0.5692588", "0.56796557", "0.56731826", "0.56684154", "0.5664908", "0.56209606", "0.5597...
0.7048604
0
Compute the harmonic CQT from a given audio file
def compute_hcqt(audio_fpath): (bins_per_octave, n_octaves, harmonics, sr, f_min, hop_length) = get_hcqt_params() y, fs = librosa.load(audio_fpath, sr=sr) cqt_list = [] shapes = [] for h in harmonics: cqt = librosa.cqt( y, sr=fs, hop_length=hop_length, fmin=f_min*float(h), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_cqt(data):\n \n # Perform the Constant-Q Transform\n CQT = librosa.cqt(data, sr=AUDIO_SAMPLE_RATE, hop_length=512, fmin=None, n_bins=96, bins_per_octave=12)\n CQT_mag = librosa.magphase(CQT)[0]**4\n \n # Convert to dB\n CQTdB = librosa.core.amplitude_to_db(CQT_mag, ref = np.amax)\n...
[ "0.66460973", "0.6453836", "0.636979", "0.6216629", "0.60845083", "0.58505565", "0.5831372", "0.5564791", "0.55225974", "0.55209", "0.55197704", "0.55066806", "0.54329526", "0.5429815", "0.5427289", "0.5414956", "0.53904355", "0.5377025", "0.53763163", "0.5364629", "0.5351341...
0.758912
0
Get the hcqt frequency grid
def get_freq_grid(): (bins_per_octave, n_octaves, _, _, f_min, _) = get_hcqt_params() freq_grid = librosa.cqt_frequencies( bins_per_octave*n_octaves, f_min, bins_per_octave=bins_per_octave ) return freq_grid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_frequency(self):\r\n # print '*********in get freq'\r\n self.cntr.run('FREQ 1')\r\n f_0_ = self.cntr.get_measurements(1)\r\n self.f_0 = f_0_[0]\r\n self.cntr.run('FREQ 2')\r\n f_rep_ = self.cntr.get_measurements(1)\r\n self.f_rep = f_rep_[0]", "def get_fre...
[ "0.59496003", "0.59361404", "0.5881349", "0.5839214", "0.57178015", "0.56668127", "0.5663322", "0.5657716", "0.5628096", "0.56117433", "0.56011665", "0.5592596", "0.5519088", "0.55124384", "0.5502585", "0.5500028", "0.5481276", "0.54767233", "0.54718333", "0.54570484", "0.545...
0.82124424
0
Get the hcqt time grid
def get_time_grid(n_time_frames): (_, _, _, sr, _, hop_length) = get_hcqt_params() time_grid = librosa.core.frames_to_time( range(n_time_frames), sr=sr, hop_length=hop_length ) return time_grid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_grid(time_step=30):\n if time_step < 1 or time_step > 60:\n raise ValueError('Time resolution should be between 0 and 60 [s]')\n half_step = time_step/SECONDS_PER_HOUR/2\n return np.arange(half_step, 24+half_step, half_step*2)", "def timinggrid(self):\n\n gelem = Element(\"g\") # ...
[ "0.60058314", "0.5995702", "0.592634", "0.592634", "0.5893274", "0.58358717", "0.5755237", "0.57121754", "0.57121754", "0.57121754", "0.57034177", "0.5683962", "0.5615493", "0.55705327", "0.5541471", "0.55200374", "0.55005306", "0.5473635", "0.54452884", "0.5405167", "0.53992...
0.67356974
0
Compute the bin numbers from a given grid
def grid_to_bins(grid, start_bin_val, end_bin_val): bin_centers = (grid[1:] + grid[:-1])/2.0 bins = np.concatenate([[start_bin_val], bin_centers, [end_bin_val]]) return bins
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bincalc(nbin=0.1,bmin=5,bmax=2000):\n\n logbmin=np.log10(bmin)\n logbmax=np.log10(bmax)\n\n logbins=np.arange(logbmin,logbmax,nbin)\n\n bins=10**logbins\n\n #bins=np.linspace(bmin,bmax,60)\n return (bins)", "def _bin_numbers(col1, col2, bin_n):\n col1 = col1[~col1.map(lambda x: is_null_f...
[ "0.6988975", "0.6984424", "0.67759913", "0.6577237", "0.65490645", "0.6458017", "0.6443781", "0.6413207", "0.63787806", "0.63331187", "0.6303565", "0.62823945", "0.6276484", "0.6272296", "0.6242215", "0.62306744", "0.62077826", "0.6177793", "0.61308944", "0.61144274", "0.6078...
0.756557
0
show whole ProducedMsg table on the web
def prod(): query = "SELECT * FROM ProducedMsg;" tablestr = dbwrapper._query_pretty(query) result = string.replace(str(tablestr),'\n','<br>') return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_received_table(self, num_disp, old):\n caller = self.caller\n msgtable = PrettyTable(\n [\"{wMsg #\", \"{wSender\", \"{wIC Date\", \"{wOOC Date\", \"{wSave\"]\n )\n mess_num = 1\n old = old[:num_disp]\n for mess in old:\n try:\n ...
[ "0.6597587", "0.6498538", "0.62005866", "0.6154198", "0.59600717", "0.59149694", "0.5879777", "0.58272785", "0.58070505", "0.57914764", "0.5776034", "0.5752107", "0.5751061", "0.5714788", "0.57005656", "0.56983024", "0.5696108", "0.56184375", "0.5599567", "0.5598464", "0.5594...
0.72538835
0
show whole ConsumedMsg table on the web
def con(): query = "SELECT * FROM ConsumedMsg;" tablestr = dbwrapper._query_pretty(query) result = string.replace(str(tablestr),'\n','<br>') return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_received_table(self, num_disp, old):\n caller = self.caller\n msgtable = PrettyTable(\n [\"{wMsg #\", \"{wSender\", \"{wIC Date\", \"{wOOC Date\", \"{wSave\"]\n )\n mess_num = 1\n old = old[:num_disp]\n for mess in old:\n try:\n ...
[ "0.63120323", "0.6159939", "0.61489886", "0.6135532", "0.6122139", "0.59666145", "0.58795524", "0.56598026", "0.56134933", "0.55946493", "0.558144", "0.55531895", "0.55498475", "0.5525264", "0.54190505", "0.5415315", "0.5398365", "0.53646106", "0.53646106", "0.534758", "0.534...
0.6740566
0
Initialize the variable module. This adds ``pgfkeys`` to the list of LaTeX packages and adds the setup code to the preamble
def init_vars(): da_vinci.base.usepackage("pgfkeys") da_vinci.base.add_preamble(setup_script)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_latex_preamble():\n from sage.misc.latex import latex\n latex.add_package_to_preamble_if_available('tikz')\n latex.add_to_mathjax_avoid_list(\"tikz\")\n if latex.has_file(\"tikz.sty\"):\n latex.add_to_preamble(r'\\usetikzlibrary{automata}')", "def _init_tkvars(self,PO):\n for ...
[ "0.57580215", "0.5727887", "0.5618655", "0.55456275", "0.55201256", "0.54513633", "0.5410531", "0.5400405", "0.536209", "0.5352983", "0.5259593", "0.52424645", "0.52378637", "0.5234449", "0.52188027", "0.5215052", "0.5214246", "0.5212781", "0.5194066", "0.5182458", "0.5172949...
0.8417244
0
Declare a variable namespace.
def declare_namespace(namespace): return "\\declare{%s}" % namespace
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_variable(self, var, value):\n self.namespace[var] = value", "def define_vars(vars, namespace=None):\n\t# TODO: support namespacing via nested dictionaries\n\tif namespace is None:\n\t\tprefix = \"\"\n\telse:\n\t\tprefix = namespace + \"/\"\n\treturn \"\\\\setvalue{%s}\" % \", \".join([\n\t\t\"%...
[ "0.7665097", "0.65671283", "0.6502325", "0.6340259", "0.6307674", "0.6245326", "0.6205705", "0.62035084", "0.5977103", "0.597564", "0.58726317", "0.5862272", "0.5831435", "0.58100283", "0.58100283", "0.58069617", "0.5781008", "0.57711345", "0.57605255", "0.5754003", "0.574131...
0.7276759
1
Set prompt to active task
def set_prompt(self, ps1=''): if not ps1: task = self.db.get_active_task() if task: ps1 = ('%s#%s' % (task['tname'], task['pname'])).encode('utf8') else: ps1 = self.bloody_prompt self.prompt = ('(%s)> ' % ps1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prompt(self):\n self.prompt_flag = True", "def prompt(self, task, text='', print_=False):\n template = self.prompts[task]['prompt']\n res = self.format_prompt(task, template, text)\n if print_:\n print(res)\n else:\n return res", "def do_prompt(self,...
[ "0.74394417", "0.70223904", "0.6675487", "0.6625416", "0.66070217", "0.65539664", "0.6529011", "0.6466097", "0.63974833", "0.6393468", "0.6381298", "0.63400286", "0.63384306", "0.6331718", "0.6326696", "0.6280308", "0.6241637", "0.61691356", "0.6162123", "0.6134465", "0.61319...
0.79408383
0
Command project project's related commands Usage project | || Description The command displays project information, creates a new project, updates and deletes one.
def do_project(self, arg): def _usage(): self.do_help('project') args = shlex.split(arg) if not args: _usage() return commands = ['create', 'delete', 'update'] first_arg = args[0].lower() is_project_info = first_arg not in commands ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def project():\n\n ADMIN = current.session.s3.system_roles.ADMIN\n\n menu = M(c=\"project\")(\n M(\"Projects\", f=\"project\", m=\"summary\")(\n M(\"Create\", m=\"create\"),\n ),\n M(\"Locations\", f=\"location\")(\n M(\"Map\", m=\"map...
[ "0.70812523", "0.67117447", "0.67117447", "0.67117447", "0.65857023", "0.6532705", "0.65131515", "0.6459868", "0.64476234", "0.63825434", "0.63591444", "0.63481617", "0.63410133", "0.6323259", "0.6273819", "0.6262763", "0.6189054", "0.61842257", "0.6142908", "0.6128155", "0.6...
0.7934942
0
Command task task's related commands. Usage task | | Description The command displays general info, updates or deletes a task.
def do_task(self, arg): def _usage(): self.do_help('task') args = arg.split() if not len(args): print(self.error_wrong_parameters) return commands = ['delete', 'update'] first_arg = args[0].lower() if first_arg not in commands: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def command(task_id, tail, wip, limit):\n if task_id:\n task = storage.get_by_id(task_id)\n\n if not task:\n click.echo(f\"Task {task_id} not found.\")\n sys.exit(1)\n\n tasks = [task]\n else:\n tasks = storage.all(limit=limit, reverse=tail, wip=wip)\n\n p...
[ "0.7051473", "0.66475296", "0.66164476", "0.65424675", "0.64694047", "0.6421388", "0.6408608", "0.6323527", "0.6208247", "0.6188428", "0.6188428", "0.61856204", "0.6156182", "0.6142588", "0.6068784", "0.5998007", "0.5959546", "0.59573334", "0.59241444", "0.5922902", "0.592016...
0.7619803
0
Command projects display a list of projects. Usage projects [] Description Displays a list of projects for a date piriod. The command displays last 10 projects unless the period is specified. Period parameter
def do_projects(self, arg): args = shlex.split(arg) limit = 10 from_date = to_date = '' if args: limit = 0 try: from_date, to_date = helpers.parse_date_parameters(args) except ValueError, msg: print(msg) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_projects():\n with BMI(_username, _password, constants.BMI_ADMIN_PROJECT) as bmi:\n ret = bmi.list_projects()\n if ret[constants.STATUS_CODE_KEY] == 200:\n table = PrettyTable(\n field_names=[\"Id\", \"Name\", \"Provision Network\"])\n projects = ret[c...
[ "0.6390584", "0.6339536", "0.63156116", "0.625599", "0.62274384", "0.61688644", "0.61150175", "0.60160017", "0.60131425", "0.5933992", "0.59230304", "0.5894313", "0.5874425", "0.5789164", "0.57819515", "0.5771557", "0.57586426", "0.5741603", "0.5733803", "0.5732437", "0.57152...
0.71809304
0
Command tasks display a list of tasks. Usage tasks [] Description Displays a list of tasks for a date piriod. The command displays last 10 tasks unless the period is specified. Period parameter
def do_tasks(self, arg): args = shlex.split(arg) if not args: # TODAY started = datetime.date.fromtimestamp(0) finished = datetime.date.today() limit = 10 else: limit = 0 try: started, finished = helpers.pars...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_tasks(self, tasks=None, date_format=None):\n\n\t\tif not tasks:\n\t\t\ttasks = self.tasklist.tasks\n\n\t\tif len(tasks) > 0:\n\n\t\t\ttemplate = '{0:^3} {1:20} {2:^3} {3:20} {4:15} {5:20}'\n\t\t\tprint template.format('\\nID', 'Description', ' Pri', 'Due', 'Created', 'Tags')\n\t\t\tprint template.format('...
[ "0.7118641", "0.65293884", "0.6405276", "0.6308683", "0.62239516", "0.6132152", "0.61177206", "0.61094075", "0.6094835", "0.6088848", "0.6059728", "0.6005066", "0.5996612", "0.5913682", "0.59072435", "0.5889187", "0.5888562", "0.58667386", "0.5772023", "0.570772", "0.5666861"...
0.6915537
1
Command active display an active task Usage active Description Display an active task if there is one.
def do_active(self, arg): task = self.db.get_active_task() if not task: print("There is not any active task yet.") return refined = [[ task['tid'], '#'.join([task['tname'], task['pname']]), datetime.datetime.strftime(task['started'], '%...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def usage(self, task, verbose=False):\n print(\"GBTIDL> this command is deprecated, just use the ipython methods\")\n # if task is a string, find the function name\n _task = task\n help(_task)", "def display_task(self, task):\n # Visual check for completed tasks\n check...
[ "0.62046105", "0.6179543", "0.6083674", "0.60648614", "0.60648614", "0.6022669", "0.59849316", "0.59849316", "0.5978521", "0.5974868", "0.59261936", "0.58891577", "0.58439004", "0.5770843", "0.5768293", "0.5751", "0.5726126", "0.57212806", "0.5719769", "0.57116014", "0.566616...
0.70545346
0
Create a text body with tracks
def create_tracks_contents(self, tracks): rows = [] # Expose dates for an editor for track in tracks: rows.append([ '%s%s' % (u'# ' if not track['is_billed'] else ' ', u'#'.join([track['tname'], track['pname']]) ),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_transcript(speaker_label_transcript):\n with open('main_transcript.txt', 'a') as the_file:\n for t in speaker_label_transcript:\n the_file.write(f\"{t['speaker']}:\\n\")\n the_file.write(f\"{t['content']}\\n\\n\")", "def news_speech():\n #Fetches data from API and cre...
[ "0.5848218", "0.58332545", "0.5605702", "0.5583834", "0.55760723", "0.54602444", "0.5450515", "0.5432554", "0.5432439", "0.5423649", "0.5364082", "0.5279505", "0.5249628", "0.5213371", "0.5209746", "0.5196646", "0.51803553", "0.51700944", "0.51385075", "0.5134436", "0.5130898...
0.59032327
0
Update timesheet with an external editor
def update_timesheet(self, args): if len(args) == 1: print(self.error_wrong_parameters) return try: started, finished = helpers.parse_date_parameters(args[1:]) except ValueError as error: print(error) return if started == dateti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_upt(self, arg):\n self.do_timesheet('update today')", "def update_timesheet(item):\n\tj=json.loads(item)\n\tprint(\"-----------------------garffff---------------------\")\n\tnew_employee=None;\n\ttimesheet=frappe.get_doc(\"Time Sheet\",j[\"name\"])\n\tjarray=[]\n\tfor passed_employee in j['employee...
[ "0.61382276", "0.6037365", "0.5941405", "0.594015", "0.58128583", "0.5658246", "0.5627402", "0.5599801", "0.55778724", "0.5517923", "0.5475353", "0.54705817", "0.5338446", "0.52902836", "0.52834815", "0.5277494", "0.5273059", "0.5257542", "0.5244639", "0.52007896", "0.5169982...
0.7120731
0
Get report command's parameters
def get_report_parameters(self, args, default_mask=0): # Get the task|project filter keyword and an alias pname = tname = '' mask = 0 if args[0] in ('task', 'project'): if not len(args) >= 2: print("*** Error: Wrong format of the object parameter '%s'" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_report_parameters(self):\n self.setup_report()\n\n proxy_url, proxy_argument = get_proxy_args(self.cr, self.uid, self.prpt_content)\n proxy = xmlrpclib.ServerProxy(proxy_url)\n return proxy.report.getParameterInfo(proxy_argument)", "def parameters(self) -> ReportParameters:\...
[ "0.73213214", "0.6491068", "0.6297721", "0.6168276", "0.61573726", "0.6150455", "0.6062616", "0.6031534", "0.6029903", "0.6005491", "0.59798586", "0.5973395", "0.59154636", "0.58459044", "0.58375025", "0.5804794", "0.58014464", "0.57914436", "0.5789844", "0.57788223", "0.5762...
0.67556924
1
Update the timesheet for today. Look at 'help timesheet' for details.
def do_upt(self, arg): self.do_timesheet('update today')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_timesheet(self, args):\n if len(args) == 1:\n print(self.error_wrong_parameters)\n return\n try:\n started, finished = helpers.parse_date_parameters(args[1:])\n except ValueError as error:\n print(error)\n return\n if sta...
[ "0.62373966", "0.5995113", "0.5968316", "0.5938137", "0.5781066", "0.57411987", "0.56810856", "0.5629616", "0.5542387", "0.54968566", "0.54915357", "0.54783255", "0.547548", "0.54681015", "0.54673827", "0.54571974", "0.5454602", "0.5431281", "0.54092795", "0.53934515", "0.535...
0.7854881
0
Update the timesheet for a week. Look at 'help timesheet' for details.
def do_upw(self, arg): self.do_timesheet('update week')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_upm(self, arg):\n self.do_timesheet('update week')", "def update_week(sched, year, stype, week):\n games = week_schedule(year, stype, week)\n if not games:\n return False\n\n for game in games:\n sched[game['eid']] = game\n\n return True", "def do_rw(self, arg):\n ...
[ "0.75189185", "0.6730039", "0.6707246", "0.6574584", "0.63909006", "0.636376", "0.6340887", "0.6294754", "0.61888754", "0.6179247", "0.6088131", "0.6087225", "0.6061335", "0.60387963", "0.60356843", "0.5992439", "0.59173197", "0.59076345", "0.57140833", "0.5708552", "0.569352...
0.78006864
0
Update the timesheet for a month. Look at 'help timesheet' for details.
def do_upm(self, arg): self.do_timesheet('update week')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_upt(self, arg):\n self.do_timesheet('update today')", "def setMonth(self, *args):\n return _libsbml.Date_setMonth(self, *args)", "def update_timesheet(self, args):\n if len(args) == 1:\n print(self.error_wrong_parameters)\n return\n try:\n sta...
[ "0.62956774", "0.5872806", "0.5851527", "0.57449275", "0.5719809", "0.5693252", "0.5651246", "0.56409156", "0.56211275", "0.56069833", "0.5585783", "0.5505197", "0.5472943", "0.54604954", "0.54581743", "0.5444931", "0.544139", "0.5417249", "0.54065466", "0.53555846", "0.53220...
0.60178006
1
Report the timesheet for today.
def do_rt(self, arg): self.do_timesheet('report today')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_upt(self, arg):\n self.do_timesheet('update today')", "def do_rrt(self, arg):\n self.do_timesheet('report extend track today')", "def show_today_tasks(self):\n today = datetime.today()\n tasks = self.session.query(self.Table).filter(self.Table.deadline == today.strftime('%Y-%...
[ "0.6755711", "0.6618635", "0.6351735", "0.61901796", "0.61826795", "0.6099821", "0.59579736", "0.59521276", "0.59359", "0.59144366", "0.585397", "0.5832119", "0.58296067", "0.5788071", "0.5755071", "0.56960785", "0.56843895", "0.5677893", "0.5671634", "0.5670418", "0.5661753"...
0.73340017
0