query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
the function makes a game of "7 Boom" it replace every number that contains "7" or divides by 7.
def seven_boom(end_number): all_nums = [] for n in range(1, end_number + 1): if n % 7 == 0 or "7" in str(n): all_nums.append("Boom") else: all_nums.append(n) return all_nums
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def problem():\n # First prime number>2 ends only with (1, 3, 5, 7, 9). Last digit cannot be\n # replaced.\n # Number of digits that need to be replaced are 3.\n\n masks = (\n \"{1}{2}{0}{0}{0}{3}\",\n \"{1}{0}{2}{0}{0}{3}\",\n \"{1}{0}{0}{2}{0}{3}\",\n \"{1}{0}{0}{0}{2}{3}\...
[ "0.6820968", "0.65721613", "0.59408474", "0.57117885", "0.57012874", "0.5686959", "0.56695634", "0.5645862", "0.562656", "0.55166095", "0.549958", "0.54770386", "0.54770386", "0.54770386", "0.54343045", "0.54297036", "0.5426893", "0.54231066", "0.5422682", "0.5420768", "0.541...
0.6623458
1
Valid response with next action to be followed by the JS
def json_to_response(self, action=None, json_status=None, success_url=None, json_data=None, **response_kwargs): data = { "status": self.get_status(json_status), "action": self.get_action(action), "extra_data": self.get_json_data(json_data or {}) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_response(self, response):\n pass", "def user_should_get_an_ok_response():\n assert web_app.validate_reponse()", "def validate(self, response):\n return response[\"status_code\"] == 1", "def post_validate_flow(\n self, response: flow.FlowValidationResult\n ) -> flow.Flo...
[ "0.66249514", "0.62555987", "0.6251725", "0.61860937", "0.61699665", "0.61699665", "0.6126522", "0.6126522", "0.6123501", "0.5934643", "0.59199834", "0.58912086", "0.584448", "0.584448", "0.5806025", "0.5805762", "0.5803021", "0.57740223", "0.5767923", "0.5762147", "0.5740651...
0.0
-1
Returns action to take after call
def get_action(self, action=None): if action: self.action = action if self.action not in AjaxResponseAction.choices: raise ValueError( "Invalid action selected: '{}'".format(self.action)) return self.action
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call_action(self, action):\n pass", "def action_done(self):", "def take_action(self, *args, **kwargs):\r\n pass", "def action_done(self):\n pass", "def _do_action(self):\n pass", "def _do_action(self):\n pass", "def do_after(self):\r\n pass", "def act(sel...
[ "0.69445664", "0.6943001", "0.6942204", "0.68721336", "0.6834246", "0.6834246", "0.6597721", "0.6511799", "0.645936", "0.64292854", "0.64245814", "0.6415862", "0.63407004", "0.63407004", "0.6297166", "0.6296422", "0.6282538", "0.6266559", "0.6254029", "0.62444353", "0.6218164...
0.0
-1
Returns status of for json
def get_status(self, json_status=None): if json_status: self.json_status = json_status if self.json_status not in AjaxResponseStatus.choices: raise ValueError( "Invalid status selected: '{}'".format(self.json_status)) return self.json_status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status():\n return jsonify({\"status\": \"OK\"})", "def status():\n return jsonify({\"Status\": \"Ok\"})", "def json_status():\n return jsonify({\"status\": \"OK\"})", "def getStatus():\n return json.dumps({'camera': Camera.status(), 'rover': rover.status()}), 200", "def get_status():\n ...
[ "0.80390227", "0.79501057", "0.79491484", "0.78886074", "0.7840176", "0.76253086", "0.7582878", "0.7577055", "0.7507282", "0.7502897", "0.7459544", "0.7423667", "0.73184675", "0.7257667", "0.7207916", "0.71479875", "0.71447736", "0.71276903", "0.7103936", "0.7063255", "0.7037...
0.6963305
23
Returns any extra data to add to json
def get_json_data(self, json_data=None): return json_data or {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hydrate_extra_info(self, bundle):\n extra_info = bundle.data[\"extra_info\"]\n bundle.data[\"extra_info\"] = json.dumps(extra_info)\n return bundle", "def extra(self) -> Dict[str, Any]:\n extra = self.extras.copy()\n if isinstance(self.author, str):\n extra['Auth...
[ "0.7136737", "0.6971354", "0.6882013", "0.6691394", "0.6650121", "0.662635", "0.662635", "0.661754", "0.6543825", "0.65356535", "0.64480144", "0.6437633", "0.63862795", "0.6352075", "0.6335709", "0.6330153", "0.6306599", "0.62786764", "0.6273986", "0.6263539", "0.6244206", ...
0.61241674
36
If form invalid return error list in JSON response
def form_invalid(self, form, prefix=None): response = super(FormAjaxMixin, self).form_invalid(form) if self.request.is_ajax(): data = { "errors_list": self.add_prefix(form.errors, prefix), } return self.json_to_response(status=400, json_data=data, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def form_invalid(self, form):\n response = super().form_invalid(form)\n if self.is_ajax():\n return JsonResponse(form.errors, status=400)\n else:\n return response", "def form_invalid(self, form):\n response = super(AjaxableResponseMixin, self).form_invalid(form)...
[ "0.7665663", "0.75349003", "0.7339613", "0.71741205", "0.7158141", "0.7126791", "0.7107218", "0.6952973", "0.6897809", "0.6629777", "0.6626728", "0.6606772", "0.6513617", "0.64996225", "0.64490724", "0.6420252", "0.63936806", "0.63936806", "0.6303919", "0.6296751", "0.6293436...
0.7219318
3
If form valid return response with action
def form_valid(self, form): response = super(FormAjaxMixin, self).form_valid(form) if self.request.is_ajax(): return self.json_to_response() return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(self, request, *args, **kwargs):\n form = self.get_form()\n if form.validate():\n return self.form_valid(form)\n else:\n return self.form_invalid(form)", "def post(self, request, *args, **kwargs):\n form = self.get_form()\n if form.is_valid():\n ...
[ "0.6804317", "0.6632513", "0.6586356", "0.6526392", "0.6373733", "0.6342913", "0.63415116", "0.61759424", "0.6175222", "0.61239624", "0.61119753", "0.61110294", "0.60705644", "0.6056116", "0.60451347", "0.6035517", "0.6014968", "0.60106874", "0.59802735", "0.5964109", "0.5911...
0.56068015
62
Add form prefix to errors
def add_prefix(self, errors, prefix): if not prefix: prefix = self.get_prefix() if prefix: return {"%s-%s" % (prefix, k): v for k, v in errors.items()} return errors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _post_clean(self):\r\n super(NgModelFormMixin, self)._post_clean()\r\n if self._errors and self.prefix:\r\n self._errors = ErrorDict((self.add_prefix(name), value) for name, value in self._errors.items())", "def render_errors(form):\n return {\n \"form\": form\n }", "d...
[ "0.7038696", "0.6208197", "0.6115108", "0.5996022", "0.5964648", "0.58308095", "0.5824564", "0.57793695", "0.57664406", "0.57629406", "0.5701787", "0.5659007", "0.5616956", "0.56133205", "0.56133205", "0.55535233", "0.5502182", "0.545413", "0.5441139", "0.542132", "0.52813584...
0.7227966
0
Returns the rendered template in JSON format
def render_to_response(self, context, **response_kwargs): if self.request.is_ajax(): data = { "content": render_to_string( self.get_template_names(), context, request=self.request) } return JsonResponse(data) if settings.DEBUG: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render(self):\n self.run()\n return [{'dest' : self.dest,\n 'text' : self.tmpl.render(**self.data)}]", "def render_application_template(self):\n self.pipeline_config['instance_links'] = self.retrieve_instance_links()\n jsondata = get_template(\n template...
[ "0.7579928", "0.7063285", "0.68811625", "0.6820729", "0.67492795", "0.673821", "0.6679588", "0.6661849", "0.65768874", "0.6514327", "0.6481385", "0.64696205", "0.64591503", "0.6450817", "0.6443299", "0.6396994", "0.6315381", "0.6302424", "0.6277436", "0.6257746", "0.6257746",...
0.59789956
53
Initialize the overarching program and allow for threading.
def __init__(self): super().__init__() self.init_ui()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init ():\n freeze_support () # for specific uses of the program on Windows", "def _initialise_run(self) -> None:", "def init(self):\r\n self._parse_options(self._force_args)\r\n self._maybe_daemonize()\r\n self._setup_modules()\r\n self._state = self.INITIALIZED", "def startup(self):\n ...
[ "0.7048484", "0.6891471", "0.6890817", "0.6824575", "0.67827064", "0.676735", "0.6756139", "0.66983837", "0.66682756", "0.6659636", "0.6567239", "0.65514654", "0.6450136", "0.6402179", "0.6348086", "0.6328023", "0.63192403", "0.63087535", "0.6293216", "0.62915957", "0.6284138...
0.0
-1
Build the UI and set up the initial parameters for the system. build the user interface and connect signals from the UI to methods defined below. This is inherited from PyQt5 and pyqtgraph (for antialiasing). ADD MORE OF WHAT THE METHOD DOES HERE.
def init_ui(self, parent=None): super(dIdVGui, self).__init__(parent) self.setupUi(self) #pg.setConfigOptions(antialias=True) #%% Initial Differential Conductance Variables self.dIdV_rate = self.dIdVRate.value() self.dIdV_start = self.dIdVStartCurr.value() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initUI(self):\n self.logger.debug('Setting up the Measurement GUI')\n self.setWindowTitle(self.title)\n\n self.show()\n\n self.make_combobox_scanner()\n self.make_combobox_movements()\n self.make_combobox_configurate()\n self.make_combobox_basic()", "def _init...
[ "0.7934318", "0.7619701", "0.7533222", "0.7496077", "0.7448796", "0.74145854", "0.7398438", "0.73087925", "0.73002166", "0.7296921", "0.72742283", "0.72733223", "0.72610986", "0.72468096", "0.7227707", "0.7221966", "0.72207093", "0.7216277", "0.7216277", "0.718057", "0.717609...
0.6574674
92
Open a dialog box and create a compliance list for a custom sweep. Will save the list so that it may be passed to the instruments. SLIGHTLY BUGGY BUT OK
def create_compliance_list(self): self.compliance_list = None self.list_label = ("Enter a list of compliance voltages (V) separated " "by commas (e.g. 1, 2, 3). Range is 0.1 to 105. Must " "have same number of points as current list or be " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_current_designs_callback(self, ListTypesFull, check_button_ckList):\n\n if not self.check_for_residue_existance():\n return\n\n self.current_chainFull = self.current_residue.get().split(\":\")\n if len(self.current_chainFull) > 1:\n ResStart = int(self.current_...
[ "0.53039885", "0.5272541", "0.5164381", "0.5153914", "0.51034915", "0.507512", "0.5046017", "0.5033432", "0.5007332", "0.49825966", "0.49568945", "0.49487162", "0.49321654", "0.49084106", "0.490425", "0.4867304", "0.4857254", "0.48513114", "0.48159236", "0.4812841", "0.480814...
0.70281583
0
Open a dialog box and create a current list for a custom sweep. Will return the list as a string so that it may be passed to the instruments. SLIGHTLY BUGGY BUT OK
def create_I_list(self): self.I_list = ['0'] self.list_label = ("Enter a list of source currents (A) separated by " "commas (e.g., 1e-3, 2e-6, 3e-4). Range is -0.105 " "to 0.105. If empty list, sets 1-point list with " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_compliance_list(self):\r\n self.compliance_list = None\r\n self.list_label = (\"Enter a list of compliance voltages (V) separated \"\r\n \"by commas (e.g. 1, 2, 3). Range is 0.1 to 105. Must \"\r\n \"have same number of points as current list or be...
[ "0.6108962", "0.55942416", "0.5566351", "0.5345901", "0.5332031", "0.53211814", "0.5315982", "0.5270236", "0.5257532", "0.5217911", "0.51774496", "0.51343507", "0.5105398", "0.51048917", "0.50571436", "0.5004678", "0.50045633", "0.50009185", "0.499991", "0.49909893", "0.49825...
0.58283496
1
Open a dialog box and create a cycle interval list for a custom sweep. Will return the list as a string so that it may be passed to the instruments. SLIGHTLY BUGGY BUT OK
def create_cycle_list(self): self.cycle_list = None self.list_label = ("Enter a list of cycle times (in integer PLC) " "separated by commas (e.g., 1, 5, 7). Must " "have same number of points as current list or be " "e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_I_list(self):\r\n self.I_list = ['0']\r\n self.list_label = (\"Enter a list of source currents (A) separated by \"\r\n \"commas (e.g., 1e-3, 2e-6, 3e-4). Range is -0.105 \"\r\n \"to 0.105. If empty list, sets 1-point list with \"\r\n ...
[ "0.5815914", "0.54718876", "0.5277732", "0.5244302", "0.5012473", "0.5012194", "0.5010573", "0.48528308", "0.47787085", "0.47195724", "0.46868253", "0.4671984", "0.4651609", "0.4645154", "0.46232212", "0.46119052", "0.45586553", "0.4554039", "0.45474464", "0.45366964", "0.453...
0.71184677
0
Calculate the number of points in a sweep.
def num_points_sweep(self, start, stop, step): return(abs((stop - start)//step) + 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_sweep(self):\n return self._n_sweep", "def n_points(self):\n\n if self.data_reduced:\n return len(self.data_reduced[0])\n else:\n return 0", "def numberOfPoints(self):\n return 20000", "def nr_points(self):\n return len(self.x)", "def GetNumber...
[ "0.67116016", "0.6710413", "0.64373267", "0.64242", "0.63951397", "0.6383078", "0.6207242", "0.617462", "0.617306", "0.61665", "0.6122303", "0.6066918", "0.60630375", "0.6040785", "0.6001944", "0.5952431", "0.5930012", "0.5926737", "0.58931786", "0.58931786", "0.58803296", ...
0.7976391
0
If instruments are connected, set the source range type based on the combo box selection and the measurement type. The function inside get() returns unique keys for all nondifferential conductance measurements. Since differential conductance automatically has 'best' ranging, its keys don't matter. WORKING
def update_source_range_type(self): self.source_range_type_index = self.SourceRangeType.currentIndex() self.cmd = None if self.current_tab: self.cmd = self.source_range_type_switch.get( self.current_tab + 3*self.source_range_type_index, None) if self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_default_tuner_range():\n return {65.41: 'C2',\n 69.30: 'C2#',\n 73.42: 'D2',\n 77.78: 'E2b',\n 82.41: 'E2',\n 87.31: 'F2',\n 92.50: 'F2#',\n 98.00: 'G2',\n 103.80: 'G2#',\n 110.00: 'A2',\n 116...
[ "0.56911653", "0.52945167", "0.51720303", "0.4946854", "0.4937591", "0.4891812", "0.4796071", "0.4778892", "0.47767597", "0.47518268", "0.47423512", "0.4717272", "0.47147053", "0.4697422", "0.46531144", "0.46339667", "0.46199188", "0.45852423", "0.45715055", "0.4561549", "0.4...
0.5822572
0
If instruments are connected and 'fixed' ranging is selected for the source, set the range for the current source. WORKING
def update_source_range(self): self.source_range_index = self.SourceRangeValue.currentIndex() self.cmd = None if self.source_range_type_index and self.connected: self.cmd = self.source_range_switch.get( self.source_range_index, None) self.I_sourc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateRange(self):\n if self.autoFollow:\n self.xrange = self.param.activeRange()\n self.xrange = self.xrange # call getter & setter again to verify limits", "def update_source_range_type(self):\r\n self.source_range_type_index = self.SourceRangeType.currentIndex()\r\n ...
[ "0.6363817", "0.60023093", "0.5866444", "0.582724", "0.5760188", "0.57191896", "0.5687571", "0.56715", "0.56542695", "0.55636144", "0.55159867", "0.5506243", "0.5476146", "0.5476146", "0.54492867", "0.54370373", "0.54271984", "0.54124457", "0.5391282", "0.53891414", "0.536108...
0.6765496
0
If instruments connected and the voltmeter is set to manual ranging, update the value of the voltmeter range. WORKING
def update_volt_range(self): self.volt_range_index = self.VoltmeterRangeValue.currentIndex() self.cmd = self.volt_range_switch.get(self.volt_range_index, None) if self.connected: self.I_source.write(self.cmd)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_volt_rate(self):\r\n self.cmd = None\r\n if self.connected:\r\n self.cmd = (\"SYST:COMM:SER:SEND ':SENS:VOLT:NPLC \"\r\n + (str(self.DeltaRate.value()) if self.current_tab\r\n else str(self.dIdVRate.value())) + \"'\")\r\n ...
[ "0.6594569", "0.6531825", "0.6392429", "0.6377812", "0.6198045", "0.6152024", "0.6146791", "0.61040014", "0.6015494", "0.59889895", "0.5960682", "0.5886433", "0.58780557", "0.58434933", "0.5833829", "0.5824948", "0.58067364", "0.57977766", "0.5794106", "0.5776705", "0.576475"...
0.7757934
0
If instruments connected, update voltmeter rate. Only functional for dIdV and delta measurements. WORKING
def update_volt_rate(self): self.cmd = None if self.connected: self.cmd = ("SYST:COMM:SER:SEND ':SENS:VOLT:NPLC " + (str(self.DeltaRate.value()) if self.current_tab else str(self.dIdVRate.value())) + "'") self.voltmeter_rat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _measurement_update(self):\n pass", "def update_volt_range(self):\r\n self.volt_range_index = self.VoltmeterRangeValue.currentIndex()\r\n self.cmd = self.volt_range_switch.get(self.volt_range_index, None)\r\n if self.connected:\r\n self.I_source.write(self.cmd)", "def ...
[ "0.63179785", "0.622544", "0.60588276", "0.5962366", "0.589405", "0.5797333", "0.5788367", "0.57867223", "0.57157326", "0.57095784", "0.57080036", "0.5685928", "0.56754315", "0.5664005", "0.56250376", "0.5614799", "0.55972266", "0.55874556", "0.55782706", "0.55688703", "0.556...
0.7804134
0
If the instruments are connected and the user alters the compliance voltage, send a command to update the instruments. WORKING
def update_compliance(self): self.compliance_voltage = str(self.ComplianceVoltage.value()) #self.cmd = None if self.connected: self.cmd = "CURR:COMP " + self.compliance_voltage self.I_source.write(self.cmd)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_volt_range(self):\r\n self.volt_range_index = self.VoltmeterRangeValue.currentIndex()\r\n self.cmd = self.volt_range_switch.get(self.volt_range_index, None)\r\n if self.connected:\r\n self.I_source.write(self.cmd)", "def update_volt_rate(self):\r\n self.cmd = None...
[ "0.6727535", "0.66885936", "0.6580229", "0.62153286", "0.6068523", "0.6049526", "0.6044076", "0.60218334", "0.60006726", "0.5878938", "0.5873626", "0.5801125", "0.5755011", "0.5741827", "0.5732976", "0.57316613", "0.57288504", "0.56651706", "0.56286997", "0.56208044", "0.5619...
0.74610525
0
If instruments connected and the user alters the specified units in the dropdown menu, send a command to update the unit type. WORKING
def update_units(self): self.units_index = self.UnitsComboBox.currentIndex() self.cmd = None if self.connected: self.cmd = self.unit_switch.get(self.units_index, None) self.I_source.write(self.cmd) self.update_header_string()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unitUpdate(self):\n newText = self.unitGroup.unitString()\n cursorPos = len(newText) - self.text().length() + self.cursorPosition()\n if cursorPos < 0: # cursor set to same distance from right end\n cursorPos = 0\n self.blockSignals(True)\n self.setText(newTex...
[ "0.6152118", "0.61117256", "0.6045749", "0.5959084", "0.58111477", "0.57802886", "0.5717387", "0.570346", "0.56736743", "0.56634337", "0.56476676", "0.56463736", "0.5617639", "0.56117994", "0.5536073", "0.5527987", "0.55072844", "0.54589546", "0.54367155", "0.53979075", "0.53...
0.7398374
0
FIGURE OUT HOW TO DO PROPERLY
def clear_buffer(self): self.cmd = "TRAC:CLE" self.I_source.write(self.cmd) self.in_buffer = int(self.I_source.query("TRAC:POIN:ACT?"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform(self):", "def apply(self):", "def preprocess(self):", "def apply(self) -> None:", "def apply(self) -> None:", "def transform():", "def scale(self):", "def substantiate():", "def transform(self, x):", "def solvate(self):\n\n pass", "def exo2():", "def othersn(ax):", "def...
[ "0.60599005", "0.58336335", "0.57831174", "0.578261", "0.578261", "0.5730147", "0.56879497", "0.5623188", "0.56141365", "0.5584145", "0.5570487", "0.5546733", "0.55165327", "0.5394322", "0.5368094", "0.53645474", "0.5340135", "0.53302324", "0.5329223", "0.5323773", "0.5292836...
0.0
-1
FIGURE OUT HOW TO DO PROPERLY self.cmd = None
def calibrate_meter(self): print("meter calibrated")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cmd(self):", "def __init__(self, cmd):\r\n self._cmd = cmd", "def __init__(self, cmd):\n self._cmd = cmd", "def cmd(self, cmd):\n return cmd", "def __init__(self, cmd):\n # Build command + options \n self.cmd = cmd \n setattr(self, 'command', \"%s\" % (cmd))", "def _...
[ "0.7856441", "0.76452756", "0.7426194", "0.7417791", "0.7231597", "0.7196737", "0.7139473", "0.7066071", "0.69000655", "0.68417186", "0.68273544", "0.67683977", "0.67374516", "0.6641619", "0.6626947", "0.657753", "0.65712225", "0.652236", "0.64832443", "0.64673394", "0.646055...
0.0
-1
If the user selects a different measurement type from the tab menu, update the variables and the ranging. WORKING
def update_tab(self): self.current_tab = self.TabWidget.currentIndex() # print("Tab = " + str(self.current_tab)) self.update_source_range_type() self.update_variables_switch[self.current_tab]() self.update_header_string() self.update_filter_on()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_units(self):\n unit_var_value = self.view.vars['unit'].get()\n if unit_var_value == 'm3ph':\n self.minran_u_label.config(text='m³/h')\n self.maxran_u_label.config(text='m³/h')\n self.points_tview.heading('vflow', text='Przepływ [m³/h]', anchor=tk.CENTER)\n ...
[ "0.6636531", "0.6625855", "0.65011966", "0.63680774", "0.61108446", "0.60962576", "0.59827435", "0.5895908", "0.5879142", "0.5857627", "0.5799572", "0.578058", "0.57690614", "0.57404363", "0.57372797", "0.56927246", "0.56882066", "0.5685359", "0.5659598", "0.56448346", "0.563...
0.57343465
15
Check GPIB address of current source and initialize if valid. If the usergiven GPIB address for the 6221 is in the list of resources, then assign it to self.I_source and send the following
def update_GPIB(self): self.check_errors(False, False) #self.I_source_list = [ # x for x in self.resources # if (str(self.GPIB.value()) and 'GPIB') in x # ] if not self.errors_exist: self.I_source = self.rm.open_resource(self.I_so...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n import visa\n\n rm = visa.ResourceManager()\n target = 'Agilent Technologies,8163B,MY48208514,V5.25(72637)'\n\n for dev in rm.list_resources():\n try:\n inst = rm.open_resource(dev)\n name = inst.query('*IDN?') # Agilent Te...
[ "0.58488786", "0.5460564", "0.54244834", "0.53689754", "0.52629423", "0.5229564", "0.5226817", "0.5191806", "0.5149981", "0.5125633", "0.50626856", "0.50484693", "0.5043974", "0.50175875", "0.501238", "0.49967742", "0.49922526", "0.4991907", "0.49915245", "0.49810675", "0.497...
0.5940608
0
Create/overwrite a new save file and write a standard header. Open a dialog box that allows the user to name the .txt file the program will write measurements to. Record the name of this file, open it for writing (overwrite all previous data), and write a header to the file. Reset the local variable for number of measu...
def new_file(self): self.filename = QFileDialog.getSaveFileName( None, 'Title', '', 'TXT (*.txt)' ) if self.filename[0]: self.currentfile = open(self.filename[0], 'w') (self.base_name, self.ext) = os.path.splitext(self.filename[0]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_file():\r\n\r\n file_name, ok = QFileDialog.getSaveFileName(MainWindow, '保存输入文件', default_path, 'txt(*.txt)')\r\n try:\r\n get_measure_par(input_parameters)\r\n input_parameters.check_data()\r\n input_parameters.close_ser()\r\n except Exception as e:\r\n QMessageBox.cr...
[ "0.63446736", "0.6315409", "0.6082766", "0.6069871", "0.60295033", "0.60274047", "0.5962177", "0.5936258", "0.5863543", "0.58622694", "0.5860359", "0.58338547", "0.58133197", "0.5812401", "0.5780677", "0.57552195", "0.57400274", "0.57241136", "0.57232356", "0.5710348", "0.569...
0.6089908
2
Create a dialog box explaining why measurement cannot start.
def run_error_messages(self): self.error = "" #while self.error_queue: #self.error += (self.error_messages.get( # self.error_queue.popleft, None # ) + " ") #self.error += self.I_source.query("STAT:QUE?") #print(self.error) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_error(self):\n if self.error is None:\n return\n from PartSeg.common_gui.error_report import ErrorDialog\n\n if isinstance(self.error, TiffFileException):\n mess = QMessageBox()\n mess.setIcon(QMessageBox.Critical)\n mess.setText(\"During re...
[ "0.6401454", "0.630986", "0.6306927", "0.62711555", "0.6116938", "0.6109479", "0.6104505", "0.60883665", "0.6031911", "0.598907", "0.5923355", "0.59219784", "0.59204906", "0.58927524", "0.5883991", "0.5874046", "0.587354", "0.58649987", "0.5846545", "0.5846545", "0.5834964", ...
0.0
-1
Execute the UI loop
def main(): app = QtGui.QApplication(sys.argv) form = dIdVGui() form.show() app.exec_()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n self.cmdloop()", "def run(self):\n\n while not self.done:\n\n self.event_loop()\n\n self.update()", "def takeControl(self):\n mainloop()", "def takeControl(self):\n mainloop()", "def __loop(self):\n\n self.__update_table()\n s...
[ "0.7921923", "0.77360135", "0.75328994", "0.75328994", "0.7509691", "0.7382489", "0.7374895", "0.73469794", "0.7283956", "0.72793925", "0.72655976", "0.7254827", "0.71981347", "0.7173483", "0.7072041", "0.7068032", "0.7064065", "0.7043865", "0.6990638", "0.6969184", "0.695363...
0.0
-1
Wrapper around print with color options, it applies colors only on ttys >>> color_print(Color.BOLD, 'Home =>', Color.BLUE, '/home/example') >>> "Home =>" would be bold and "/home/example" would be blue
def color_print( *messages, default_color=Color.NORMAL, sep=' ', end='\n', file=stdout, flush=False, ): string = [] print_colors = file.isatty() if print_colors: string.append(str(default_color)) messages_iter = iter(messages) # Print first message and deal with 'se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printcolor(color, text):\r\n pushcolor()\r\n setcolor(color)\r\n print text\r\n popcolor()", "def print_color(text: str, color:bcolors = bcolors.BOLD):\n print(f\"{color}{text}{bcolors.ENDC}\")", "def print_with_color(message, color):\n if color in colors:\n print(colors[color] + m...
[ "0.77834445", "0.74662054", "0.7423158", "0.7419605", "0.7315081", "0.706688", "0.70493037", "0.6995986", "0.69395125", "0.688094", "0.6754055", "0.67533886", "0.6724027", "0.66706485", "0.6551255", "0.65488976", "0.6486677", "0.6465688", "0.6439469", "0.6406669", "0.63382816...
0.66232353
14
Jobs are actions that BigQuery runs on your behalf to load data, export data, query data, or copy data. Once a BigQuery job is created, it cannot be changed or deleted. Example Usage
def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, copy: Optional[pulumi.Input[pulumi.InputType['JobCopyArgs']]] = None, extract: Optional[pulumi.Input[pulumi.InputType['JobExtractArgs']]] = None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_jobs():\n return _get_bigquery_service().jobs()", "def query_bigquery(sql_query, gdrive=False, retries=2, job_name=None,\n project='khanacademy.org:deductive-jet-827'):\n # We could probably do 'import bq' and call out directly, but\n # I couldn't figure out an easy way to do ...
[ "0.66288114", "0.6231927", "0.6087227", "0.60524", "0.5904442", "0.586172", "0.56854284", "0.5576546", "0.55539566", "0.5550587", "0.5516396", "0.5515099", "0.551495", "0.5507597", "0.550355", "0.5487884", "0.54843163", "0.54824436", "0.5452061", "0.5447395", "0.5433585", "...
0.0
-1
Get an existing Job resource's state with the given name, id, and optional extra properties used to qualify the lookup.
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, copy: Optional[pulumi.Input[pulumi.InputType['JobCopyArgs']]] = None, extract: Optional[pulumi.Input[pulumi.InputType['JobExtractArgs']]] = None, job_id: Optional...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lookup(job_id: str) -> JobState:\n job = JobState(job_id)\n job.update()\n return job", "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None) -> 'Job':\n opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=...
[ "0.752408", "0.6754207", "0.6295021", "0.6050239", "0.5956845", "0.59274155", "0.5833936", "0.57959604", "0.5761722", "0.5756654", "0.57362854", "0.57168263", "0.5636522", "0.5632625", "0.5629977", "0.56236506", "0.5582701", "0.5581278", "0.5558081", "0.55574095", "0.55572", ...
0.64249945
2
Copies a table. Structure is documented below.
def copy(self) -> pulumi.Output[Optional['outputs.JobCopy']]: return pulumi.get(self, "copy")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_table(self, table: Table) -> Table:\n self._requires_table(table)\n return table.copy()", "def Copy(self, copy):\n return _table.Table_Copy(self, copy)", "def copy_table(document, table, cut=False):\n if cut:\n document._body._element._insert_tbl(table._tbl)\n else:\n...
[ "0.80779123", "0.75334173", "0.73572755", "0.71226597", "0.68560654", "0.6740201", "0.6629716", "0.6619253", "0.6537283", "0.64276606", "0.63529986", "0.6326202", "0.6305635", "0.6281829", "0.6225138", "0.62093914", "0.62093914", "0.61507237", "0.6050223", "0.5972014", "0.596...
0.0
-1
Configures an extract job. Structure is documented below.
def extract(self) -> pulumi.Output[Optional['outputs.JobExtract']]: return pulumi.get(self, "extract")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, settings, ui_id, job_id):\n # Call the original constructor\n super().__init__(settings, ui_id, job_id)\n\n # Set the local template\n self.local_template = 'settings/bilby_local.sh'\n # Set our job parameter path\n self.job_parameter_file = os.path.join...
[ "0.5821657", "0.5677721", "0.5594135", "0.5460422", "0.53917944", "0.53839976", "0.53659284", "0.5331715", "0.5310294", "0.5286848", "0.52693266", "0.52497065", "0.523421", "0.5232084", "0.52013916", "0.5182275", "0.5161715", "0.5121684", "0.50993395", "0.509534", "0.50854534...
0.5435409
4
The ID of the job. The ID must contain only letters (az, AZ), numbers (09), underscores (_), or dashes (). The maximum length is 1,024 characters.
def job_id(self) -> pulumi.Output[str]: return pulumi.get(self, "job_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_job_id(self) -> str:\n return self.split_name[2][3:]", "def _get_job_id(self):\n return uuid.uuid4().hex", "def _generate_job_id():\n # CAIP job id can contains only numbers, letters and underscores.\n unique_tag = str(uuid.uuid4()).replace(\"-\", \"_\")\n return \"tf_cloud_train_{}...
[ "0.81548387", "0.7609381", "0.7318471", "0.7308317", "0.722384", "0.69657046", "0.69571614", "0.6926118", "0.6921736", "0.6895819", "0.6787473", "0.67803437", "0.6737579", "0.66389865", "0.6589558", "0.6570669", "0.65549666", "0.65227807", "0.6467001", "0.6406802", "0.6378020...
0.71984714
5
Job timeout in milliseconds. If this time limit is exceeded, BigQuery may attempt to terminate the job.
def job_timeout_ms(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "job_timeout_ms")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timeout(self) -> str:\n return pulumi.get(self, \"timeout\")", "def timeout(self) -> int:\n\n return self._timeout", "def check_timeout(self, msg):\n if msg.clock.secs > self.timeout and not self.is_cancelled:\n rospy.loginfo(\"Test timed out, cancelling job\")\n ...
[ "0.5882542", "0.58566386", "0.58173275", "0.58124197", "0.57919353", "0.5783616", "0.57713014", "0.572862", "0.5660806", "0.56589997", "0.5643863", "0.5643863", "0.5625082", "0.55886996", "0.55886996", "0.55886996", "0.55886996", "0.5574897", "0.557383", "0.5548075", "0.55405...
0.69198066
0
The type of the job.
def job_type(self) -> pulumi.Output[str]: return pulumi.get(self, "job_type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def job_type(self):\n return self._job_type", "def type(self) -> Optional[pulumi.Input['JobType']]:\n return pulumi.get(self, \"type\")", "def job_details_type(self) -> str:\n return pulumi.get(self, \"job_details_type\")", "def job_details_type(self) -> str:\n return pulumi.get(s...
[ "0.9002671", "0.844342", "0.76216686", "0.76216686", "0.76216686", "0.7435503", "0.726418", "0.709847", "0.7038003", "0.7030451", "0.7030451", "0.7030451", "0.7030451", "0.7030451", "0.7030451", "0.7030451", "0.7030451", "0.7030451", "0.7030451", "0.7030451", "0.7030451", "...
0.87467295
1
The labels associated with this job. You can use these to organize and group your jobs.
def labels(self) -> pulumi.Output[Optional[Mapping[str, str]]]: return pulumi.get(self, "labels")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_label(self):\n return self.job[self.label_key]", "def labels(self) -> Mapping[str, str]:\n return pulumi.get(self, \"labels\")", "def labels(self) -> Mapping[str, str]:\n return pulumi.get(self, \"labels\")", "def labels(self) -> Mapping[str, str]:\n return pulumi.get(self...
[ "0.7774395", "0.757336", "0.757336", "0.757336", "0.757336", "0.757336", "0.757336", "0.757336", "0.757336", "0.7461375", "0.7347413", "0.7347413", "0.723107", "0.72306985", "0.720582", "0.720582", "0.720582", "0.720582", "0.720582", "0.71988285", "0.7185549", "0.71437156",...
0.71388465
29
Configures a load job. Structure is documented below.
def load(self) -> pulumi.Output[Optional['outputs.JobLoad']]: return pulumi.get(self, "load")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_jobs(self):\n\n jobs = self.app.config.get('SCHEDULER_JOBS')\n job_stores = self.app.config.get('SCHEDULER_JOBSTORES')\n\n if not jobs:\n jobs = self.app.config.get('JOBS')\n\n if jobs:\n if job_stores:\n self.reload_jobs(jobs=jobs)\n ...
[ "0.63670856", "0.6113547", "0.6055729", "0.6047948", "0.60470104", "0.6004085", "0.5966015", "0.595499", "0.58224434", "0.5799299", "0.5777906", "0.57345104", "0.5729571", "0.5707282", "0.57072353", "0.56807077", "0.56798977", "0.567705", "0.5670196", "0.5660629", "0.56246996...
0.5583495
23
The geographic location of the job. The default value is US.
def location(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "location")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def location(self) -> str:\n return pulumi.get(self, \"location\")", "def location(self) -> str:\n return pulumi.get(self, \"location\")", "def location(self) -> str:\n return pulumi.get(self, \"location\")", "def location(self) -> str:\n return pulumi.get(self, \"location\")", ...
[ "0.74507964", "0.74507964", "0.74507964", "0.74507964", "0.74507964", "0.74507964", "0.74507964", "0.74507964", "0.74507964", "0.74507964", "0.74507964", "0.74507964", "0.74507964", "0.733936", "0.7273975", "0.72535896", "0.72535896", "0.72535896", "0.7241201", "0.7181057", "...
0.7040756
30
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
def project(self) -> pulumi.Output[str]: return pulumi.get(self, "project")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def project_id(self) -> Optional[str]:\n return pulumi.get(self, \"project_id\")", "def project_id(self) -> str:\n return pulumi.get(self, \"project_id\")", "def project_id(self) -> str:\n return pulumi.get(self, \"project_id\")", "def project_id(self) -> str:\n return pulumi.get(...
[ "0.8160074", "0.8047798", "0.8047798", "0.8047798", "0.8047798", "0.7885196", "0.78261137", "0.7762521", "0.7762521", "0.7762521", "0.7762521", "0.7762521", "0.7635239", "0.7635239", "0.7528419", "0.7518447", "0.75087434", "0.7489456", "0.74297875", "0.734286", "0.7273379", ...
0.64872843
94
Configures a query job. Structure is documented below.
def query(self) -> pulumi.Output[Optional['outputs.JobQuery']]: return pulumi.get(self, "query")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_google_bigquery_job_config():\n job_config = bigquery.QueryJobConfig()\n job_config.maximum_bytes_billed = getattr(settings, 'OPR_GOOGLE_BIGQUERY_MAX_PROCESS_BYTES', None)\n job_config.use_query_cache = getattr(settings, 'OPR_GOOGLE_BIGQUERY_USE_CACHE', False)\n\n return job_config", "def con...
[ "0.5962772", "0.587585", "0.5862887", "0.56656957", "0.562309", "0.5573987", "0.55305994", "0.54989725", "0.5483543", "0.54443306", "0.54435676", "0.53984964", "0.53947663", "0.53442645", "0.53322864", "0.53170633", "0.52949715", "0.52949715", "0.527428", "0.5274196", "0.5269...
0.52722174
20
Email address of the user who ran the job.
def user_email(self) -> pulumi.Output[str]: return pulumi.get(self, "user_email")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_useremail(self):\n return self.user.email", "def email(self, instance):\r\n return instance.user.email", "def get_user_email(self):\n member = self.get_user()\n if member:\n return member.getProperty('email')", "def email(self) -> str:\n return pulumi.get...
[ "0.8045067", "0.7482019", "0.72746706", "0.7197063", "0.7197063", "0.7197063", "0.7195695", "0.7189387", "0.7168474", "0.7168474", "0.7168474", "0.7168474", "0.71192086", "0.7095948", "0.7094554", "0.70901", "0.69890106", "0.6986238", "0.6955563", "0.691718", "0.68999255", ...
0.8011265
1
Parse the command line options
def get_options(): # pass in the access_token via commandline parser = OptionParser() parser.add_option("--data-dir", default='/tmp', action="store", type="string", dest="data_dir", help="Directory where DBs exist") parser.add_option("--malicious", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_options():\n global parser\n parser.add_option(\"-r\", \"--regions\", dest=\"input_brain_regions\",\n help=\"Input file for brain region data\",\n action=\"store\", type='string')\n\n parser.add_option(\"-g\", \"--gray\", dest=\"input_gray_levels\",\n ...
[ "0.81653506", "0.78263617", "0.7749474", "0.7708489", "0.77028614", "0.762441", "0.75952876", "0.7572062", "0.7568611", "0.75644726", "0.74594223", "0.7434058", "0.74286336", "0.7371361", "0.7363095", "0.7334798", "0.732726", "0.7313284", "0.73038536", "0.727963", "0.72284585...
0.0
-1
Using the options and stdin check the bloom filters for IOCs
def main(): options = get_options() data_path = str(options.data_dir) bloom = BloomCategory(malicious_path=data_path + '/malicious-ips.bloom', predicted_path=data_path + '/predicted-ips.bloom', has_intel_path=data_path + '/ip-threat-intel.bloom') with ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\r\n arguments = collections.deque(sys.argv)\r\n arguments.popleft()\r\n file_name = arguments.popleft()\r\n if len(arguments) == 0:\r\n print(\"Please enter filter commands to run the program. (host, port, ip, tcp, udp, icmp, net)\")\r\n sys.exit()\r\n packets_info = read_a...
[ "0.59075195", "0.571198", "0.56005055", "0.55080795", "0.54815006", "0.5467969", "0.54254556", "0.54060715", "0.53923625", "0.53685206", "0.5339621", "0.5333452", "0.5298472", "0.5276344", "0.5259351", "0.5253875", "0.5249222", "0.52447957", "0.5241998", "0.5231878", "0.52266...
0.7171011
0
Allow all users which are in 'users' group.
def has_permission(self, request): return request.user.is_active \ and request.user.groups.filter(name='users').count()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_in_group(user, *group_names):\n\treturn bool(user.groups.filter(name__in=group_names)) | user.is_superuser", "def test_all_users_in_group_are_seen(self):\n\n logged_user = utils.create_user_and_authenticate(self)\n self.group.users.add(logged_user)\n\n test_users_in_group = []\n ...
[ "0.645859", "0.64161813", "0.63618237", "0.6341922", "0.6307062", "0.6291116", "0.6262052", "0.624811", "0.6224953", "0.6148409", "0.6102744", "0.6082598", "0.60788065", "0.6070103", "0.60507107", "0.5984473", "0.5979317", "0.59507567", "0.59330946", "0.5902153", "0.58936113"...
0.5525438
54
Makes keep alive request.
def __call__(self, session=None, lightweight=None): (response, elapsed_time) = self.request(session=session) self.client.set_session_token(response.get('token')) return self.process_response(response, KeepAliveResource, elapsed_time, lightweight)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keepalive(self) -> None:", "def keep_alive(self):\n req = BFGlobalFactory.create(\"ns1:KeepAliveReq\")\n rsp = self._soapcall(BFGlobalService.keepAlive, req)\n if rsp.header.errorCode != APIErrorEnum.OK:\n logger.error(\"{keepAlive} failed with error {%s}\",\n ...
[ "0.7858032", "0.7399388", "0.73251414", "0.70766056", "0.65952", "0.65890306", "0.6548859", "0.65116495", "0.64874387", "0.64856464", "0.6415641", "0.64016193", "0.6316313", "0.6245971", "0.62115264", "0.6207706", "0.6188858", "0.6148815", "0.6091063", "0.5997852", "0.5929846...
0.6231983
14
Create a background file for motif analysis.
def create_background_file( outfile, bg_type, fmt="fasta", size=None, genome=None, inputfile=None, number=10000 ): fmt = fmt.lower() if fmt in ["fa", "fsa"]: fmt = "fasta" if bg_type not in BG_TYPES: logger.error(f"The argument 'type' should be one of: {','.join(BG_TYPES)}") sys...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_background(argv):\n args = parse_args(argv)\n\n # Create fasta files\n sys.stdout.write(f\"Generating input fasta file...\")\n generate_input_fasta(regulatory_regions_file=args.regulatory_regions_file,\n background_input_fasta=args.background_input_fasta,\n ...
[ "0.6770991", "0.6409098", "0.60642445", "0.600799", "0.58706754", "0.58117944", "0.5713409", "0.56881523", "0.5673229", "0.5517937", "0.5509815", "0.5440462", "0.5392011", "0.5383787", "0.53739244", "0.5337144", "0.5326043", "0.53088874", "0.5253408", "0.52207017", "0.519795"...
0.68112105
0
Create index of GC content for a genome.
def create_gc_bin_index(genome, fname, min_bin_size=100): logger.info("Creating index for genomic GC frequencies.") g = Genome(genome) fasta = g.filename sizes = g.filename + ".sizes" # props["sizes"]["sizes"] with NamedTemporaryFile() as tmp: # pylint: disable=unexpected-keyword-arg ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_index(self):\r\n date_time('Building indexes in citations table')\r\n self.cursor.execute('DROP INDEX IF EXISTS IDX_citations ;')\r\n self.cursor.execute('CREATE INDEX IDX_citations ON citations (citation);')\r\n self.conn.commit()\r\n gc.collect()", "def index_genome...
[ "0.63085175", "0.6208266", "0.6030924", "0.5986668", "0.5840511", "0.58364654", "0.5822908", "0.57987857", "0.5792786", "0.5771251", "0.57565176", "0.56883234", "0.5687291", "0.5676972", "0.5670533", "0.5667721", "0.56395346", "0.5570101", "0.5566708", "0.5549159", "0.5545711...
0.7131006
0
Create a BED file from different GC bins.
def gc_bin_bedfile( bedfile, genome, number, length=200, bins=None, random_state=None, min_bin_size=100 ): if bins is None: bins = [(0.0, 0.2), (0.8, 1.0)] for b in np.arange(0.2, 0.799, 0.05): bins.append((round(b, 2), round(b + 0.05, 2))) bins = sorted(bins) if number ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_gc_bin_index(genome, fname, min_bin_size=100):\n logger.info(\"Creating index for genomic GC frequencies.\")\n g = Genome(genome)\n fasta = g.filename\n sizes = g.filename + \".sizes\" # props[\"sizes\"][\"sizes\"]\n\n with NamedTemporaryFile() as tmp:\n # pylint: disable=unexpect...
[ "0.60980815", "0.5793627", "0.5760087", "0.5706503", "0.56810117", "0.56430155", "0.56416684", "0.5589777", "0.55267876", "0.55234665", "0.5493021", "0.54800487", "0.5461782", "0.5357284", "0.5355436", "0.53348494", "0.53264964", "0.5325675", "0.53226894", "0.52907103", "0.52...
0.6333996
0
Create a BED file with GC% matched to input file.
def matched_gc_bedfile(bedfile, matchfile, genome, number, size=None, min_bin_size=100): g = Genome(genome) genome_fa = g.filename try: fa = Fasta(matchfile) gc = [ (seq.upper().count("C") + seq.upper().count("G")) / len(seq) for seq in fa.seqs ] sizes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_bgf(self, filename):\n body = [\"BIOGRF{0:>5s}\\n\".format(self.biogrf)]\n if self.descrp:\n body.append(\"DESCRP {0}\\n\".format(self.descrp))\n else:\n body.append(\"DESCRP {0}\\n\".format(filename))\n body.append(\"FORCEFIELD {0}\\n\".format(self.ff))\...
[ "0.6062387", "0.56986284", "0.55833983", "0.55601734", "0.5551539", "0.5389084", "0.53258824", "0.53198844", "0.52998364", "0.52686113", "0.52623475", "0.5166518", "0.51603377", "0.51446456", "0.51310086", "0.5125808", "0.50954264", "0.5057726", "0.503264", "0.5031262", "0.50...
0.6236064
0
Return parsed json of data from sensors in dictionary form
def getDataParsed(): serialConsole.flush() rawData = serialConsole.readline().decode("utf-8").rstrip() parsedJson = json.loads(rawData) return parsedJson
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_details_json():\n return [\n {\n \"dateutc\": 1547094300000,\n \"winddir\": 344,\n \"windspeedmph\": 1.6,\n \"windgustmph\": 2.2,\n \"maxdailygust\": 3.4,\n \"tempf\": 34,\n \"hourlyrainin\": 0,\n \"eventra...
[ "0.7102904", "0.6808078", "0.6580409", "0.64217085", "0.6421479", "0.63857055", "0.63110226", "0.63013804", "0.6255397", "0.62031794", "0.6200998", "0.6193295", "0.60692954", "0.6065768", "0.6063692", "0.60188586", "0.599554", "0.5960094", "0.59268564", "0.59105647", "0.59093...
0.605225
15
Stack each of the args horizontally, spaced by delta_x, from left to right.
def set_delta_x(self, *args: str, delta_x: Reversible[float] | float = 0.0) -> None: if not isinstance(delta_x, float): delta_x = list(reversed(delta_x)) self.set_delta('x', *reversed(args), delta=delta_x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def horizontal_stack(*args):\r\n # Note: 'horizontal_stack' and 'vertical_stack' do not behave exactly like\r\n # Numpy's hstack and vstack functions. This is intended, because Numpy's\r\n # functions have potentially confusing/incoherent behavior (try them on 1D\r\n # arrays). If this is fixed in a fu...
[ "0.62705624", "0.58168936", "0.5685121", "0.5365151", "0.5355684", "0.5308677", "0.5262725", "0.5255217", "0.5250414", "0.52227384", "0.52144426", "0.5204895", "0.51811", "0.51687783", "0.51582426", "0.51582426", "0.51582426", "0.5128119", "0.5115836", "0.51113474", "0.508057...
0.56655216
3
Stack each of the args vertically, spaced by delta_y, from top to bottom.
def set_delta_y(self, *args: str, delta_y: Sequence[float] | float = 0.0) -> None: self.set_delta('y', *args, delta=delta_y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def botStack_y(self):\r\n self.y_stack=self.img.shape[1]-1\r\n \r\n self.pixmap3=self.drawPixmap(\"xz\")\r\n self.lbl3.setPixmap(self.pixmap3)\r\n self.pixmap4= self.writeEdge(\"xz\")\r\n self.lbl4.setPixmap(self.pixmap4)\r\n self.y_stack_lbl.setText(str(self.y_stac...
[ "0.5773231", "0.5634331", "0.5516587", "0.542991", "0.5422386", "0.5393093", "0.5393093", "0.5393093", "0.5393093", "0.5393093", "0.5393093", "0.5393093", "0.5393093", "0.5393093", "0.5393093", "0.5393093", "0.52656275", "0.52176785", "0.51273435", "0.5104197", "0.50842553", ...
0.46237653
45
Set c.x, c.y = location.
def set_location(self, c: str, location: tuple[float, float]) -> None: if len(location) != 2: # noqa: PLR2004 raise ValueError self.set_x(c, location[0]) self.set_y(c, location[1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_new_location(self, xPos, yPos):", "def set_coordinates(self, x, y):\n self.x = x\n self.y = y", "def position(self, x, y):\n self.x = x \n self.y = y\n self.pos[0] = x \n self.pos[1] = y", "def set_location(self, x, y, z=0):\n self._rect.topleft = (x, ...
[ "0.7428723", "0.72963333", "0.7262265", "0.72220844", "0.72200346", "0.71369195", "0.7072781", "0.7039247", "0.69732124", "0.69413865", "0.6907883", "0.6855876", "0.68402445", "0.67735624", "0.6736265", "0.6662019", "0.6643821", "0.6624045", "0.6596092", "0.65817606", "0.6552...
0.72543436
3
Space n items with spacing according to (n1) ratios. E.g., ratios=[0, 1] puts item[1] at item[0] fraction = (dc)/(dc + (ed)) => (dc) = (ec) fraction.
def set_between(self, coord: str, *items: str, ratios: None | Sequence[float] = None) -> None: if ratios is None: ratios = [1] * (len(items) - 1) for c, d, e, r1, r2 in zip(items, items[1:], items[2:], ratios, ratios[1:], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spacing(self, divisions=10, ratio=1.0, thickness=1.0):\r\n if divisions == 1:\r\n sp = [0.0, 1.0]\r\n return np.array(sp)\r\n\r\n growth = ratio**(1.0 / (float(divisions) - 1.0))\r\n\r\n if growth == 1.0:\r\n growth = 1.0 + 1.0e-10\r\n\r\n s0 = 1.0\r...
[ "0.6269365", "0.62639314", "0.5947355", "0.5471383", "0.52522314", "0.523624", "0.51842475", "0.51664436", "0.5130865", "0.5109552", "0.51064223", "0.5102746", "0.50894815", "0.50866324", "0.5018106", "0.5007691", "0.4956959", "0.4938565", "0.49329013", "0.4932875", "0.493201...
0.5090766
12
Set c d = e f.
def set_delta_equal(self, coord: str, c: str, d: str, e: str, f: str) -> None: a = self.blank() a[self.index(coord, c)] += 1.0 a[self.index(coord, d)] -= 1.0 a[self.index(coord, e)] -= 1.0 a[self.index(coord, f)] += 1.0 self.add_constraint(a, 0.0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_e(new_e):\n global e\n if old_set_e is not None:\n old_set_e(new_e)\n e = new_e", "def f_set(self, data):\n raise NotImplementedError(\"Should have implemented this.\")", "def set():", "def set_c(self, c):\n self.c = c", "def set():\n pass", "def setC(self, c):\n\...
[ "0.59207237", "0.5489756", "0.5407103", "0.52503955", "0.5216911", "0.5045269", "0.49974662", "0.49689245", "0.49604604", "0.4934092", "0.4934092", "0.491751", "0.49079654", "0.4887534", "0.48573717", "0.483059", "0.4809637", "0.4806166", "0.48061296", "0.4800933", "0.4795013...
0.52701014
3
Mutate individual in place; sigma much higher that 0.25 can will leed to long execution time
def GausianMutator(individual, sigma, indpb): for idx, gene in enumerate(individual): if rand.random() > indpb: dtype = gene.type if dtype == bool: gene.value(not gene.value()) continue min_value, max_value = gene.min, gene.max ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mutate(self, noise_generator, sigma):\n\n mutation_indexes = torch.distributions.categorical.Categorical(\n torch.tensor([self.mutation_prob, 1 - self.mutation_prob])).sample([self.population_size]) > 0.5\n\n noise = noise_generator.sample([self.population_size, len(self.population[0]...
[ "0.6688608", "0.655262", "0.6480654", "0.6246567", "0.61921453", "0.6139258", "0.6087077", "0.6059703", "0.60146874", "0.5908357", "0.5848488", "0.580409", "0.5796968", "0.57791954", "0.57513815", "0.5739943", "0.5710097", "0.56995106", "0.5689599", "0.5685349", "0.56732017",...
0.70532256
0
put local file to qiniu. If key is None, the server will generate one.
def put_file(self, key=None, local_file=None, rename=None): if local_file is None: raise NameError('upload file to qiniu error!') policy = rs.PutPolicy(bucket_name) policy.saveKey = rename up_token = policy.token() ret, err = io.put_file(up_token, key, local_file) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put_file(uptoken, key, localfile, extra=None):\r\n if extra is not None and extra.check_crc == 1:\r\n extra.crc32 = _get_file_crc32(localfile)\r\n with open(localfile, 'rb') as f:\r\n return put(uptoken, key, f, extra)", "def key_upload(self, key=None):\n raise NotImplementedError"...
[ "0.7133599", "0.69790006", "0.682977", "0.66461545", "0.65120673", "0.64975405", "0.6486899", "0.6470201", "0.6447628", "0.6422348", "0.6378536", "0.63577235", "0.62944865", "0.6294383", "0.6289327", "0.62754655", "0.62322944", "0.61883247", "0.61791635", "0.6174863", "0.6158...
0.738366
0
put your data to qiniu. If key is None, the server will generate one.
def put(self, img_url, key=None, rename=None): r = None if img_url is None: raise ValueError('upload img path to qiniu error!') for i in range(5): r = requests.get(img_url, timeout=10.0) if r is not None: break policy = rs.PutPolicy(bu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _put(self, key, data):\n path = self._get_key_path(key)\n with open(path, \"wb\") as pickle_file:\n pickle.dump(data, pickle_file)", "def key_upload(self, key=None):\n raise NotImplementedError", "def put(uptoken, key, data, extra=None):\r\n fields = {\r\n }\r\n\r\n ...
[ "0.67822343", "0.66594857", "0.64644325", "0.6435055", "0.6350956", "0.6157565", "0.6139091", "0.6123082", "0.6119663", "0.60871285", "0.60520744", "0.59724325", "0.5944511", "0.5920651", "0.59184194", "0.5911955", "0.5910028", "0.58842486", "0.5879357", "0.5855878", "0.58557...
0.0
-1
The WF logger should not affect other loggers.
def test_logger(self): from workflow import engine logging.root.handlers = [] engine.LOG.handlers = [] other_logger = logging.getLogger('other') wf_logger = engine.get_logger('workflow.test') test_io = StringIO() root_io = StringIO() other_io = StringIO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logger(self):\n pass", "def logging(self):\r\n return None", "def _get_logger(self):", "def __init__(self):\n self.logger = logging.getLogger(FeatureEngineeringLogger.__name__)", "def _alter_logger(*args, **kwargs):\n\n # TODO: dress up root logger here under Celery\n # confi...
[ "0.75074375", "0.7398417", "0.73017997", "0.676276", "0.67371225", "0.6724812", "0.66514564", "0.6629838", "0.6603422", "0.65883774", "0.6566416", "0.656227", "0.6554883", "0.6518183", "0.64989567", "0.6482461", "0.64790404", "0.645304", "0.642595", "0.6422455", "0.641227", ...
0.6728836
5
Tries to log in the user given the credentials.
def __init__( self, username: str, password: str ) -> None: super().__init__(username, password)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login_user(self):\r\n self.client.login(username=self.user.username, password=\"password\")", "def login(self, **kwargs):\n\tusername = kwargs.get('username', self.username)\n\tif not username:\n\t raise RuntimeError, 'no username provided'\n\n\tpassword = kwargs.get('password', self.password)\n\ti...
[ "0.7679506", "0.76482505", "0.7451814", "0.7355336", "0.70666087", "0.7053605", "0.70083594", "0.70048815", "0.70040303", "0.69907624", "0.69900215", "0.6979392", "0.69255257", "0.6909606", "0.69065005", "0.68814677", "0.6881249", "0.68759793", "0.68714905", "0.68651444", "0....
0.0
-1
Retrieves a list of placed orders
def get_orders_list( self ) -> list: response = self.session.get("http://automationpractice.com/index.php?controller=history") self.HTMLParser.set_html(response.text) tbody = self.HTMLParser.find_elements_by_xpath("//tbody/tr") if not len(tbody): raise NoOrder...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_orders():", "def get_all_orders():\n response = requests.get(\n settings.SHOPIFY_ORDERS_URL,\n auth=(settings.SHOPIFY_API_KEY, settings.SHOPIFY_PASSWORD),\n )\n return response.json()[\"orders\"]", "def get_orders(self):\n return self.order_lst", "def orders(self):\n...
[ "0.8061578", "0.79425263", "0.78433585", "0.78185993", "0.7811087", "0.77156186", "0.7402565", "0.7319279", "0.7295969", "0.72657025", "0.7246338", "0.71543074", "0.70233506", "0.7015748", "0.7004499", "0.6945827", "0.69139475", "0.6882968", "0.6867857", "0.6842282", "0.68313...
0.7029751
12
Generates a `Datasets` object from a list.
def from_list(list_of_datasets): train, valid, test = None, None, None train = list_of_datasets[0] if len(list_of_datasets) > 3: print("There are more then 3 Datasets here...") return list_of_datasets if len(list_of_datasets) > 1: test = list_of_datase...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_dataset():\n num_list = 10\n return [generate_list() for _ in range(num_list)]", "def create(data):\n \n return Setlist(\n list_id = data['id'],\n name = data['name'],\n items = data['num_sets'])", "def CreateDataset(all_arrays):\n dataset = ...
[ "0.713642", "0.67912585", "0.6644632", "0.64633846", "0.6451107", "0.63641775", "0.60139936", "0.6010649", "0.5985657", "0.5928591", "0.59258014", "0.5889244", "0.5883013", "0.5867555", "0.58655316", "0.5801068", "0.57994795", "0.57927996", "0.57612014", "0.5750914", "0.57479...
0.76773876
0
Stack some datasets calling stack for each dataset.
def stack(*datasets_s): return Datasets.from_list( [ Dataset.stack(*[d[k] for d in datasets_s if d[k] is not None]) for k in range(3) ] )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stack(*datasets):\n return Dataset(\n data=vstack([d.data for d in datasets]),\n target=stack_or_concat([d.target for d in datasets]),\n sample_info=np.concatenate([d.sample_info for d in datasets]),\n info={\n k: [d.info.get(k, None) for d in d...
[ "0.74105006", "0.6224133", "0.61153567", "0.605392", "0.60062796", "0.5918449", "0.5896614", "0.5779996", "0.5749291", "0.5718587", "0.57030183", "0.56620634", "0.5621588", "0.5579488", "0.55665857", "0.55463654", "0.5545169", "0.552239", "0.552239", "0.54799163", "0.5455473"...
0.71461445
1
for save setting purposes, does not save the actual data
def setting(self): return { "num_examples": self.num_examples, "dim_data": self.dim_data, "dim_target": self.dim_target, "info": self.info, }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_data(self):\n pass", "def save_without_setting_canon(self, *args, **kwargs):\n super(DocumentSetFieldEntry, self).save(*args, **kwargs)", "def save(self, data):\n\t\tif self.value:\n\t\t\tdata['value'] = self.value", "def saveData(self):\n pass", "def save():\n pass", "...
[ "0.74729323", "0.73483574", "0.73252064", "0.7324794", "0.7164953", "0.71245915", "0.7028371", "0.70192415", "0.70192415", "0.70192415", "0.70192415", "0.70192415", "0.7014613", "0.6994", "0.6983602", "0.69741017", "0.69239044", "0.68728495", "0.6843766", "0.6839468", "0.6803...
0.0
-1
Return a standard feed dictionary for this dataset.
def create_supplier(self, x, y, other_feeds=None, name=None): if not other_feeds: other_feeds = {} # noinspection PyUnusedLocal def _supplier(step=None): """ :param step: unused, just for making it compatible with `HG` and `Saver` :return: the fe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feed_dict(self, dataset: Dataset, train: bool = False) -> FeedDict:\n return {}", "def make_feed_dict(self, data):\r\n raise NotImplementedError", "def make_feed_dict(data):\n raise NotImplemented()", "def get_feed_dict(self, contexts, endings, **kwargs):\n return {}", "def ...
[ "0.7395898", "0.7168172", "0.68816406", "0.6846803", "0.6486111", "0.6357085", "0.63534397", "0.6323259", "0.6295681", "0.6267062", "0.621977", "0.6208225", "0.6144665", "0.6024322", "0.601893", "0.59780514", "0.59629107", "0.5940235", "0.5908434", "0.5869132", "0.5869132", ...
0.0
-1
Assuming that the datasets have same structure, stacks data, targets and other info
def stack(*datasets): return Dataset( data=vstack([d.data for d in datasets]), target=stack_or_concat([d.target for d in datasets]), sample_info=np.concatenate([d.sample_info for d in datasets]), info={ k: [d.info.get(k, None) for d in datasets] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combine_stack_and_label(filesource_dataset_1,filesource_dataset_2,num_sample):\n\n x = filesource_dataset_1[0]\n x_utterances = len(filesource_dataset_1)\n for idx in tqdm(range(1, x_utterances)):\n x = np.hstack((x, filesource_dataset_1[idx]))\n #print(x.shape)\n y = filesource_datas...
[ "0.6439451", "0.63662523", "0.5770458", "0.57640004", "0.56014407", "0.5594226", "0.55866146", "0.5569384", "0.55502826", "0.5504315", "0.5489888", "0.5488856", "0.5467876", "0.5466481", "0.54472476", "0.54406786", "0.5429611", "0.5415711", "0.54056656", "0.54047024", "0.5401...
0.7734438
0
Generates and returns a single Datasets (possibly composed by training, validation and test sets) according to args and kwargs
def generate_datasets(self, rand=None, *args, **kwargs): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_datasets(self):\n\n degrade_test = False\n if self._opts['degrade_step'] == 'test':\n degrade_test = True\n\n use_trainset_for_tests = UseTrainForTest.IDENTICAL # can be different in few shot workflow\n\n train_dataset, test_dataset = self._gen_datasets_with_options(self._opts['tr...
[ "0.7621178", "0.69473433", "0.69207567", "0.68117255", "0.67662066", "0.67376935", "0.67357695", "0.66206133", "0.6593647", "0.6577879", "0.65543586", "0.6548655", "0.6536837", "0.64582735", "0.6456158", "0.6447764", "0.6381144", "0.6376832", "0.6368962", "0.63482434", "0.633...
0.68321073
3
Generates a batch of Datasets
def generate_batch(self, batch_size, rand=None, *args, **kwargs): return [ self.generate_datasets(rand, *args, **kwargs) for _ in range(batch_size) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batches(set_name):\n global num_batches, args, ds_sizes \n # num_batches = how many batches in each dataset(train, valid, test)\n # ds_sizes = dataset_sizes \n for b in range(num_batches[set_name]):\n bi = b * args.batch_size # one batch mul batch_size \n bj = (b + 1) * args.batch_siz...
[ "0.7514917", "0.7382531", "0.71878946", "0.70822203", "0.70486933", "0.69871813", "0.6983089", "0.68874186", "0.68354505", "0.6826487", "0.68052757", "0.67925185", "0.6784843", "0.6781102", "0.6780172", "0.67646056", "0.673245", "0.67176384", "0.67146957", "0.66864365", "0.66...
0.71700495
3
Class for managing windowed input data (like TIMIT).
def __init__(self, data, row_sentence_bounds, window=5, process_all=False): assert it is not None, "NEED PACKAGE INTERVALTREE!" self.window = window self.data = data base_shape = self.data.shape self.shape = (base_shape[0], (2 * self.window + 1) * base_shape[1]) self.tree...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_data(self, windowed_data):\n return", "def WindowData(d,twin,t0shift=None,object_history=False,instance=None):\n twcut=TimeWindow(twin)\n if(t0shift!=None):\n twcut.shift(t0shift)\n try:\n if(isinstance(d,TimeSeries)):\n if(d.dead()):\n # Functi...
[ "0.6172538", "0.5824715", "0.579524", "0.5777404", "0.5741833", "0.56970376", "0.5631466", "0.5602177", "0.555027", "0.55155164", "0.5480653", "0.5460816", "0.54408014", "0.53961843", "0.53608793", "0.53503096", "0.53198206", "0.5311485", "0.53044426", "0.52996355", "0.526758...
0.0
-1
Class for stochastic sampling of data points. It is most useful for feeding examples for the the training ops of `ReverseHG` or `ForwardHG`. Most notably, if the number of epochs is specified, the class takes track of the examples per minibatches which is important for the backward pass of `ReverseHG` method.
def __init__(self, dataset, batch_size, epochs=None, rnd=None): self.dataset = dataset self.batch_size = batch_size self.epochs = epochs self.T = int(np.ceil(dataset.num_examples / batch_size)) if self.epochs: self.T *= self.epochs self.rnd = get_rand_state(r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_samples(self, n_samples):", "def generate_samples(self, n_samples):", "def _sample_mini_dataset(dataset, num_classes, num_shots):\n shuffled = list(dataset)\n random.shuffle(shuffled)\n for class_idx, class_obj in enumerate(shuffled[:num_classes]):\n for sample in class_obj.sample(...
[ "0.65095025", "0.65095025", "0.62867826", "0.61317563", "0.61276025", "0.610246", "0.610246", "0.6065455", "0.6057883", "0.60466325", "0.60249513", "0.6012527", "0.5995907", "0.59938455", "0.59754515", "0.5971747", "0.59705216", "0.5960324", "0.5956033", "0.59375805", "0.5925...
0.5782709
40
Generates and stores example visiting scheme, as a numpy array of integers.
def generate_visiting_scheme(self): def all_indices_shuffled(): _res = list(range(self.dataset.num_examples)) self.rnd.shuffle(_res) return _res # noinspection PyUnusedLocal _tmp_ts = np.concatenate( [all_indices_shuffled() for _ in range(self.ep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def originalData(self): \n self.__exampleIndices = array(list(range(0, self.__numExamples)))", "def data_gen(size, p):\n #print(np.random.get_state()[1][0])\n random_table = np.random.binomial(size = size, p = p, n = 1)\n test_array = np.zeros((size, 2), dtype = int)\n for i in range(size):\n ...
[ "0.5792245", "0.57152265", "0.5646653", "0.56107265", "0.54559135", "0.53339714", "0.5332648", "0.53321683", "0.5320349", "0.5287736", "0.5264665", "0.5232722", "0.5185454", "0.5129824", "0.5108268", "0.50851935", "0.5042504", "0.5032581", "0.50246435", "0.50160766", "0.50070...
0.4968345
24
Tender Qualification Documents List
def collection_get(self): if self.request.params.get("all", ""): collection_data = [i.serialize("view") for i in self.context.documents] else: collection_data = sorted( dict([(i.id, i.serialize("view")) for i in self.context.documents]).values(), k...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def documents(pmid_23982599, civic_aid6_document):\n return [pmid_23982599, civic_aid6_document]", "def getDocuments(self):\n return self.objectValues('Multifile')", "def get_documents():\n documents = []\n for category in movie_reviews.categories():\n for fileid in movie_reviews.fileids...
[ "0.6024513", "0.58850753", "0.58229226", "0.57380384", "0.57273", "0.5612921", "0.56083256", "0.5542388", "0.55306774", "0.5491607", "0.546858", "0.54549557", "0.54500514", "0.5425209", "0.54043716", "0.53956443", "0.53795594", "0.53604776", "0.5360414", "0.53452253", "0.5339...
0.0
-1
Tender Qualification Document Upload
def collection_post(self): document = upload_file(self.request) document.author = self.request.authenticated_role self.context.documents.append(document) if save_tender(self.request): self.LOGGER.info( "Created tender qualification document {}".format(document...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put(self):\n document = upload_file(self.request)\n self.request.validated[\"qualification\"].documents.append(document)\n if save_tender(self.request):\n self.LOGGER.info(\n \"Updated tender qualification document {}\".format(self.request.context.id),\n ...
[ "0.7011324", "0.6625791", "0.6056341", "0.604441", "0.599105", "0.58514357", "0.58014864", "0.57448494", "0.5722403", "0.5647626", "0.5646104", "0.5611597", "0.55856794", "0.55776405", "0.5573368", "0.5542979", "0.55415756", "0.5528359", "0.55037415", "0.5495104", "0.54863006...
0.6640573
1
Tender Qualification Document Read
def get(self): if self.request.params.get("download"): return get_file(self.request) document = self.request.validated["document"] document_data = document.serialize("view") document_data["previousVersions"] = [ i.serialize("view") for i in self.request.validated[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_reader(qn_filepath, answers_dirpath):\n qns = get_questions(qn_filepath)\n for qn in qns:\n if qn.qid == 100:\n q = qn\n break\n assert q\n docs = get_documents(answers_dirpath, q.qid)\n print docs\n print docs[0].content", "def find_document(self):\n ...
[ "0.5713616", "0.55995387", "0.5426383", "0.5347822", "0.52830064", "0.52730966", "0.523003", "0.5208073", "0.5207551", "0.519923", "0.5193545", "0.5178876", "0.5173786", "0.5148251", "0.51301056", "0.5124473", "0.51232445", "0.5108244", "0.5097899", "0.5074501", "0.5055006", ...
0.0
-1
Tender Qualification Document Update
def put(self): document = upload_file(self.request) self.request.validated["qualification"].documents.append(document) if save_tender(self.request): self.LOGGER.info( "Updated tender qualification document {}".format(self.request.context.id), extra=con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_document(self):\n pass", "def edit_document():", "def patch(self):\n if apply_patch(self.request, src=self.request.context.serialize()):\n update_file_content_type(self.request)\n self.LOGGER.info(\n \"Updated tender qualification document {}\".form...
[ "0.65441775", "0.6009176", "0.6004787", "0.5918397", "0.5706653", "0.56903756", "0.56212336", "0.5521491", "0.550605", "0.5475452", "0.54754287", "0.54498464", "0.54302835", "0.53948754", "0.5377633", "0.53746945", "0.534313", "0.534106", "0.5327438", "0.5279192", "0.527067",...
0.6770321
0
Tender Qualification Document Update
def patch(self): if apply_patch(self.request, src=self.request.context.serialize()): update_file_content_type(self.request) self.LOGGER.info( "Updated tender qualification document {}".format(self.request.context.id), extra=context_unpack(self.request, {"M...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put(self):\n document = upload_file(self.request)\n self.request.validated[\"qualification\"].documents.append(document)\n if save_tender(self.request):\n self.LOGGER.info(\n \"Updated tender qualification document {}\".format(self.request.context.id),\n ...
[ "0.67698103", "0.65418416", "0.60076684", "0.5916366", "0.57062167", "0.5689535", "0.56196195", "0.5519839", "0.55059135", "0.54753315", "0.547409", "0.54489356", "0.5429259", "0.5393973", "0.5376314", "0.5374029", "0.53423685", "0.5339217", "0.5326033", "0.52789885", "0.5269...
0.6004739
3
Return _aware_ `datetime.now()` object in UTC timezone. This function must be used to insert or update `datetime` fields in the database, otherwise the validation `validate_utc` will reject the value.
def utcnow(): # From the Python documentation: # https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow # datetime.utcnow() # Return the current UTC date and time, with `tzinfo None`. # This is like `now()`, but returns the current UTC date and time, as a # naive `datetim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datetime_utc_now() -> datetime:\n return datetime.now(timezone.utc)", "def now_utc() -> datetime:\n return datetime.now(timezone.utc)", "def utc_now():\n return datetime.now(tz=timezone.utc)", "def get_utc_now():\n return datetime.datetime.utcnow().replace(tzinfo=pytz.timezone(\"UTC\"))", "...
[ "0.8656396", "0.8527489", "0.8506886", "0.8276427", "0.8191999", "0.815434", "0.801268", "0.7952559", "0.7899885", "0.78881174", "0.7862986", "0.7835481", "0.7827097", "0.775173", "0.765144", "0.7639328", "0.76259637", "0.7582488", "0.7496754", "0.74300855", "0.74300855", "...
0.73830366
23
Emulate legacy field superseeded by `patient_consent_date`. The `paitient_consent_date` field is the only source of truth.
def patient_consent(self): return 1 if self.patient_consent_date is not None else 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patient_consent(self, value):\n self.patient_consent_date = utcnow() if value else None", "def patient_consent_date(self, value):\n self._patient_consent_date = value\n self._patient_consent = 1 if value else 0", "def _read_patient_consent_date(self, d: dict):\n consent_date = d...
[ "0.68482417", "0.6833161", "0.67046666", "0.65385973", "0.5847413", "0.5256622", "0.5145824", "0.51359266", "0.5100234", "0.5099467", "0.49738032", "0.49723637", "0.49418914", "0.49067584", "0.49050087", "0.4872588", "0.48719132", "0.48694134", "0.4868018", "0.48641708", "0.4...
0.61643326
4
To use in Query expressions, define SQL expression separately.
def patient_consent(self): return self.patient_consent_date != None # noqa: E711
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _expression(self, expression):\n exp, values = _convert_expression(expression)\n if isinstance(exp, sqlalchemy.sql.expression.ClauseElement):\n return exp\n if exp is None:\n return sqlalchemy.sql.expression.literal(True)\n qbh = expr.QueryBuilderHelper(self.ta...
[ "0.6696251", "0.636851", "0.634157", "0.6295323", "0.62208486", "0.6195918", "0.603287", "0.6005952", "0.59504604", "0.59500873", "0.5903553", "0.58978915", "0.5895683", "0.58679605", "0.5867883", "0.5845525", "0.5841332", "0.5833717", "0.57903737", "0.5781723", "0.57561094",...
0.0
-1
Emulate legacy field superseeded by `patient_consent_date`. Forward to current datetime to `patient_consent_date` setter, which will set both underlying columns.
def patient_consent(self, value): self.patient_consent_date = utcnow() if value else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patient_consent_date(self, value):\n self._patient_consent_date = value\n self._patient_consent = 1 if value else 0", "def patient_consent_date(self):\n return self._patient_consent_date", "def set_to_date(self):\n self.set_value_into_input_field(self.set_to_date_locator, self.g...
[ "0.668064", "0.5796747", "0.57947594", "0.571031", "0.571031", "0.5642255", "0.5556245", "0.5523759", "0.55139166", "0.5509836", "0.55023223", "0.5477226", "0.5464905", "0.5369002", "0.5365053", "0.5335959", "0.53224725", "0.5223045", "0.5208461", "0.5204645", "0.51883584", ...
0.6615058
1
Get internal value for `patient_consent_date`.
def patient_consent_date(self): return self._patient_consent_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_patient_consent_date(self, d: dict):\n consent_date = d.get('patient_consent_date')\n consent_bool = d.get('patient_consent')\n if consent_date is not None:\n return self._str_to_datetime(consent_date)\n elif consent_bool:\n t0 = datetime.datetime.fromtim...
[ "0.8094495", "0.7589582", "0.7246536", "0.71703386", "0.6186469", "0.60771775", "0.582364", "0.582364", "0.582364", "0.582364", "0.5744298", "0.57036215", "0.5643021", "0.56060433", "0.56060433", "0.56060433", "0.56038517", "0.5568324", "0.5548201", "0.55249274", "0.5518372",...
0.8428358
0
Set consent for both legacy `patient_consent` and new `patient_consent_date`. If consent is given, set the `patient_consent_date` to the current datetime in UTC. (If the real date of consent is known, one should set `patient_consent_date` directly). If consent is revoked, set the `patient_consent_date` to None.
def patient_consent_date(self, value): self._patient_consent_date = value self._patient_consent = 1 if value else 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patient_consent(self, value):\n self.patient_consent_date = utcnow() if value else None", "def consent(self, consent):\n if consent is None:\n raise ValueError(\"Invalid value for `consent`, must not be `None`\") # noqa: E501\n\n self._consent = consent", "def patient_conse...
[ "0.73732257", "0.6368166", "0.6134412", "0.5915429", "0.58693725", "0.56939834", "0.5567969", "0.5020891", "0.5020535", "0.48919058", "0.4779866", "0.4765815", "0.47550648", "0.47453716", "0.47379932", "0.47163343", "0.46686274", "0.4600456", "0.45884106", "0.45701525", "0.45...
0.7228571
1
Read patient_consent information from dict serialization. For existing rows that did not record the actual consent date, if `patient_consent` is True, `ceation_date` is used if present, UNIX epoch 0 if it is missing.
def _read_patient_consent_date(self, d: dict): consent_date = d.get('patient_consent_date') consent_bool = d.get('patient_consent') if consent_date is not None: return self._str_to_datetime(consent_date) elif consent_bool: t0 = datetime.datetime.fromtimestamp(0, t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patient_consent(self):\n return 1 if self.patient_consent_date is not None else 0", "def patient_consent(self, value):\n self.patient_consent_date = utcnow() if value else None", "def patient_consent_date(self, value):\n self._patient_consent_date = value\n self._patient_consent...
[ "0.5926589", "0.5809377", "0.5732567", "0.56433344", "0.55838776", "0.5239948", "0.514208", "0.5133141", "0.4684602", "0.45138747", "0.44812942", "0.44552103", "0.44459537", "0.44308993", "0.44297066", "0.4419778", "0.43893576", "0.4386389", "0.43847585", "0.4346647", "0.4310...
0.73424447
0
Read transaction from dictionary
def read_dict(self, d: dict): self.transaction_id = d.get('transaction_id') self.study_id = d.get('study_id') self.patient_id = d.get('patient_id') self.name = d.get('name') birth_date = d.get('birth_date') self.birth_date = datetime.datetime.strptime( birth_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_transactions(self):\r\n\t\tlogger.debug(\"Enter\")\r\n\t\ttry:\r\n\t\t\twith open(self._state_file, 'rb') as tmp:\r\n\t\t\t\tlogger.debug(\"There is a file.\")\r\n\t\t\t\ttmp_dict = pickle.load(tmp)\r\n\t\t\t\tlogger.debug(\"Dictionary loaded from file: %s\" % tmp_dict)\r\n\t\texcept IOError as e: # File...
[ "0.62972873", "0.6246917", "0.608508", "0.5919277", "0.58387107", "0.5822863", "0.5689972", "0.5678795", "0.5596907", "0.5539039", "0.5362343", "0.535953", "0.5318176", "0.53046554", "0.52756685", "0.52726775", "0.525928", "0.5177265", "0.5176545", "0.51757026", "0.51573217",...
0.5942677
3
convert a DuReaderYesNo example into necessary features
def convert_example(example, tokenizer, label_list, max_seq_length=512, is_test=False): def _truncate_seqs(seqs, max_seq_length): # Account for [CLS], [SEP], [SEP] with "- 3" tokens_a, tokens_b = seqs max_seq_le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_example(example, tokenizer):\n\n feature = tokenizer(\n text=example['question'],\n text_pair=example['answer'],\n max_seq_len=args.max_seq_length)\n feature['labels'] = example['labels']\n feature['id'] = example['id']\n\n return feature", "def ParseYesNo(src):\n ...
[ "0.5797586", "0.57104677", "0.56959134", "0.56715715", "0.55233496", "0.5512573", "0.5502822", "0.5428499", "0.5363724", "0.5356651", "0.53244007", "0.5321539", "0.53180873", "0.5256663", "0.525582", "0.5243374", "0.52147835", "0.5206472", "0.5185587", "0.51831275", "0.517994...
0.0
-1
Prepare the mnist or fashionmnist data to feed to the model.
def get_data(dataset): if dataset not in possible_datasets: datasets_output = ', '.join(possible_datasets) raise ValueError('dataset must be one of: {}'.format(datasets_output)) if dataset == 'mnist': (clean_train, __), (clean_test, __) = mnist.load_data() elif dataset == '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _prepare_data(self):\n #TODO hardcoded values need to change\n print_info(\"Preprocessing the train data...\")\n self._place_dataset(os.path.join(self._hparams[\"temp-data\"], \"train\"),\n self.TRAIN_OUT_PATH)\n\n print_info(\"Preprocessing the test data.....
[ "0.71029925", "0.7001878", "0.68021387", "0.66606903", "0.6657912", "0.6647711", "0.65342814", "0.6513322", "0.6462048", "0.6341769", "0.63327867", "0.6331993", "0.63136804", "0.6295836", "0.6294832", "0.6288506", "0.6255097", "0.6247711", "0.62466383", "0.62195545", "0.62018...
0.0
-1
Trains a UNet to learn denoising by selfsupervision (noise2self). Uses matplotlib to display the results.
def train_model(clean_train, clean_test, noisy_test, num_batches=150, batch_size=32, show_loss_plot=False, verbose=False, seed=1337): if num_batches <= 0: raise ValueError('must have a positive number of batches') if batch_size <= 0: raise ValueError('must have a positive b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trainNet():", "def demo(image, model_class, do_add_noise=True):\n Log.enable_output = True\n Log.set_log_max_depth(8)\n\n image = normalise(image)\n image = numpy.expand_dims(image, axis=0)\n image = numpy.expand_dims(image, axis=0)\n noisy = add_noise(image) if do_add_noise else image\n ...
[ "0.6543201", "0.63936913", "0.61371124", "0.60957474", "0.603511", "0.6034276", "0.59679383", "0.58697367", "0.58606166", "0.58570796", "0.5854856", "0.58541954", "0.5833947", "0.5821031", "0.5809367", "0.5758914", "0.5753244", "0.5733578", "0.57328314", "0.56852037", "0.5683...
0.0
-1
Saves the weights of model to output_path.
def save_model_weights(model, output_path): output_dir = os.path.dirname(output_path) if output_dir and not os.path.exists(output_dir): os.makedirs(output_dir) model.save_weights(output_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_model_weights(self, filename):\n self.model.save_weights(filename)", "def save_model(self, file_name):\n\t\tself.model.save_weights(file_name)", "def save(self, filename):\n self.model.save_weights(filename)", "def save_model(self, model_filename):\n self.model.save_weights(mode...
[ "0.80955356", "0.7926381", "0.7886226", "0.7832939", "0.7832589", "0.77854276", "0.77565", "0.7726169", "0.77205503", "0.77095634", "0.7655661", "0.7647746", "0.76366", "0.75701165", "0.75657123", "0.75270814", "0.7525037", "0.7525037", "0.74478704", "0.7430976", "0.74265957"...
0.8475825
0
Generates a set of examples from the trained model.
def plot_examples(model, clean_test, noisy_test, num_examples=15, randomize=False, output_path=None): if num_examples <= 0: raise ValueError('must generate a positive number of examples') if randomize: indices = np.random.choice(clean_test.shape[0], num_examples) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_train_examples(self, data_path):\r\n return self.create_examples(self.read_data(data_path), 'train')", "def get_train_examples(self):\n raise NotImplementedError()", "def build_examples():\n build_models([\n \"VGG_16\",\n \"VGG_19\",\n \"RESNET_50\",\n \"MOB...
[ "0.6898566", "0.68552566", "0.68252814", "0.65360844", "0.6499116", "0.64343864", "0.64343864", "0.64343864", "0.64343864", "0.64343864", "0.64343864", "0.64343864", "0.64186585", "0.64186585", "0.64146006", "0.64114195", "0.64114195", "0.64114195", "0.64114195", "0.64114195", ...
0.0
-1
Initialize the GenericProcessing class.
def __init__(self): self.bpf_lcut = 10 self.bpf_hcut = 425 self.lpf_lcut = 5 self.lp_butter_order = 4 self.bp_butter_order = 2 self.data_rate = None self.process_time = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initialize(self):\n pass", "def _initialize(self):\n pass", "def _initialize(self):\n pass", "def initialize(cls):", "def __init__(self, *args, **kwargs):\n # count the cores available on the local machine\n self.tasks = mp.cpu_count()\n super(ParallelPreproce...
[ "0.6463012", "0.6463012", "0.6463012", "0.6433146", "0.6373256", "0.6362228", "0.63576984", "0.6353064", "0.6337008", "0.6281862", "0.6280358", "0.6260662", "0.6260662", "0.62492085", "0.6231807", "0.6200611", "0.6200611", "0.6200611", "0.6200611", "0.6200611", "0.6199629", ...
0.0
-1
Create a butter bandpass filter.
def _butter_bandpass(lowcut: float, highcut: float, fs: float, order: int = 5) -> tuple: nyq = 0.5 * fs low = lowcut / nyq high = highcut / nyq b, a = butter(order, [low, high], btype="band") return b, a
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def butter_filter(datalist):\n fs = 200.00\n fHigh = 50.00\n fLow = 5.00\n N=4\n [b,a]=sg.butter(N,[fLow/fs, fHigh/fs], btype='band')\n global filtered\n #IIR filter\n return sg.filtfilt(b,a,datalist)", "def butter_bandpass_filter(data, lowcut, highcut, fs, order=5, axis=0): \n o...
[ "0.7451614", "0.71119744", "0.70526403", "0.70473236", "0.701966", "0.6992632", "0.6988554", "0.6983021", "0.6854008", "0.67565495", "0.6697159", "0.6620907", "0.65991974", "0.6589245", "0.6563564", "0.6532885", "0.63735956", "0.6355377", "0.6267423", "0.6253552", "0.6224801"...
0.6940084
8
Create a butter lowpass filter.
def _butter_lowpass(lowcut, fs, order=4) -> tuple: nyq = 0.5 * fs low = lowcut / nyq b, a = butter(order, [low], btype="low") return b, a
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def butter_lowpass_filter(data, cutoff, fs, order=1):\n b, a = butter_lowpass(cutoff, fs, order=order)\n y = filtfilt(b, a, data)\n return y", "def butter_lowpass_filter(self, data: np.ndarray, lowcut: float, fs: float, order: int = 4) -> np.ndarray:\n b, a = self._butter_lowpass(lowcut, fs, orde...
[ "0.744177", "0.7354153", "0.7298044", "0.72915983", "0.72183937", "0.72033155", "0.7202647", "0.70877373", "0.7069501", "0.70666546", "0.702754", "0.7013197", "0.70112276", "0.7000103", "0.69962335", "0.69581854", "0.69211996", "0.66302556", "0.6578073", "0.65766674", "0.6520...
0.6737992
17
Apply a butter bandpass filter.
def _butter_bandpass_filter(self, data: np.ndarray, lowcut: float, highcut: float, fs: float, order: int = 5): b, a = self._butter_bandpass(lowcut, highcut, fs, order=order) y = lfilter(b, a, data) return y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def butter_bandpass_filter(data, lowcut, highcut, fs, order=5, axis=0): \n omega = 0.5 * fs\n low = lowcut / omega\n high = highcut / omega\n b, a = signal.butter(order, [low, high], btype='band')\n y = signal.lfilter(b, a, data, axis=0)\n return y", "def butter_filter(datalist):\n fs ...
[ "0.7581869", "0.75664645", "0.7475748", "0.74545556", "0.7397321", "0.73342526", "0.7259128", "0.7098314", "0.70211107", "0.6906156", "0.6815835", "0.66446453", "0.6626587", "0.66065145", "0.6584951", "0.65104455", "0.64792573", "0.6366289", "0.634029", "0.629268", "0.6233594...
0.7138827
7
Apply a butter lowpass filter.
def butter_lowpass_filter(self, data: np.ndarray, lowcut: float, fs: float, order: int = 4) -> np.ndarray: b, a = self._butter_lowpass(lowcut, fs, order=order) y = filtfilt(b, a, data) return y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def butter_lowpass_filter(data, cutoff, fs, order=1):\n b, a = butter_lowpass(cutoff, fs, order=order)\n y = filtfilt(b, a, data)\n return y", "def butter_bandpass_filter(data, lowcut, highcut, fs, order=1):\n b, a = butter_bandpass(lowcut, highcut, fs, order=order)\n y = filtfilt(b, a, data)\n ...
[ "0.77225924", "0.758474", "0.75541186", "0.74821657", "0.74796224", "0.74441874", "0.74429524", "0.7362974", "0.7348949", "0.7328772", "0.73254126", "0.7311591", "0.72724277", "0.71420956", "0.7005642", "0.6849895", "0.6796962", "0.6738573", "0.66404504", "0.660009", "0.65754...
0.7719998
1
Center the EMG data.
def center(emg_data: np.ndarray, center_value: float = None) -> np.ndarray: center_value = center_value if center_value else emg_data.mean(axis=1) emg_centered = np.copy(emg_data) for i in range(emg_data.shape[0]): emg_centered[i, :] = emg_data[i, :] - center_value[i] return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def centerAxis():\n dislin.center()", "def center(self):\n cp = self.dat.flowsheet.getCenter()\n self.centerOn(cp[0], cp[1])", "def GetCenter(self):\n ...", "def GetCenter(self):\n ...", "def GetCenter(self):\n ...", "def GetCenter(self):\n ...", "def center...
[ "0.715392", "0.7150732", "0.7057086", "0.7057086", "0.7057086", "0.7057086", "0.6961718", "0.6929149", "0.68829924", "0.6846377", "0.6817087", "0.67858565", "0.6771365", "0.6628032", "0.66244245", "0.6572838", "0.65496373", "0.65375334", "0.6534411", "0.6523956", "0.6498194",...
0.687216
9
Apply a calibration matrix to the data.
def calibration_matrix(self, data: np.ndarray, matrix: np.ndarray) -> np.ndarray: tic = time.time() data_cal = np.dot(matrix, data) self.process_time.append(time.time() - tic) return data_cal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, data):\n cal = self.calc()\n assert data.shape == cal.shape, \\\n \"data shape does not match calibration ({} != {})\".format(data.shape, cal.shape)\n return data * cal", "def _applyCalibration(self, ws, detPos):\n alg = self.createChildAlgorithm('ApplyCa...
[ "0.69434965", "0.62040365", "0.6035492", "0.5958941", "0.59398246", "0.5786696", "0.574981", "0.57194704", "0.55841017", "0.5576397", "0.55610746", "0.5532381", "0.5509009", "0.5477683", "0.5476905", "0.54610693", "0.5456806", "0.5437726", "0.5427076", "0.5380523", "0.5365716...
0.72663486
0
update the signal processing parameters.
def update_signal_processing_parameters(self, **kwargs): for key, value in kwargs.items(): if key in self.__dict__: self.__dict__[key] = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_parameters(self):\n # We update gamma, gamma0, lambda and nu in turn (Bottolo et al, 2011)\n self.update_gamma()\n self.update_gamma0()\n self.update_lambda()\n self.update_nu()\n if self.sample_xi:\n self.update_xi()", "def updateSignals(self):\n ...
[ "0.6584715", "0.6542431", "0.62621695", "0.6258087", "0.62553895", "0.62539536", "0.61550564", "0.6127215", "0.60999376", "0.60887265", "0.60854816", "0.6067803", "0.60374635", "0.6030319", "0.5960224", "0.5955644", "0.5927045", "0.5896254", "0.57902694", "0.57900864", "0.578...
0.79885525
0
Initialize the class for real time processing.
def __init__(self, data_rate: Union[int, float], processing_window: int = None): super().__init__() self.data_rate = data_rate self.processing_window = processing_window if processing_window else data_rate self.raw_data_buffer = [] self.processed_data_buffer = [] self._is...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(self):\n self._start = time.time()", "def initialize(self):\n self._startTime = time.time()", "def __init__(self):\n\t\tself._logger = None\n\t\tself._instanciate_logger()\n\t\tself._video_manager = VideoManager(self, self._logger)\n\t\tself._video_thread = None\n\t\tself._audio_ma...
[ "0.7711892", "0.76289284", "0.73504174", "0.7244866", "0.7172699", "0.71558505", "0.7131929", "0.7114648", "0.71031666", "0.71031666", "0.71031666", "0.71031666", "0.71031666", "0.71031666", "0.71031666", "0.71031666", "0.70616686", "0.70616686", "0.7052515", "0.7051719", "0....
0.0
-1
Process EMG data in realtime.
def process_emg( self, emg_data: np.ndarray, mvc_list: Union[list, tuple] = None, band_pass_filter=True, low_pass_filter=False, moving_average=True, centering=True, absolute_value=True, normalization=False, moving_average_window=200, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\r\n self.collect_data()", "def process():", "def run(self):\n while(not self.stop_event.is_set()):\n # read values until stop is sent\n response1 = _read_once(1,self.serial)\n response2 = _read_once(2,self.serial)\n #print(response)\n ...
[ "0.6334594", "0.62554085", "0.6160218", "0.6159584", "0.6151509", "0.6107726", "0.6082145", "0.5994185", "0.59724444", "0.59122896", "0.5894136", "0.5888195", "0.5872895", "0.58719957", "0.5846285", "0.5831141", "0.58255845", "0.58187026", "0.58187026", "0.57989854", "0.57989...
0.59569275
9