query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Replace all metrics at db_path database with given metrics.
def write_metrics(metrics, db_path): conn = sqlite3.connect(db_path) c = conn.cursor() c.execute('DELETE FROM metrics') for metric in metrics: c.execute( 'INSERT INTO metrics ' '(timestamp, callerid, uniqueid, channel, channel_extension, name) ' 'VALUES (datet...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sweep_metrics(db, redis):\n with db.scoped_session() as session:\n for key_byte in redis.scan_iter(f\"{metrics_prefix}:*\"):\n key = key_byte.decode(\"utf-8\")\n try:\n parsed_key = parse_metrics_key(key)\n\n if parsed_key is None:\n ...
[ "0.5845674", "0.5220226", "0.5203917", "0.5166553", "0.50838786", "0.5022165", "0.5001618", "0.49985954", "0.4985651", "0.48988444", "0.4873741", "0.48478916", "0.4826908", "0.4824466", "0.48123303", "0.478729", "0.47583172", "0.4758126", "0.4755123", "0.47328883", "0.4719424...
0.6584569
0
Load language codes from a text file (formatted one code per line).
def load_language_codes(self, path): try: fp = open(path, 'r+') languages = [line for line in fp.readlines()] fp.close except: print('Failed to read languages file.') return self.languages = languages
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_languages():\n _langs = []\n with open('conf/languages.csv') as f:\n for _line in f.readlines():\n _langs.append(_line[0:-1]) # chop line separetor\n return _langs", "def load(file):\n\n try:\n with open(file) as in_file:\n loaded_text = in_file.read().str...
[ "0.6678519", "0.6670529", "0.66319644", "0.6628408", "0.64730966", "0.64634216", "0.6428208", "0.6387204", "0.6367842", "0.6361939", "0.63237286", "0.6288881", "0.62744313", "0.62329173", "0.6204782", "0.61073744", "0.6105969", "0.6099445", "0.6097458", "0.60867435", "0.60649...
0.80213153
0
Start recording from microphone. Will create a audio folder to save the recorded files. The files will be removed in the deconstructor if specified.
def start_record_microphone(self): if not os.path.exists(self.audio_file_folder): os.makedirs(self.audio_file_folder) self.microphone_handler.start_recording() self.current_session.put(self.microphone_handler.current_session)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_recording(self) -> None:\n # Clear the internal ring buffer.\n self._buffer.fill(0)\n\n # Start recording using sounddevice's InputStream.\n self._stream.start()", "def startRecording(self):\n self.currentRecordingPath = osp.join(self._path, \"rec{}\".format(datetime.now().strftime(\...
[ "0.6864381", "0.6542735", "0.6452663", "0.64415556", "0.63910866", "0.63822365", "0.6315774", "0.6147192", "0.6142864", "0.6110098", "0.61068654", "0.6105196", "0.60924906", "0.60852736", "0.6046893", "0.5987551", "0.5829343", "0.57887673", "0.5748495", "0.57166266", "0.56982...
0.83186793
0
Recognize in "realtime" from microphone stream. Returns when a final_result is found. May be created as a thread of its own or it'll block until a final result is found. Stores all results in the `final_result_queue` queue.
def recognize_async_audio_stream(self, language_code = "en-US"): if language_code not in self.languages: print('\"{}\" is not a supported language code. Make sure it\'s supported by Google and try adding adding it to the languages list.\n'.format(language_code)) return sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_scan_results():\n global scan_results\n\n if scan_results.qsize() > 0:\n # Grab the latest detections from the scan result queue.\n _scan_data = scan_results.get()\n for _sonde in _scan_data:\n # Extract frequency & type info\n _freq = _sonde[0]\n ...
[ "0.594991", "0.55158603", "0.5419875", "0.53775895", "0.53278196", "0.5230119", "0.5219237", "0.51902354", "0.5108237", "0.5103713", "0.5072582", "0.5029477", "0.50256723", "0.49332643", "0.4841304", "0.48412868", "0.4832631", "0.48308972", "0.48290634", "0.48217666", "0.4821...
0.5795088
1
Clear all audio files from set audio folder.
def _clear_audio_files(self): try: shutil.rmtree(self.audio_file_folder) except: print('Failure to clear audio files in {self.audio_file_folder}')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_audio(self):\n self.audio_file = None\n self.audio_parser = None\n\n self.audio_box.delete(0, END)", "def del_all_sounds(self) -> None:\n self._sou_mut.acquire()\n self.sounds = []\n self._sou_mut.release()", "def clear_unique_audio(self):\n self.top_u...
[ "0.7448495", "0.725757", "0.69364864", "0.6593835", "0.6537063", "0.6532122", "0.64281666", "0.6222061", "0.6170422", "0.61377114", "0.6107297", "0.6081515", "0.60407835", "0.602291", "0.60197675", "0.6018821", "0.6017149", "0.59561014", "0.5953965", "0.59177667", "0.5908333"...
0.84234107
0
Deconstructor. Stop recording and remove all audio files if save_audio_file is False
def __del__(self): self.stop_record_microphone() if not self.save_audio_file: self.__clear_audio_files()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self):\n self.recording = False", "def stop_recording(self):\n\n\t\tself.eyetribe.stop_recording()\n\t\tself.recording = False", "def stop_recording(self):\n self.timer.stop()\n self.camera.release()", "def clear_audio(self):\n self.audio_file = None\n self.audio_p...
[ "0.7385467", "0.71610975", "0.7001163", "0.6910789", "0.69059503", "0.6885024", "0.68107265", "0.67693484", "0.66723984", "0.66365343", "0.6589764", "0.65625614", "0.65625614", "0.65625", "0.6546896", "0.64472544", "0.6439782", "0.64138484", "0.63804334", "0.6362698", "0.6360...
0.83778703
0
Returns True if the underlying Python implementation supports reference counts. By default returns True on CPython and False on other implementations.
def supports_refcounts(self): return sys.implementation.name == "cpython"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def should_check_refcount(self):\n raise NotImplementedError()", "def is_reference(self):\r\n return conf.lib.clang_isReference(self)", "def is_ref_known(self):\r\n \r\n if \"N\" in self.ref:\r\n return False\r\n else:\r\n return True", "de...
[ "0.6694613", "0.64877135", "0.5968084", "0.59278923", "0.58838886", "0.5856301", "0.5759541", "0.5711642", "0.5638685", "0.561117", "0.5540827", "0.54888123", "0.54594153", "0.5424932", "0.53919566", "0.5388228", "0.53780097", "0.5370651", "0.53458744", "0.53107476", "0.52835...
0.83088726
0
Returns True if `.make_module(...)` loads modules using a standard Python import mechanism (e.g. `importlib.import_module`). By default returns True because the base implementation of `.make_module(...)` uses an ordinary import. Subclasses that override `.make_module(...)` may also want to override this method.
def supports_ordinary_make_module_imports(self): return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _import_module(self, name):\r\n try:\r\n __import__(name)\r\n return True\r\n except ImportError:\r\n return False", "def module_exists(module_name):\r\n\r\n try:\r\n __import__(module_name)\r\n except ImportError:\r\n return False\r\n else:\r\n return True"...
[ "0.69765747", "0.62711734", "0.6188563", "0.60643166", "0.60354215", "0.59303135", "0.58254963", "0.5751506", "0.57471234", "0.57406646", "0.57375497", "0.5732517", "0.5702172", "0.5640123", "0.55381656", "0.5528344", "0.54463434", "0.5445118", "0.5415246", "0.53841436", "0.5...
0.70028394
0
Returns True is `sys.executable` is set to a value that allows a Python equivalent to the current Python to be launched via, e.g., `subprocess.run(...)`. By default returns `True` if sys.executable is set to a true value.
def supports_sys_executable(self): return bool(getattr(sys, "executable", None))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_executable(self, path):\n if (CGIHTTPServer.CGIHTTPRequestHandler.is_executable(self, path)):\n return True\n if self.is_python(path):\n return True\n return False", "def is_executable(self):\n raise NotImplementedError()", "def is_executable(exe):\n ...
[ "0.724905", "0.7072244", "0.696576", "0.6851299", "0.6745165", "0.673366", "0.6665809", "0.66335994", "0.65140986", "0.6503592", "0.6455242", "0.6436931", "0.64368147", "0.64276993", "0.63950956", "0.6367184", "0.63624126", "0.6326169", "0.63152367", "0.6296546", "0.6275547",...
0.8225362
0
Evaluates whether class_name arg is required.
def class_name_arg_required(args): no_class_name_flags = ['list_courses', 'version'] return not any( getattr(args, flag) for flag in no_class_name_flags )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_classname(self):\n return self.unpack_word(0x4A) > 0", "def has_name(self, name):\n\t\treturn name in self.classes", "def has_name(self, name):\n\t\t\treturn name in self.classes", "def arg_validation(arg, cla):\n if is_subclass(cla, arg):\n return arg\n else:\n print(str(a...
[ "0.6400709", "0.6342731", "0.6339716", "0.61991924", "0.6184195", "0.61398894", "0.612745", "0.60966754", "0.6070639", "0.6033716", "0.6033716", "0.5987926", "0.59845793", "0.5922803", "0.5875814", "0.5867898", "0.5858081", "0.58481956", "0.58042306", "0.57847935", "0.5729767...
0.7926551
0
Return true if aux heater.
def is_aux_heat_on(self): return self._device.mode == self._device.MODE_HEAT_EMERGENCY
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_aux_heat(self) -> bool | None:\n return self._aux", "def have_aux(self, aux):\n if aux > 1:\n return False\n return bool(self.aux_array[aux])", "def is_heating(self) -> bool:\r\n self._logger.debug(log_message_formatter(\r\n \"get\", f\"{self}\", \"is_he...
[ "0.76947564", "0.6923129", "0.6569298", "0.6203044", "0.6132852", "0.6127149", "0.6127149", "0.6124312", "0.6123953", "0.60975367", "0.60686123", "0.6053372", "0.6045562", "0.6043646", "0.5967009", "0.5949216", "0.59263605", "0.591608", "0.5908453", "0.58691466", "0.58664215"...
0.7088861
1
Return the minimum temp supported.
def min_temp(self): return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_temp(self):\n return GH_MIN_TEMP", "def min_temp(self):\n # return convert_temperature(\n # self._device.min_temp, TEMP_CELSIUS, self.hass.config.units.temperature_unit\n # )\n return self._device.min_temp", "def min_temp(self) -> float | None:\n try:\n ...
[ "0.8394551", "0.8300602", "0.82784355", "0.81939733", "0.81707907", "0.8158785", "0.80715275", "0.80542654", "0.80028504", "0.7921734", "0.7914891", "0.7601979", "0.73853564", "0.7366377", "0.72043335", "0.7152088", "0.7142063", "0.6978646", "0.6933368", "0.68290776", "0.6824...
0.8483248
0
Return the maximum temp supported.
def max_temp(self): return 99
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_temp(self):\n return GH_MAX_TEMP", "def max_temp(self):\n return self.atag.dhw_max_temp", "def max_temp(self):\n # return convert_temperature(\n # self._device.max_temp, TEMP_CELSIUS, self.hass.config.units.temperature_unit\n # )\n return self._device.max_t...
[ "0.85988975", "0.8459551", "0.8458674", "0.8438892", "0.83995616", "0.8327581", "0.82354313", "0.82110035", "0.8171325", "0.81500804", "0.8087402", "0.7873407", "0.7657547", "0.73928905", "0.736101", "0.73378927", "0.73006666", "0.7280445", "0.71801615", "0.7105498", "0.69483...
0.85153306
1
Return current operation ie. heat, cool, idle.
def current_operation(self): return self.state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_operation(self):\n return GH_STATE_TO_HA[self._boiler.mode]", "def current_operation(self):\n return self._current_operation", "def current_operation(self):\n return self._current_operation", "def op(self):\n return self.getop(self.pc)", "def get_current_temp():\n ...
[ "0.70378566", "0.6694591", "0.6694591", "0.630582", "0.6155733", "0.60350347", "0.6005294", "0.59024245", "0.58552396", "0.5848372", "0.5842126", "0.5837625", "0.5837625", "0.5809995", "0.57633054", "0.57550895", "0.56875247", "0.56804687", "0.56550026", "0.5635889", "0.56066...
0.70704013
0
Return the supported step of target temperature.
def target_temperature_step(self): return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_temperature_step(self):\n return self._target_temperature_step", "def target_temperature_step(self):\n return PRECISION_HALVES", "def target_temperature_step(self):\n return self._temp_step", "def target_temperature_step(self):\n return 1.0", "def target_temperature_s...
[ "0.8189019", "0.81128734", "0.80946547", "0.8089981", "0.7979902", "0.7927154", "0.6849858", "0.6578276", "0.65273863", "0.64725906", "0.6461905", "0.6428757", "0.64281154", "0.64281154", "0.64281154", "0.64281154", "0.64281154", "0.64281154", "0.64139754", "0.6406453", "0.63...
0.8378751
1
Turn auxiliary heater on.
def turn_aux_heat_on(self): self._device.set_mode(self._device.MODE_HEAT_EMERGENCY) self._device.set_fan(self._device.FAN_AUTO)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_on(self, **kwargs) -> None:\n self.heater.turn_on()", "async def async_turn_aux_heat_on(self) -> None:\n self._aux = True\n self.async_write_ha_state()", "async def async_turn_aux_heat_on(self) -> None:\n await self._set_aux_heat(True)", "def turn_eht_on(self):\n r...
[ "0.7368839", "0.70826113", "0.69153637", "0.67416835", "0.6621182", "0.64429104", "0.6307553", "0.6301728", "0.62406594", "0.6184429", "0.6157239", "0.61386925", "0.6135003", "0.6095669", "0.59194934", "0.5919046", "0.59163564", "0.59149635", "0.5905793", "0.59057003", "0.589...
0.75529635
0
Turn auxiliary heater off.
def turn_aux_heat_off(self): self.set_operation_mode(STATE_HEAT)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_off(self, **kwargs):\n self.heater.turn_off()", "async def async_turn_aux_heat_off(self) -> None:\n self._aux = False\n self.async_write_ha_state()", "async def async_turn_aux_heat_off(self) -> None:\n await self._set_aux_heat(False)", "def turn_off(self, **kwargs):\n ...
[ "0.80526996", "0.76573545", "0.76308346", "0.74327594", "0.73646945", "0.73432374", "0.71300316", "0.7116328", "0.7097027", "0.7096446", "0.70364875", "0.6925602", "0.6922313", "0.6920895", "0.69184977", "0.69173276", "0.68979925", "0.6868992", "0.6830244", "0.6825491", "0.67...
0.81797403
0
Set new target fan mode.
def set_fan_mode(self, fan): if fan == STATE_AUTO: self._device.set_fan(self._device.FAN_AUTO) elif fan == STATE_ON: self._device.set_fan(self._device.FAN_ON)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_fan_mode(self, value):\n return self.parent.controller.set_fan_auto_mode(value)", "def set_fan_mode(self, fan_mode):\n if self.preset_mode is not None:\n dps_mode = FAN_MODES[self.preset_mode][int(fan_mode)]\n self._device.set_property(PROPERTY_TO_DPS_ID[ATTR_FAN_MODE]...
[ "0.77543575", "0.77154255", "0.7704043", "0.7611645", "0.75783825", "0.7501574", "0.74044466", "0.7102789", "0.7077084", "0.70231044", "0.6946794", "0.6912525", "0.67700696", "0.67671233", "0.6766175", "0.67127615", "0.6685691", "0.66704637", "0.666543", "0.65710115", "0.6450...
0.78884286
0
Returns the order dates occurring after the given date.
def get_order_dates(after_date): query = BreadOrderDate.query \ .filter(BreadOrderDate.date > after_date) return query.all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def created_after(self, date: datetime):\n return self.created_search(date, search_type=\"after\")", "def get_orders(user, after_date):\n query = BreadOrder.query \\\n .join(BreadOrderDate) \\\n .filter(BreadOrderDate.date > after_date) \\\n ...
[ "0.6690432", "0.66709536", "0.6593582", "0.6334127", "0.6232244", "0.61097807", "0.59523326", "0.59302646", "0.55862546", "0.55558175", "0.54265267", "0.5295058", "0.5294429", "0.5230911", "0.5155955", "0.51256466", "0.50526714", "0.5031979", "0.4940905", "0.48972064", "0.488...
0.74311686
0
Returns all orders for the given user occurring after the given date.
def get_orders(user, after_date): query = BreadOrder.query \ .join(BreadOrderDate) \ .filter(BreadOrderDate.date > after_date) \ .filter(BreadOrder.user_id == user.id) return query.all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_orders_after(user, after_date):\n orders = get_orders(user, after_date)\n for order in orders:\n if not order.date.is_editable:\n continue\n\n db.session.delete(order)\n db.session.commit()", "def delete_orders_on(user, order_date):\n db.session.query(BreadOrder).f...
[ "0.6504066", "0.6298371", "0.6046048", "0.6007534", "0.5895099", "0.5835366", "0.5822354", "0.573862", "0.56804323", "0.5643923", "0.5528188", "0.541069", "0.53901976", "0.5329153", "0.5212839", "0.52013105", "0.511146", "0.5087422", "0.5087094", "0.50835943", "0.5066561", ...
0.7712927
0
Returns for all order dates the orders of a user after a given date.
def get_order_dates_extended(user, after_date): result = {} dates = get_order_dates(after_date) for order_date in dates: result[order_date.id] = { 'id': order_date.id, 'date': order_date.date, 'is_active': order_date.is_active, 'is_editable': order_dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_orders(user, after_date):\n query = BreadOrder.query \\\n .join(BreadOrderDate) \\\n .filter(BreadOrderDate.date > after_date) \\\n .filter(BreadOrder.user_id == user.id)\n return query.all()", "def delete_orders_after(user, after_date)...
[ "0.77232116", "0.68167335", "0.6672297", "0.63005346", "0.606067", "0.6038256", "0.5935129", "0.5814801", "0.5584606", "0.54903716", "0.5359059", "0.5341727", "0.53389436", "0.53043234", "0.5241291", "0.5236511", "0.51953983", "0.5183595", "0.51282895", "0.50871867", "0.50387...
0.6930348
1
Get all user orders for a certain week.
def get_week_order_detailed(date): query = sqla.text(""" SELECT "user".first_name, "user".last_name, "user".corridor, "user".room, bt.name FROM bread_order_date AS bod JOIN bread_order AS bo ON bod.id = bo.date_id JOIN "user" ON bo.user_id = "user".id JOIN bread_type bt ON bo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def active_users_by_week(self, *args, **kwargs):\r\n return self._get('ActiveUsersByWeek', *args, **kwargs)", "def _get_current_week_entries(today, user):\n some_day = today + timedelta(days=1)\n monday_of_week = some_day - timedelta(days=(some_day.isocalendar()[2] - 1))\n sunday_of_week = monday...
[ "0.6794961", "0.610897", "0.58860546", "0.58656365", "0.57017094", "0.556201", "0.5555283", "0.5547485", "0.55334604", "0.55261093", "0.5439671", "0.5391146", "0.5389302", "0.5352363", "0.53125507", "0.5310701", "0.53014195", "0.5235579", "0.518182", "0.5148425", "0.51228195"...
0.6163014
1
Get the totals for the order for a certain week.
def get_week_order_totals(date): query = sqla.text(""" SELECT bt.id, bt.name, COUNT(bod.id) FROM bread_order_date AS bod JOIN bread_order AS bo ON bod.id = bo.date_id JOIN bread_type AS bt ON bo.type_id = bt.id WHERE bod.id = :date GROUP BY(bt.id) ORDER BY bt....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weekly_sales(self):\n last_seven_day = timezone.now() - timedelta(days=7)\n items = self.item_set.filter(status=\"sold\", updated_at__gte=last_seven_day)\n total_sales = 0\n for item in items:\n total_sales += item.price\n return total_sales", "def record_week_to...
[ "0.671735", "0.6567604", "0.56304884", "0.56296754", "0.5566112", "0.5536691", "0.54982215", "0.54878277", "0.5478852", "0.5467533", "0.5415721", "0.5412257", "0.53888285", "0.53790116", "0.5362487", "0.5355686", "0.5354537", "0.53480005", "0.5345585", "0.5341043", "0.532573"...
0.7004543
0
Adds for a user all orders specified by items on the specified date.
def add_orders_on(user, order_date, items): for item in items: order = BreadOrder( user=user, date=order_date, type=item ) db.session.add(order) db.session.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_orders_after(user, after_date, items):\n order_dates = get_order_dates(after_date)\n for order_date in order_dates:\n if not order_date.is_editable:\n continue\n\n for item in items:\n order = BreadOrder(\n user=user,\n date=order_date...
[ "0.64885813", "0.60477334", "0.5902555", "0.5714113", "0.5591599", "0.5577957", "0.5573178", "0.55635285", "0.55043936", "0.550104", "0.54587626", "0.5455903", "0.54422605", "0.5419295", "0.5374167", "0.53661567", "0.5289393", "0.5268898", "0.5258385", "0.5245691", "0.5232831...
0.7813616
0
Adds for a user all orders specified by items on all editable order dates after the specified date.
def add_orders_after(user, after_date, items): order_dates = get_order_dates(after_date) for order_date in order_dates: if not order_date.is_editable: continue for item in items: order = BreadOrder( user=user, date=order_date, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_orders_on(user, order_date, items):\n for item in items:\n order = BreadOrder(\n user=user,\n date=order_date,\n type=item\n )\n db.session.add(order)\n db.session.commit()", "def delete_orders_after(user, after_date):\n orders = get_orders(u...
[ "0.73492813", "0.5984204", "0.58747023", "0.5734836", "0.55677503", "0.54063326", "0.53638977", "0.5353348", "0.52471495", "0.5240387", "0.52177525", "0.5187599", "0.5162581", "0.51615703", "0.5160983", "0.5107581", "0.5095315", "0.50205326", "0.50172764", "0.495434", "0.4954...
0.73001647
1
Deletes for a user all orders on the specified date.
def delete_orders_on(user, order_date): db.session.query(BreadOrder).filter( BreadOrder.user_id == user.id, BreadOrder.date_id == order_date.id ).delete() db.session.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_orders_after(user, after_date):\n orders = get_orders(user, after_date)\n for order in orders:\n if not order.date.is_editable:\n continue\n\n db.session.delete(order)\n db.session.commit()", "def delete_from_all(self, user_id):\n self.execute(TABELLE['id_users...
[ "0.6596298", "0.6228618", "0.60454804", "0.6013798", "0.5940475", "0.5878086", "0.58492404", "0.5834033", "0.5813426", "0.57673734", "0.56865627", "0.56613636", "0.56183326", "0.55881304", "0.5577194", "0.5541898", "0.552082", "0.55032426", "0.54790634", "0.546515", "0.545902...
0.7997255
0
Deletes for a user all editable orders after the specified date.
def delete_orders_after(user, after_date): orders = get_orders(user, after_date) for order in orders: if not order.date.is_editable: continue db.session.delete(order) db.session.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_orders_on(user, order_date):\n db.session.query(BreadOrder).filter(\n BreadOrder.user_id == user.id,\n BreadOrder.date_id == order_date.id\n ).delete()\n db.session.commit()", "def delete_by(self, user):\n if user.is_superuser or user is self.added_by:\n self.d...
[ "0.74101746", "0.6106769", "0.5800815", "0.5587028", "0.5399295", "0.536913", "0.5299772", "0.52960813", "0.52748525", "0.5258474", "0.5245245", "0.5239833", "0.5204094", "0.518908", "0.5170135", "0.5169726", "0.5152106", "0.51456004", "0.514263", "0.51398337", "0.5129763", ...
0.7749335
0
Failover a single volume. Attempts to failover a single volume
def failover(self, resource, failback): LOG.debug("VolumeReplication::failover %(vol)s", {'vol': resource['name']}) recovery_mgr = self.get_recovery_mgr() remote_recovery_mgr = self.get_remote_recovery_mgr() return self._failover_resource(resource, recovery_mgr, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _failover_volume(self, volume):\n session_name = self.get_session_name(volume.id)\n rsession_name = self.get_rep_name(session_name)\n tgt_ssn = self.target.search(\"replication/sessions\",\n name=rsession_name).hits[0]\n if tgt_ssn.state == 'in_sy...
[ "0.7545585", "0.6864211", "0.65233475", "0.6439261", "0.62867767", "0.6087894", "0.60655916", "0.598835", "0.5890224", "0.58235884", "0.5729079", "0.566327", "0.5612085", "0.55585", "0.54327637", "0.5403077", "0.5359634", "0.5359634", "0.5300808", "0.5295438", "0.52937394", ...
0.7365615
1
Filter exons down to those with this transcript_id
def get_exons_from_transcript(transcript_id): assert transcript_id in data.transcript_exons_dict, ( "Unknown transcript %s in a dict of size %s, " "with initial elements %s") % ( transcript_id, len(data.transcript_exons_dict), data....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transcripts(self):\n transcript_id_results = self.db.query(\n select_column_names=[\"transcript_id\"],\n filter_column=\"gene_id\",\n filter_value=self.id,\n feature=\"transcript\",\n distinct=False,\n required=False,\n )\n\n ...
[ "0.53031003", "0.5133001", "0.5067317", "0.49875292", "0.49182984", "0.49166745", "0.4906227", "0.47019175", "0.4675327", "0.4673099", "0.46373013", "0.46150535", "0.46059516", "0.45696685", "0.45468974", "0.45447296", "0.45431292", "0.4538499", "0.45030555", "0.45002553", "0...
0.6160362
0
Gets the strand of the gene
def get_strand(transcript_id): try: exons = data.transcript_exons_dict[transcript_id] except KeyError: exons = [] if len(exons) == 0: logging.warn("Transcript %s has no sequence information", transcript_id) return 1 strand = exons['seq_region_strand_gene'].iget(0) re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_strand(self, strand_type=0):\r\n if strand_type == 1:\r\n return [self._t_strand]\r\n elif strand_type == -1:\r\n return [self._c_strand]\r\n else:\r\n return [self._t_strand, self._c_strand]", "def get_gene(self):\n return self._gene", "def ...
[ "0.61120605", "0.6057128", "0.58764267", "0.5818933", "0.5807799", "0.57915604", "0.56998557", "0.5642735", "0.5628104", "0.56060183", "0.5573152", "0.5560653", "0.55012375", "0.5496069", "0.5491914", "0.5466453", "0.54546344", "0.543047", "0.53854805", "0.53841627", "0.53824...
0.7065026
0
Compute CDS start_phase checks the phase of the first exon
def get_cds_start_phase(transcript_id): start_exon = get_start_exon(transcript_id) if start_exon is not None: return max(start_exon['phase'], 0) # -1 means no phase (equiv. to zero) else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findphase(self):\n debug('ControllerStartup.findphase()')\n if not self.pidevice.HasFPH() or self.prop['skipfph']:\n return\n if not self._databuf['cstdone']:\n debug('no need to do find phase for axes %r', self.pidevice.axes)\n return\n for axis in ...
[ "0.6254601", "0.6188188", "0.60092074", "0.59241664", "0.59048", "0.5779793", "0.57711273", "0.5695318", "0.5664662", "0.56078416", "0.55819595", "0.55635923", "0.55579954", "0.5474911", "0.54740524", "0.5463541", "0.53268325", "0.532218", "0.52881694", "0.5232695", "0.521944...
0.69246334
0
Gets the index into to the transcript from genomic position The transcript is composed of spliced exons that have genomic start and stop positions. This function searches for the exon that matches this genomic positions and returns the index into the transcript
def get_transcript_index_from_pos( pos, transcript_id, skip_untranslated_region= True): exons = get_exons_from_transcript(transcript_id) exons = exons.sort(columns=['seq_region_start_exon', 'seq_region_end_exon']) exons['exon_length'] = \ exons['seq_region_end_exon'] - exons[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exon_finder(tstart,tend,strand,qstart,qend,qlen,qstartphase,qendphase,seqdict,seqname,\n max_offset = 30, is_start = False, is_stop = False, nevermind_atg = False,\n cluster = None,exon_number = None,log_file = open(os.devnull, 'w'),full_pseudoexon_search = True,\n ...
[ "0.61312586", "0.5909738", "0.58038855", "0.577881", "0.57526493", "0.5686632", "0.5641452", "0.5641086", "0.5626753", "0.55746794", "0.5572193", "0.5541233", "0.5502945", "0.5464883", "0.54620695", "0.54202497", "0.54034925", "0.5360994", "0.5359862", "0.5323605", "0.5267836...
0.72599494
0
Gets the length of the 5' UTR from a set of sorted exons from a specifc transcript
def get_five_prime_utr_length(exons_df, forward = True): exons_df = exons_df.sort( columns=['seq_region_start_exon', 'seq_region_end_exon'], ascending=[forward, forward]) utr_length = 0 for idx, row in exons_df.iterrows(): if row['exon_id'] == row['start_exon_id']: utr_le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_three_prime_utr_length(exons_df, forward = True):\n reverse = not forward\n exons_df = exons_df.sort(\n columns=['seq_region_start_exon', 'seq_region_end_exon'],\n ascending=[reverse, reverse])\n utr_length = 0\n for idx, row in exons_df.iterrows():\n exon_length = \\\n ...
[ "0.6372025", "0.6236813", "0.57597995", "0.5465409", "0.54068327", "0.53303796", "0.53132117", "0.5306646", "0.5248093", "0.52467096", "0.5242201", "0.5228347", "0.5175707", "0.5121189", "0.5111465", "0.51071066", "0.5077747", "0.5052281", "0.50477403", "0.5047369", "0.503945...
0.6805461
0
Gets the length of the 3' UTR from a set of sorted exons from a specifc transcript
def get_three_prime_utr_length(exons_df, forward = True): reverse = not forward exons_df = exons_df.sort( columns=['seq_region_start_exon', 'seq_region_end_exon'], ascending=[reverse, reverse]) utr_length = 0 for idx, row in exons_df.iterrows(): exon_length = \ row['s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_length_of_transcript(self):\n assert self.icd.get_length_of_transcript(\"ENST00000373656\") == 4441\n assert self.icd.get_length_of_transcript(\"ENST00000373654\") == 2045\n assert self.icd.get_length_of_transcript(\"ENST00000337451\") == 3225\n assert self.icd.get_length_o...
[ "0.6242588", "0.61335677", "0.58140635", "0.5782803", "0.56016964", "0.55927736", "0.54733914", "0.54527724", "0.53775424", "0.532487", "0.5255813", "0.5246936", "0.5216248", "0.52120525", "0.5202395", "0.518058", "0.5180099", "0.5179541", "0.5177161", "0.51765126", "0.516836...
0.68842435
0
Run a list of shell commands over ssh with streaming output.
def run_ssh_cmd_list(host, commands, work_dir=None, username=None, key_filename=None): if not isinstance(commands, list): raise TypeError("commands must be a list") ssh = ssh_conn.connect(host, username, key_filename) for command in commands: for line in run_ssh_cmd(ho...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_ssh(self, commands):\n identity_file = self.ssh_keys_private.get('root')\n conn = get_ssh_conn(self.ip_address, identity_file=identity_file)\n if type(commands) not in (tuple, list):\n commands = [commands]\n for command in commands:\n ret = conn.run(comman...
[ "0.7039808", "0.6970895", "0.66762155", "0.6642316", "0.66177666", "0.6582093", "0.649214", "0.64151233", "0.6377268", "0.635183", "0.6245391", "0.6198323", "0.6192879", "0.61801016", "0.6178061", "0.61522925", "0.6135693", "0.6123732", "0.61059946", "0.60725", "0.6053914", ...
0.72360903
0
This test if the input file is a GALEX one. Test if 'MPSTYPE' is in the header
def is_galex_file(filename): # not great but this is the structure of MJC images return "MPSTYPE" in pf.getheader(filename).keys()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _recordIsWGS(recordStr) :\n lines = recordStr.split(\"\\n\")\n WGS_lines = [x for x in lines if x.startswith(\"WGS \")]\n if len(WGS_lines) == 1 :\n return WGS_lines[0]\n elif len(WGS_lines) == 0 :\n return False\n else :\n raise Exception(\"Several lines starting with \\\"W...
[ "0.58990556", "0.5730011", "0.55675423", "0.5452754", "0.5441102", "0.53478986", "0.5322508", "0.5299167", "0.5273973", "0.52488774", "0.5184859", "0.51845783", "0.5174272", "0.51585376", "0.51557535", "0.51296693", "0.5126858", "0.5124353", "0.5095248", "0.50897354", "0.5078...
0.7457659
0
read the galexfilename and return the modified julian date
def which_obs_mjd(filename): if not is_galex_file(filename): return None h_ = pf.getheader(filename) return time.Time(h_["OBS-DATE"]+"T"+h_["TIME-OBS"]).mjd
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file_date(self, file: str) -> date:", "def filename2date(filename):\r\n # Find the '-SC' in the filename.\r\n dash = filename.find('-SC')\r\n if dash:\r\n return datetime.datetime.strptime(filename[dash-7:dash], '%Y%j')\r\n else:\r\n raise ValueError('Landsat filename does not c...
[ "0.6672442", "0.61509585", "0.60905635", "0.6054149", "0.6040897", "0.60151654", "0.60064864", "0.59618044", "0.5876771", "0.58724374", "0.5857471", "0.5853826", "0.5818432", "0.5813606", "0.579845", "0.57864815", "0.5781079", "0.57440233", "0.5735945", "0.5721786", "0.571470...
0.6175827
1
Provide the Sky file image or directly the skydata (a Galex Object) (in galex filename format they have the skybg label). This will set the sky that you can access using self.sky. The Variance will be updated except if derive_variance is False Returns Void
def set_sky(self, filename=None, skydata=None, set_background=True): # - set the sky if filename is not None: self._properties["sky"] = GALEX(filename, background=0, dataslice0=self._build_properties["datasli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sky_noise(sky_file_name):\n fits_file = fits.open(sky_file_name)\n image_data = fits_file[0].data\n return image_data", "def sky_direction(self, sky_direction):\n\n self._sky_direction = sky_direction", "def sky_noise_weighting(file_name, sky_file_name):\n cs_data = spectra_analysis(...
[ "0.60928065", "0.578779", "0.5555694", "0.5444651", "0.53089005", "0.5159947", "0.5091371", "0.5087312", "0.50514364", "0.5044712", "0.504005", "0.50343555", "0.50155896", "0.50088704", "0.4982444", "0.49684095", "0.49525052", "0.49501544", "0.48957065", "0.48747668", "0.4864...
0.73781073
0
convert the aperture output to a photopoints. Galex specialty with SkyBackground
def _aperture_to_photopoint_(self, *args, **kwargs): if not self.has_sky(): return super(GALEX,self)._aperture_to_photopoint_( *args, **kwargs ) datacps, bkgdcps = args datacounts = datacps[0]*self.exposuretime bkgdcounts = bkgdcps[0]*self.exposuretime # --...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def photometric_calibration():\n pass", "def aperture(self, LF, x, y, aperture, background):\n # Aperture only handle integers:\n x, y = int(x), int(y)\n \n # Grid for aperture:\n x_grid, y_grid = meshgrid(range(self.w), range(self.h))\n grid = LF[y_grid, x_grid] ...
[ "0.6226853", "0.6077142", "0.59765995", "0.5876677", "0.5875525", "0.5813534", "0.58005255", "0.5661772", "0.56423616", "0.5622386", "0.5547462", "0.5468652", "0.545882", "0.5425282", "0.53528494", "0.5321338", "0.5308009", "0.52537626", "0.52461475", "0.521397", "0.5197299",...
0.7217977
0
This method enables to test if the given target is inside the image. This is based on shapely. It assumes GALEX image is centered on header's ["RA_CENT","DEC_CENT"] and has a radius on 0.6 degree.
def is_target_in(self, newtarget, buffer_safe_width=0.025): from ..utils.shape import HAS_SHAPELY # Test if shapely if not HAS_SHAPELY: print("WARNING: could not test if the target is in the image since you do not have SHAPELY") return True from ..utils.shape impo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_target_in(self, newtarget):\n from .utils.shape import HAS_SHAPELY\n # Test if shapely\n if not HAS_SHAPELY:\n print(\"WARNING: could not test if the target is in the image since you do not have SHAPELY\")\n return True\n # Test if WCS \n if no...
[ "0.7443254", "0.65080625", "0.64137155", "0.6371993", "0.62973815", "0.62505233", "0.60123914", "0.5991162", "0.5983632", "0.5849504", "0.57902443", "0.5788115", "0.57695264", "0.5726789", "0.57195467", "0.5672507", "0.56426185", "0.56418616", "0.5640625", "0.55970126", "0.55...
0.7211606
1
Build the variance image based on the sky+data (=raw int data) assuming pure photon noise.
def _derive_variance_(self): # Pure Photon Noise self._properties["var"] = np.sqrt(self.rawdata*self.exposuretime) / self.exposuretime
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_noise_vector(self, ):\n self.noise.resize_(\n self.batch_size, int(self.opt.nz), 1, 1).normal_(0, 1)\n self.noisev = Variable(self.noise) # TODO: Add volatile=True???", "def sky_noise(sky_file_name):\n fits_file = fits.open(sky_file_name)\n image_data = fits_file[0].d...
[ "0.5916815", "0.59163624", "0.57328343", "0.57245326", "0.57148284", "0.554717", "0.5487892", "0.54494435", "0.5428189", "0.5418835", "0.5405877", "0.5379248", "0.5363848", "0.53507876", "0.5349415", "0.52914083", "0.5274741", "0.52279025", "0.5205424", "0.52042854", "0.52025...
0.69725055
0
Time ob the observation in Modified Julian Date
def mjd(self): return time.Time(self.header["OBS-DATE"]+"T"+self.header["TIME-OBS"]).mjd
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def observation_time(self):\n epoch = float(self._current_observation['observation_epoch'])\n return datetime.datetime.utcfromtimestamp(epoch)", "def astropy_time(self):\n mjd = self.meta[\"header\"][\"MJD-OBS\"]\n return Time(mjd, format=\"mjd\", scale=\"utc\")", "def get_obs_time(...
[ "0.68696547", "0.66930497", "0.6425908", "0.63795316", "0.6305538", "0.6305538", "0.6281383", "0.62758356", "0.62662214", "0.6228506", "0.6226281", "0.6217186", "0.6170964", "0.6062098", "0.6050688", "0.6016674", "0.59826255", "0.59775573", "0.5976624", "0.5976624", "0.597167...
0.69179696
0
Get bin band array Returns
def get_bin_band_arr(self): fn = self._lib['cwtObj_getBinBandArr'] fn.argtypes = [POINTER(OpaqueCWT)] fn.restype = c_void_p p = fn(self._obj) ret = np.frombuffer((c_int * self.num).from_address(p), np.int32).copy() return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bands(self):\n\t\treturn self._bands", "def get_bw(self):\n return np.array([b2 - b1 for b1, b2 in self.bands])", "def bands(self):\n return self._bands", "def bands(self):\n if self._bands is None:\n self._bands = self._compute_bands()\n return self._bands", "def...
[ "0.7323457", "0.7210665", "0.71613324", "0.7019341", "0.69408965", "0.69408965", "0.6845392", "0.68303627", "0.67676944", "0.6691256", "0.6624433", "0.6566932", "0.6541346", "0.653099", "0.64596087", "0.6428668", "0.63558996", "0.63092834", "0.63086855", "0.6301137", "0.62047...
0.8365239
0
Adds additional requirements to the specified route
def requires(self, requirements, **overrides): return self.where( requires=tuple(self.route.get("requires", ())) + tuple(requirements), **overrides )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def route(self, path, req = None, generate = False, **kwargs):\n req = req or []\n \n parts = re.findall(self._part_matcher, path)\n parts_info = []\n for part in xrange(len(parts)):\n part_pair = parts[part][1:-1].split('=')\n parts_info.append(part_pair)\n...
[ "0.63763857", "0.6134917", "0.61220527", "0.60940105", "0.59820646", "0.59187055", "0.59166145", "0.588752", "0.5876575", "0.5839459", "0.5758149", "0.5755899", "0.567481", "0.56658524", "0.5650119", "0.56331044", "0.55905086", "0.55835384", "0.55364466", "0.5515241", "0.5512...
0.6139525
1
Creates a new route, based on the current route, with the specified overrided values
def where(self, **overrides): route_data = self.route.copy() route_data.update(overrides) return self.__class__(**route_data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_route(self, ApiId: str, RouteKey: str, ApiKeyRequired: bool = None, AuthorizationScopes: List = None, AuthorizationType: str = None, AuthorizerId: str = None, ModelSelectionExpression: str = None, OperationName: str = None, RequestModels: Dict = None, RequestParameters: Dict = None, RouteResponseSelecti...
[ "0.59977794", "0.5966442", "0.59264976", "0.581103", "0.5780214", "0.5753689", "0.57180786", "0.57114714", "0.5695673", "0.56586045", "0.5641589", "0.56377846", "0.5624765", "0.56128556", "0.55734605", "0.5556788", "0.5528488", "0.5527467", "0.55215454", "0.5512925", "0.55078...
0.597044
1
Sets an output handler to be used when handler validation fails. Defaults to the output formatter set globally for the route.
def output_invalid(self, output_handler, **overrides): return self.where(output_invalid=output_handler, **overrides)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_parser(self, output_format):\n self.output_parser = output_parsers.get(output_format, lambda x:x)", "def error_handler(self, handler):\n if not self.opened():\n handler = handler or util.noop\n self._error_handler = enums.JLinkFunctions.LOG_PROTOTYPE(handler)\n ...
[ "0.5943797", "0.5760351", "0.57270694", "0.5677017", "0.5635059", "0.55716413", "0.55705833", "0.5543407", "0.5428283", "0.5267368", "0.523734", "0.52008134", "0.5157662", "0.51546496", "0.5125358", "0.51184434", "0.51164556", "0.51037216", "0.5070711", "0.5064805", "0.505607...
0.57774174
1
cleanUp files @ In, f, file name to remove @ Out, None
def cleanUp(self, f): os.system('rm ' + f)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup(e):\n for f in e.files:\n try:\n if os.path.isfile(f):\n os.remove(f)\n except OSError:\n continue\n\n return", "def clean_data():\n for clean_file in clean_files:\n file_list = [f for f in os.listdir(\".\") if f.endswith(clean_file)]...
[ "0.69972914", "0.69376886", "0.69052386", "0.69011456", "0.6894049", "0.67354214", "0.672942", "0.67154455", "0.665851", "0.6648177", "0.6598049", "0.6595607", "0.6564269", "0.65165615", "0.6514205", "0.6509929", "0.64999014", "0.64972", "0.6483571", "0.6482136", "0.64705414"...
0.7107007
0
Resursively merges two dictionaries by taking inputs from the 'incoming' dictionary and overlaying them upon the 'output' dictionary. By default, no values in the resulting dictionary will be overwritten if present in both. Passing 'overwrite=True' will flip this behavior. Useful for, eg, applying some userinputted con...
def merge(incoming={}, output={}, overwrite=False): _output = output.copy() for _key, _value in incoming.items(): # loop through each key/value pair if (_key in _output) and isinstance(_value, dict): # detect when we need to recurse _output[_key] = merge(_value, _output[_key]) # recurse else: # _key is not in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_dict(lhs, rhs, override=True):\n if not isinstance(lhs, dict) or not isinstance(rhs, dict):\n if override:\n return rhs\n else:\n return lhs\n\n for key, value in rhs.items():\n if key not in lhs:\n lhs[key] = rhs[key]\n else:\n ...
[ "0.6838846", "0.68018186", "0.67523575", "0.6739596", "0.6718958", "0.67066324", "0.67066324", "0.67066324", "0.67066324", "0.67066324", "0.67066324", "0.67066324", "0.67066324", "0.66906536", "0.66906536", "0.66906536", "0.66740364", "0.66367483", "0.6627979", "0.65935445", ...
0.83975714
0
Return the number of the variable of cell i, j and digit d, which is an integer in the range of 1 to 729 (including).
def v(i, j, d): return 81 * (i - 1) + 9 * (j - 1) + d
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dimacs2index(d):\n if (d==0):\n return 0\n \n if (d>0):\n return d*2\n \n return (-d*2)+1", "def number_at_cell(self, pokemon_locations, grid_size, index):\n if self.get_game()[index] != UNEXPOSED:\n return int(self.get_game()[index])\n\n number = 0\n ...
[ "0.60639495", "0.5979383", "0.593402", "0.5898673", "0.58909243", "0.58643603", "0.5799544", "0.5784447", "0.569355", "0.5680379", "0.5656239", "0.5655379", "0.5629365", "0.5606086", "0.55799335", "0.55412006", "0.55387247", "0.5532613", "0.5522061", "0.5518125", "0.551788", ...
0.6157497
0
Create the (11745) Sudoku clauses, and return them as a list. Note that these clauses are independent of the particular Sudoku puzzle at hand.
def sudoku_clauses(): res = [] # for all cells, ensure that the each cell: for i in range(1, 10): for j in range(1, 10): # denotes (at least) one of the 9 digits (1 clause) res.append([v(i, j, d) for d in range(1, 10)]) # does not denote two different digits at on...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_clauses(grid):\n clauses = sudoku_clauses()\n for i in range(1, 10):\n for j in range(1, 10):\n d = grid[i - 1][j - 1]\n # For each digit already known, a clause (with one literal).\n # Note:\n # We could also remove all variables for the known c...
[ "0.82263297", "0.7117114", "0.6189173", "0.6055822", "0.5908288", "0.5848483", "0.58449244", "0.57714117", "0.57692426", "0.5768563", "0.5760727", "0.57335", "0.57281685", "0.5648853", "0.5640726", "0.56395215", "0.56383276", "0.56327146", "0.5559708", "0.555621", "0.5509321"...
0.82548386
0
Getter functions for self.instCount
def getInstCount(self): return self.instCount
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_count(self):\r\n return self.count", "def instance_count(self) -> int:\n return pulumi.get(self, \"instance_count\")", "def get_count(self):\n\n\t\treturn self.__count", "def get_count(self):\n return self.count", "def get_count(self):\n return self.count", "def count(...
[ "0.74983805", "0.74895084", "0.7371488", "0.7281922", "0.7281922", "0.7179242", "0.7179242", "0.7176536", "0.71378154", "0.71378154", "0.71378154", "0.71378154", "0.7112398", "0.7112398", "0.7086168", "0.70848775", "0.70653", "0.69922805", "0.69922805", "0.69922805", "0.69922...
0.8543669
0
Counts elements in self.initializedVars
def countVars(self): return len(self.initializedVars["GF"]) + len(self.initializedVars["LF"]) + len(self.initializedVars["TF"])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nvar(self):\n return len(self.__vars)", "def num_vars(self):\n return self.nvars", "def num_vars(self):\n return self._nvars", "def nVariables(self):\n return len(self.variables)", "def __len__(self):\n return len(self._varvals)", "def num_vars(self):\n return le...
[ "0.7583782", "0.73578036", "0.73059124", "0.730424", "0.72504175", "0.7226319", "0.71847236", "0.7143713", "0.7117994", "0.70734596", "0.70419014", "0.69086456", "0.68017334", "0.6736395", "0.6713825", "0.66938335", "0.6676908", "0.6671336", "0.6651248", "0.6565309", "0.65283...
0.8265767
0
Increases object variable instCount by one
def incInstCount(self): self.instCount += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inc( self ):\n self.count += 1", "def inc(self):\n \n self.count += 1", "def add_count(self):\n self.count += 1", "def increment_counter(self) -> None:", "def __call__(self, *args):\n self.count = self.count + 1", "def increase_counter(self):\n self.values = ...
[ "0.7375624", "0.73026115", "0.7241178", "0.705652", "0.6959997", "0.6835161", "0.67993927", "0.67956275", "0.67229134", "0.6670973", "0.66645527", "0.6625823", "0.6555923", "0.65400124", "0.6538145", "0.6521101", "0.64911336", "0.6435699", "0.6407284", "0.6397002", "0.6397002...
0.8214018
0
Appends the type to the end of list printOrder in order to set the printing order of collected statistics
def addPrintOrder(self, type): self.printOrder.append(type)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_type_display_info(ctx):\n ctx.meta.type_display_name = ctx.ext.type_display_name = \"Simulation\"\n ctx.ext.type_sortkey = ctx.meta.type_sortkey = \"AC\"", "def report_UI_order_type_by_amount(account):\n\t_type = read_type()\n\tordered_index_list = report_order_type_by_amount(account)\n\tprint_tra...
[ "0.5944693", "0.5835607", "0.5381578", "0.5277533", "0.52741635", "0.5268416", "0.5250476", "0.5239199", "0.52249575", "0.52156824", "0.5197943", "0.51954496", "0.5184331", "0.516708", "0.51661843", "0.51653135", "0.51397425", "0.5138327", "0.5125689", "0.5111765", "0.5108812...
0.79406404
0
Sets the filename for the file to which will be printed the statistics
def setStatiFile(self, filename): self.statiFile = filename
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_filename(self, file_name):", "def set_filename(self, filename):\n self._filename = filename", "def set_filename(self, name):\n self.ds_filename = name", "def setFile(self, filename):\n self.prepare() #new call on each new file to process\n self.filename = \"%s\" % filenam...
[ "0.7665443", "0.72758263", "0.70887", "0.7041098", "0.70124847", "0.69447875", "0.6870846", "0.6858597", "0.6858597", "0.67914844", "0.66966647", "0.66905713", "0.6653697", "0.6594859", "0.65187293", "0.6470785", "0.6470785", "0.6456862", "0.6395369", "0.63946843", "0.6385707...
0.73965615
1
If printing of results is set, that means statiFile is set and printOrder is not empty, prints the corresponding statistic for each element in printOrder on ints own line to the statiFile
def printResults(self): if self.statiFile and len(self.printOrder) > 0: try: file = open(abspath(self.statiFile), "w") except Exception as e: raise ErrorOutput(e) else: for stat in self.printOrder: if stat ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _print_stat(self):\n if 0 < self.print_stats_interval < time.monotonic() - self.last_stat_print_time:\n if self._file_paths:\n self._log_file_processing_stats(self._file_paths)\n self.last_stat_print_time = time.monotonic()", "def __printResults(files, expected, ac...
[ "0.6038745", "0.5973759", "0.5897784", "0.58778536", "0.58371174", "0.5823361", "0.5798243", "0.5787909", "0.5711568", "0.5659267", "0.5655596", "0.5631612", "0.5616595", "0.5616024", "0.5592938", "0.5566923", "0.5507349", "0.550545", "0.5495603", "0.5489762", "0.54727405", ...
0.77772677
0
Gives user a choice on how to write a release note
def select_input(cls): #Change current working directory to root sdk directory Utility.pushd(Settings.rootSdkPath) print('Would you like to insert release notes?') print('0) Cancel') print('1) Insert directly from command line') print('2) Insert from a file') cls...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_input(cls):\n print('Would you like to insert release notes?')\n print('0) Cancel')\n print('1) Insert directly from command line')\n print('2) Insert from a file')\n\n inputValue = 0\n inputNote = False\n try:\n try: input = raw_input\n ...
[ "0.74380577", "0.6731308", "0.6731308", "0.6720483", "0.6429505", "0.6398019", "0.63253635", "0.62014854", "0.6157431", "0.6125236", "0.6102147", "0.6084187", "0.59821856", "0.5821075", "0.5782732", "0.5755479", "0.5750794", "0.5741082", "0.5711053", "0.5698787", "0.56906605"...
0.74510175
0
Sets the version of the release note.
def set_note_version(cls, version): #Change current working directory to root sdk directory Utility.pushd(Settings.rootSdkPath) cls.init() notes_file = 'releases.txt' note = cls.get_note(notes_file) if note is not False: new_note = '---------------------------...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_note_version_server(cls):\n #Change current working directory to root sdk directory\n Utility.pushd(Settings.rootSdkPath)\n cls.init()\n notes_file = 'releases.txt'\n #Get the list of WebRtc nuget pakcages with prereleases\n packages = NugetUtility.nuget_cli('list'...
[ "0.75254875", "0.71338254", "0.71338254", "0.71295744", "0.71182066", "0.71182066", "0.7011091", "0.69824946", "0.69824946", "0.69824946", "0.69824946", "0.69824946", "0.69824946", "0.69824946", "0.69824946", "0.69824946", "0.69824946", "0.69824946", "0.69824946", "0.69824946",...
0.82689625
0
Sets the version of the release notes by getting the latest published version of the nuget package published on nuget.org
def set_note_version_server(cls): #Change current working directory to root sdk directory Utility.pushd(Settings.rootSdkPath) cls.init() notes_file = 'releases.txt' #Get the list of WebRtc nuget pakcages with prereleases packages = NugetUtility.nuget_cli('list', 'Id:WebRt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_note_version(cls, version):\n #Change current working directory to root sdk directory\n Utility.pushd(Settings.rootSdkPath)\n cls.init()\n notes_file = 'releases.txt'\n note = cls.get_note(notes_file)\n if note is not False:\n new_note = '---------------...
[ "0.67604005", "0.6222197", "0.61799574", "0.60360354", "0.6015257", "0.6007244", "0.5977356", "0.59345585", "0.5932159", "0.58947605", "0.58781916", "0.58720636", "0.5864117", "0.58472973", "0.5812655", "0.5808144", "0.58045864", "0.57688725", "0.5748452", "0.5735289", "0.571...
0.7095096
0
The Constructor for DeviceOverview class
def __init__(self): self.postgres = PostgreSQL() self.couch_query = Queries() self.unit_conversion = UnitConversion() self.calc = calculate_alarm_trigger.CalculateAlarmTrigger() super(DeviceOverview, self).__init__()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self._device_info = None", "def __init__(self, host_info):\n # A group name to group map. It represents the device tree.\n self._groups = self._BuildGroupTrees(host_info.device_infos)\n\n # Build device indexes for faster lookup.\n self._device_serial_index = {}\n self...
[ "0.6939952", "0.6568764", "0.656316", "0.64530003", "0.6436921", "0.6410925", "0.6292047", "0.62895685", "0.62615865", "0.6206294", "0.61885124", "0.6132955", "0.60998017", "0.6062122", "0.6052197", "0.6038447", "0.60260296", "0.60253656", "0.6022354", "0.6017149", "0.5990975...
0.66813296
1
Return Alarm Type Name
def get_alarm_type_name(self, a_types, alarm_type_id): for a_type in a_types['rows']: if a_type['alarm_type_id'] == alarm_type_id: return a_type['alarm_type'] return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def getAlarmType(self):\n alarm_type = await self.director.getItemVariableValue(\n self.item_id, \"ALARM_TYPE\"\n )\n return alarm_type", "def name(self):\n if self._name is not None:\n return self._name\n else:\n return 'Alarm {}'.format(...
[ "0.7551388", "0.72026294", "0.6533667", "0.65263534", "0.6288887", "0.6223079", "0.6180779", "0.61572564", "0.61311376", "0.61032224", "0.61011165", "0.60785073", "0.60701215", "0.5960966", "0.59591615", "0.59361124", "0.5908214", "0.5907246", "0.58928883", "0.58928883", "0.5...
0.7403625
1
Return recommended articles for the last reported_days. I am using 6 days instead of 7 as I am running this on Sunday evening, and want to avoid having Sunday shares twice. This means losing shares between generating this and midnight, which I am fine with.
def get_pocket_recommendations(today, recommended_days=6): with urlopen(f"https://www.getpocket.com/@{POCKET_USERNAME}") as res: html = res.read() items = parse(html, today=today) news = filter( lambda i: i["pocket_recommended_at"] >= (today - timedelta(days=recommended_days)), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def return_weekly_figure():\n today = datetime.datetime.now()\n\n while 1:\n try:\n today_str = str(today.day) + \"/\" + \"{:02d}\".format(today.month) + \"/\" + str(today.year)\n match = covid_table.find(date=today_str)\n match.next()\n running_total = 0\n ...
[ "0.5721997", "0.5507149", "0.5429172", "0.53451663", "0.52912694", "0.5271458", "0.52540535", "0.521411", "0.51095176", "0.510495", "0.510443", "0.5077328", "0.5057652", "0.50531375", "0.50506955", "0.5032643", "0.5028306", "0.5024792", "0.4991454", "0.4990828", "0.49899375",...
0.6133708
0
This method is called at deinitialization time
def deinit(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deinit(self) -> None:", "def deinit(self) -> None:", "def deinit(self) -> None:", "def deinit(self) -> None:", "def deinit(self) -> None:", "def deinit(self) -> None:", "def deinit(self) -> None:", "def deinit(self) -> None:", "def deinit(self) -> None:", "def deinit(self) -> None:", "def d...
[ "0.8598001", "0.8598001", "0.8598001", "0.8598001", "0.8598001", "0.8598001", "0.8598001", "0.8598001", "0.8598001", "0.8598001", "0.8460669", "0.8460669", "0.80290407", "0.78885597", "0.78108764", "0.7737444", "0.7614071", "0.7612964", "0.7602854", "0.7587629", "0.75617516",...
0.8913745
1
Calculate the average unix timestamp of the dates listed on the scrape site.
def calc_average_header_date(headers): dates = [] for header in headers: if (len(header) < 8) or (header == 'Featured results'): continue datestring = header[12:] for suffix in ['nd', 'th', 'st', 'rd']: datestring = datestring.replace(suffix, '') datestring = datestring.split(' ') datestring[0] = da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_days(self):\n tweet_time = self.data['created_at']\n birthday = self.data['user']['created_at']\n my_dates = {\"Jan\": 1, \"Feb\": 2, \"Mar\": 3, \"Apr\": 4, \"May\": 5, \"Jun\": 6, \"Jul\": 7, \"Aug\": 8, \"Sep\": 9, \"Oct\": 10,\n \"Nov\": 11, \"Dec\": 12}\n ...
[ "0.58995616", "0.57395095", "0.5650304", "0.56124854", "0.55932623", "0.5557954", "0.54724747", "0.5452723", "0.54171383", "0.5389988", "0.5371114", "0.5368981", "0.5311149", "0.5311055", "0.5288435", "0.5269931", "0.5265094", "0.5186183", "0.5150468", "0.5133779", "0.5133453...
0.58043
1
Produce a `dataclass` definition from a dataclass.
def dataclass_to_code(dataclass_class): return ( '\n'.join(dataclass_to_code(field.type) for field in fields(dataclass_class) if is_dataclass(field.type)) + '\n\n\n' + ( f'@dataclass\n' f'class {to_pascal_case(string=dataclass_class.__name__)}:\n ' + ('\n ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataclass(\n _cls: Optional[Type[Any]] = None,\n *,\n init: bool = True,\n repr: bool = True,\n eq: bool = True,\n order: bool = False,\n unsafe_hash: bool = False,\n frozen: bool = False,\n config: Type[Any] = None,\n) -> Union[Callable[[Type[Any]], Type['Dataclass']], Type['Datacla...
[ "0.652969", "0.6445493", "0.632194", "0.62454677", "0.6139272", "0.6109452", "0.6001632", "0.59889734", "0.58956873", "0.57826865", "0.5775612", "0.5769696", "0.5767425", "0.5764401", "0.5688271", "0.56422716", "0.56155276", "0.5607213", "0.5554984", "0.5533345", "0.551647", ...
0.6892556
0
This function creates a .dot file for the tree.
def make_dot(self, filename): if self.empty(): print("Could not make .dot: Tree empty") return False # Create an empty string for content content = "" node = self.root # If the root has no children, just print the root. No need for recursive funct...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_tree(tree, out_file='tree'):\n activities = [\n 'Working at Computer',\n 'Standing Up, Walking and Going up/down stairs',\n 'Standing',\n 'Walking',\n 'Going Up/Down Stairs',\n 'Walking and Talking with Someone',\n 'Talking while Standing',\n ]\n ...
[ "0.7896652", "0.7797851", "0.744462", "0.72557825", "0.71405995", "0.71195614", "0.7031951", "0.6995596", "0.69474155", "0.69270176", "0.6911275", "0.6873891", "0.6854127", "0.6845402", "0.6816289", "0.68155164", "0.678192", "0.6745415", "0.67137474", "0.6693931", "0.66671795...
0.83867884
0
This function deletes an object from the tree, by given value
def delete(self, value): # Return false if tree was empty if self.empty(): return False # Find the node containing the value node = self.descend_to_node(value) # If that node is 'False', value wasn't found. Give error and return False. if not node: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, value):\n if self.root is not None: # else do nothing\n if type(value) == self.typing: # else do nothing\n hasValue, self.root = self.root.contains(value)\n if hasValue: # always deletes root\n self.root = self.root.delete(value) \...
[ "0.7702509", "0.7215008", "0.71773833", "0.7080104", "0.7010075", "0.69701546", "0.6930795", "0.6927558", "0.69181937", "0.6910495", "0.68863404", "0.68515617", "0.68298906", "0.67415583", "0.66335505", "0.6627322", "0.66115963", "0.6592418", "0.6568001", "0.6532205", "0.6504...
0.733811
1
navigate to the tool's contribtool status page
def goto_tool_status_page(self,toolname): po = self.catalog.load_pageobject('ToolsPipelinePage') po.goto_page() po.search_for(toolname) row = None for row in po.search_result_rows(): if row.value()['alias'] == toolname: row.goto_title() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_edit_tool_page(self):\n\n\n username,userpass = self.testdata.find_account_for('toolsubmitter')\n\n self.utils.account.login_as(username,userpass)\n\n self.contribtool.edit_tool_page(TOOLNAME,TOOLPAGEDATA)", "def push_admin_install_button(self,toolname):\n\n self.logger.info(...
[ "0.63567054", "0.61022305", "0.60764843", "0.5951557", "0.5843187", "0.5806375", "0.5792652", "0.5780985", "0.5775576", "0.57718843", "0.56891847", "0.5653211", "0.5631639", "0.55895007", "0.55754393", "0.54906696", "0.54760593", "0.54336363", "0.5405475", "0.53862965", "0.53...
0.7049316
0
take a tool from its current state to the provided state using the provided tooldata, source code, admin and user account information
def plan(self,end_state,toolname,tooldata,codedata,adminuser,adminpass,username,userpass): states = { 'none' : { 'fxn' : None, 'args' : None, 'next' : 'created', }, 'created' : ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_tool(shell,tool_name,tool_revision,invoke_script,\n test_program_name,test_program_script):\n\n # check that the user is in the apps group\n groups,es = shell.execute(\"echo ${USER} | groups\")\n if \"apps\" not in groups.split():\n # user not in the apps group, bail\n ...
[ "0.6056211", "0.6015082", "0.5987138", "0.585159", "0.58423823", "0.58101577", "0.58068806", "0.5806698", "0.57445574", "0.568744", "0.5590154", "0.5559933", "0.55521214", "0.54849136", "0.54834324", "0.54675484", "0.54605335", "0.5434643", "0.5422761", "0.5422142", "0.537061...
0.6923907
0
register a tool as the tool submitter
def register(self,toolname,data): self.logger.info("registering the tool '%s'" % (toolname)) po = self.catalog.load_pageobject('ToolsCreatePage') po.goto_page() # fill in and submit the tool create page po.populate_form(data) po.submit_form() # upon successful...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_tool(cls, tool_name: str, reset_function):\n if tool_name in cls.TOOLS:\n raise PedalToolAlreadyRegistered(tool_name)\n cls.TOOLS[tool_name] = ToolRegistration(tool_name, reset_function)", "def test_register(self):\n\n username,userpass = self.testdata.find_account_fo...
[ "0.7262106", "0.66165143", "0.64236194", "0.63198465", "0.6250626", "0.60379976", "0.6003419", "0.59883887", "0.59739554", "0.59678423", "0.5930928", "0.5884086", "0.5860106", "0.58415836", "0.57634485", "0.5703402", "0.56915855", "0.5658544", "0.56330544", "0.558427", "0.556...
0.6823326
1
upload source code into the source code repository data is a dictionary that links files on the local file system to a path relative to the checked out svn repository.
def upload(self,toolname,data,username,userpass): msg = 'initial upload of source code' self.upload_code(toolname,data,username,userpass,msg) # navigate to the tool status page po = self.catalog.load_pageobject('ToolsStatusCreatedPage',toolname) po.goto_page() # on web...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload_code(self,toolname,data,username,userpass,msg):\n\n self.logger.info(\"uploading source code for the tool '%s'\" \\\n % (toolname))\n\n repo_url = self.repo_url_template % { 'hubname' : self.hubname,\n 'toolname' : toolname }\n\n ...
[ "0.6933262", "0.592655", "0.5604634", "0.55619216", "0.5526222", "0.5456796", "0.54087913", "0.5408748", "0.536536", "0.53190345", "0.53140426", "0.5312297", "0.53031754", "0.5292487", "0.52889246", "0.52793133", "0.5275736", "0.5262428", "0.52437335", "0.52431786", "0.523945...
0.62057894
1
upload source code into the source code repository data is a dictionary that links files on the local file system to a path relative to the checked out svn repository.
def upload_code(self,toolname,data,username,userpass,msg): self.logger.info("uploading source code for the tool '%s'" \ % (toolname)) repo_url = self.repo_url_template % { 'hubname' : self.hubname, 'toolname' : toolname } # ssh into a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload(self,toolname,data,username,userpass):\n\n msg = 'initial upload of source code'\n self.upload_code(toolname,data,username,userpass,msg)\n\n # navigate to the tool status page\n po = self.catalog.load_pageobject('ToolsStatusCreatedPage',toolname)\n po.goto_page()\n\n ...
[ "0.62064403", "0.59280926", "0.5604659", "0.5561223", "0.55266905", "0.5455504", "0.540945", "0.5408918", "0.5363032", "0.5316633", "0.531322", "0.53114104", "0.5304255", "0.52912986", "0.5287321", "0.5279404", "0.52734447", "0.5261573", "0.52421576", "0.5242105", "0.5239274"...
0.6935297
0
update the svn repository with a change so the tool can be installed in this case we update the invoke script because all tools should have one. we change a predetermined line
def update(self,toolname,username,userpass): self.logger.info("updating svn repository for the tool '%s'" \ % (toolname)) repo_url = self.repo_url_template % { 'hubname' : self.hubname, 'toolname' : toolname } # ssh into a tool sessio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, line):", "def svn_client_update(svn_revnum_t_result_rev, char_path, svn_opt_revision_t_revision, svn_boolean_t_recurse, svn_client_ctx_t_ctx, apr_pool_t_pool): # real signature unknown; restored from __doc__\n pass", "def update(self, co_dir):\n self.run_task(' '.join(['svn', 'up', c...
[ "0.62533206", "0.6233835", "0.6133319", "0.6125799", "0.5924647", "0.5831164", "0.57471246", "0.57201964", "0.5711331", "0.56251925", "0.5611665", "0.5599222", "0.5596047", "0.55179936", "0.5501398", "0.54725844", "0.5472264", "0.5447092", "0.5427887", "0.5401864", "0.5389443...
0.70743644
0
install the tool as a tool manager
def install(self,toolname,adminuser,adminpass): self.logger.info("installing the tool '%s'" % (toolname)) self.push_admin_install_button(toolname) self.compile_code(toolname,adminuser,adminpass) self.flip_tool_status('ToolsStatusUploadedAdminPage',toolname,'Installed')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_install(self):\n\n\n adminuser,adminpass = self.testdata.find_account_for('toolmanager')\n\n self.utils.account.login_as(adminuser,adminpass)\n\n self.contribtool.install(TOOLNAME,adminuser,adminpass)", "def installTools(self, out):\r\n # Check that the tool has not been added us...
[ "0.79341507", "0.7467103", "0.7327808", "0.7125146", "0.6754345", "0.67039394", "0.66296947", "0.6547046", "0.64479524", "0.63782793", "0.6364017", "0.63388324", "0.6284098", "0.62583065", "0.6198289", "0.61820793", "0.616268", "0.6161787", "0.6161787", "0.61561984", "0.61465...
0.74988735
1
flip the status of a tool
def flip_tool_status(self,po_type,toolname,status): # navigate to the tool status page as a tool manager po = self.catalog.load_pageobject(po_type,toolname) po.goto_page() # flip the status from uploaded to installed po.submit_form({'status' : status}) self.__wait_for_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flip(self):", "def _revert(self):\n self.kwargs[\"collect\"].change_status(self.kwargs[\"collect\"].ENDED)", "def undo():", "def change_status(self):\n if self.status == \"Still Loaned\":\n self.status = \"Given Back\"\n else:\n self.status = \"Still Loaned\"", ...
[ "0.62391174", "0.6013619", "0.5921297", "0.5835624", "0.57953876", "0.5781029", "0.5781029", "0.5733803", "0.5732732", "0.57219446", "0.5637248", "0.5559335", "0.5494833", "0.54779816", "0.5477927", "0.5455433", "0.5453232", "0.5452697", "0.5421718", "0.5414478", "0.5407332",...
0.7815968
0
push the install button under admin controls on a tool's status page
def push_admin_install_button(self,toolname): self.logger.info("clicking install link for tool '%s'" % (toolname)) # navigate to the tool status page as a tool manager # press the install link po = self.catalog.load_pageobject('ToolsStatusUploadedAdminPage',toolname) po.goto_pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def install(self,toolname,adminuser,adminpass):\n\n self.logger.info(\"installing the tool '%s'\" % (toolname))\n\n self.push_admin_install_button(toolname)\n\n self.compile_code(toolname,adminuser,adminpass)\n\n self.flip_tool_status('ToolsStatusUploadedAdminPage',toolname,'Installed')...
[ "0.6894205", "0.63569754", "0.6219138", "0.5892829", "0.58788323", "0.5817696", "0.5815527", "0.58108056", "0.57809806", "0.57305175", "0.5726516", "0.5711565", "0.5709729", "0.56259745", "0.56010705", "0.5583248", "0.5580389", "0.55735856", "0.55614454", "0.55557096", "0.554...
0.8088303
0
ssh into a tool session container as a tool manager, compile a tool's source code, and install the binaries
def compile_code(self,toolname,adminuser,adminpass): # ssh into a tool session container as the tools manager # compile and install the code # get into a tool session container. cm = ContainerManager() ws = cm.access(host=self.hubname,username=adminuser,password=adminpass) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _Install(vm):\n nthreads = vm.NumCpusForBenchmark() * 2\n vm.Install('build_tools')\n vm.RemoteCommand('git clone {0} {1}'.format(GIT_REPO, SILO_DIR))\n vm.RemoteCommand('cd {0} && git checkout {1}'.format(SILO_DIR,\n GIT_TAG))\n # This is due to a fai...
[ "0.65106165", "0.62863076", "0.6261541", "0.6178528", "0.6128721", "0.60613585", "0.60319775", "0.59973496", "0.5972064", "0.59425604", "0.59423697", "0.58950216", "0.58696645", "0.5855963", "0.585097", "0.58193964", "0.5816621", "0.5813128", "0.58068824", "0.58052963", "0.57...
0.7513344
0
update the tool info page
def edit_tool_page(self,toolname,data): self.logger.info("editing the tool information page for '%s'" \ % (toolname)) # navigate to the resource page edit forms po = self.catalog.load_pageobject('ToolsStatusInstalledPage',toolname) po.goto_page() po....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_info(self):\n self.execution_status_widget.update()\n self.execution_info_widget.update()\n self.cluster_widget.update() # update the cluster info even if it is not being displayed\n self.details.original_widget.update()", "def manage_info():", "def update_info(self):\n ...
[ "0.6937513", "0.68997306", "0.65268207", "0.6488663", "0.6435081", "0.6243344", "0.62158865", "0.6209244", "0.6029602", "0.6014391", "0.5983588", "0.5972531", "0.59343463", "0.5891758", "0.587011", "0.58581185", "0.5839639", "0.5837007", "0.5793765", "0.5785931", "0.5779503",...
0.7814525
0
update the version info and flip the status of an installed tool
def approve(self,toolname,data): self.logger.info("approving the tool '%s'" % (toolname)) po = self.catalog.load_pageobject('ToolsStatusInstalledPage',toolname) po.goto_page() # click the approve link po.flip_status_to_approved() po = self.catalog.load_pageobject('To...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flip_tool_status(self,po_type,toolname,status):\n\n # navigate to the tool status page as a tool manager\n po = self.catalog.load_pageobject(po_type,toolname)\n po.goto_page()\n\n # flip the status from uploaded to installed\n po.submit_form({'status' : status})\n\n se...
[ "0.6580785", "0.65188277", "0.623427", "0.6184412", "0.6158391", "0.6124108", "0.60630924", "0.60609514", "0.60430795", "0.6040521", "0.60364443", "0.6028939", "0.6018978", "0.60157496", "0.60088396", "0.59893", "0.5974765", "0.59379977", "0.5925918", "0.5925545", "0.5898372"...
0.6737231
0
press the publish button in the admin controls of the tool's status page
def publish(self,toolname): self.logger.info("publishing '%s'" % (toolname)) po = self.catalog.load_pageobject('ToolsStatusApprovedAdminPage',toolname) po.goto_page() # click the publish link publish_status,output = po.do_publish() # wait for the output success / fail...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def website_publish_button(self):\n if self.website_published:\n self.write({'website_published': False})\n else:\n self.write({'website_published': True})", "def publish(self):\n self.published = True\n self.save()# pylint: disable=no-member", "def test_publis...
[ "0.7495316", "0.6336897", "0.630884", "0.62370384", "0.6234319", "0.61975133", "0.6142692", "0.6041579", "0.60411817", "0.60101825", "0.60101825", "0.5994907", "0.5938053", "0.5882186", "0.5813807", "0.57246864", "0.57129204", "0.56953776", "0.5691687", "0.5641309", "0.564069...
0.74170035
1
Callback for bridge enter events. When channels enter the bridge, play tones to the whole bridge.
async def on_enter(bridge, ev): # ignore announcer channels - see ASTERISK-22744 if ev['channel']['name'].startswith('Announcer/'): return await bridge.play(media="sound:ascending-2tone")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onenterready(self, event):\n print('onenterready; event: %s, %s->%s' % (event.event, event.src, event.dst))", "def stasis_start_cb(channel, ev):\n await channel.answer()\n await bridge.addChannel(channel=channel.id)", "def onenterinit(self, event):\n print('onenterinit; event: %s, %s->%...
[ "0.57611674", "0.57449585", "0.54690635", "0.5417739", "0.54", "0.53545564", "0.535284", "0.53515047", "0.5315632", "0.52472526", "0.52459973", "0.52294254", "0.51679105", "0.5165231", "0.51350874", "0.51340574", "0.51283765", "0.512609", "0.5100205", "0.5092541", "0.5089806"...
0.7475675
0
Callback for StasisStart events. For new channels, answer and put them in the holding bridge.
def stasis_start_cb(channel, ev): await channel.answer() await bridge.addChannel(channel=channel.id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_channel_open(self, new_channel):\n\t\tself.channel = new_channel\n\t\tself.declare_queue(self.on_queue_declared)", "def on_open_channel(new_channel):\n # assign new channel to the global channel variable\n global channel\n channel = new_channel\n\n # channel is assigned and declare a queue n...
[ "0.6072436", "0.6020793", "0.586591", "0.57686025", "0.57018626", "0.5688005", "0.56138116", "0.5599956", "0.55506027", "0.54855615", "0.54809916", "0.5448771", "0.54421896", "0.5426432", "0.540642", "0.5392343", "0.5375779", "0.5375755", "0.5369635", "0.5362212", "0.5338399"...
0.78258336
0
Start a single instance of redpanda. This function will not return until redpanda appears to have started successfully. If redpanda does not start within a timeout period the service will fail to start. Thus this function also acts as an implicit test that redpanda starts quickly.
def start_node(self, node, override_cfg_params=None): node.account.mkdirs(RedpandaService.DATA_DIR) node.account.mkdirs(os.path.dirname(RedpandaService.CONFIG_FILE)) self.write_conf_file(node, override_cfg_params) if self.coproc_enabled(): self.start_wasm_engine(node) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_frida(self, daemonize=True, restart=False):\n if not self.available():\n return False\n\n if self.is_frida_running():\n if not restart:\n return True\n\n self.kill_frida()\n\n if not daemonize:\n if self._alternate_frida_name...
[ "0.6819491", "0.6338152", "0.6101906", "0.60887665", "0.59061676", "0.585657", "0.5855658", "0.58395475", "0.5805255", "0.5804473", "0.5790464", "0.57871735", "0.5762625", "0.5723409", "0.57173014", "0.56971985", "0.5661777", "0.5660009", "0.5641163", "0.5613473", "0.5600099"...
0.64013493
1
Return process ids associated with running processes on the given node.
def pids(self, node): try: cmd = "ps ax | grep -i 'redpanda\|node' | grep -v grep | awk '{print $1}'" pid_arr = [ pid for pid in node.account.ssh_capture( cmd, allow_fail=True, callback=int) ] return pid_arr except (Remo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_running_processes(self):\n\n all_processes = []\n for _process in self.processes:\n all_processes.append(_process[\"pid\"])\n return all_processes", "def pid_processes(self):\n return [(process.namespec(), process.infos[self.address_name]['pid'])\n for pr...
[ "0.7174661", "0.6977704", "0.6937219", "0.68962675", "0.68032426", "0.67830485", "0.6782749", "0.66478926", "0.6625109", "0.6602997", "0.6554194", "0.65354824", "0.6525352", "0.64981776", "0.64579827", "0.64316213", "0.6423992", "0.64167964", "0.6379646", "0.6333459", "0.6323...
0.75695175
0
Describe topics. Pass topics=None to describe all topics, or a pass a list of topic names to restrict the call to a set of specific topics.
def describe_topics(self, topics=None): return self._client.describe_topics(topics)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def topics(ctx):\n pass", "def describe_event_topics(DirectoryId=None, TopicNames=None):\n pass", "def topics(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:\n return pulumi.get(self, \"topics\")", "def get_topics(self, tags=None):\r\n params = {}\r\n if tags:\r\n ...
[ "0.68511873", "0.65223306", "0.64484674", "0.6421595", "0.63836026", "0.6307084", "0.6232182", "0.62142724", "0.6113383", "0.60970443", "0.60638446", "0.6036225", "0.6019807", "0.5965546", "0.5951748", "0.58625436", "0.58495194", "0.57934827", "0.5746435", "0.57434803", "0.57...
0.8254813
0
Action for a literal/constant in an expression.
def act_on_literal(self, *, value): assert not isinstance(value, PolarsTerm)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate_constant(expr: Any) -> Any:\n all_options = traverse_all_options(expr)\n if len(all_options) > 1:\n raise ValueError(f'{expr} is not evaluated to a constant. All possible values are: {all_options}')\n res = all_options[0]\n return res", "def literal():\n return Literal()", "d...
[ "0.63338697", "0.6288191", "0.62716156", "0.6245043", "0.61273986", "0.60818", "0.6039965", "0.598779", "0.59617645", "0.5954348", "0.58775127", "0.58076245", "0.579925", "0.5758282", "0.57567173", "0.574304", "0.5739295", "0.57326466", "0.5680734", "0.5677717", "0.5672617", ...
0.64123935
0
Action for a column name.
def act_on_column_name(self, *, arg, value): assert arg is None assert isinstance(value, str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_column(self, name):\r\n return self.column(name)", "def getColName(self, col):\n try:\n return chr(ord('a') + col)\n except:\n return col", "def getColName(self, col):\n try:\n return chr(ord('a') + col)\n except:\n return ...
[ "0.6660265", "0.6657282", "0.6657282", "0.6637954", "0.6637954", "0.6595363", "0.65592444", "0.6550772", "0.6550772", "0.65214103", "0.6516591", "0.64352375", "0.6380491", "0.6339202", "0.63276345", "0.6286839", "0.6267195", "0.62003917", "0.6192203", "0.61488175", "0.6143069...
0.7800615
0
Add required temp columns to temp_v_columns_list
def add_in_temp_columns(self, temp_v_columns: List): if self.zero_constant_required: temp_v_columns.append(_build_lit(0).alias(_da_temp_zero_column_name)) if self.one_constant_required: temp_v_columns.append(_build_lit(1).alias(_da_temp_one_column_name))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh_column_list(self):\n selection = self._ckl_columns.GetSelection() #store the index of the selected column so it can be reselected after the column is refreshed\n checked_items = self._ckl_columns.GetCheckedItems()\n\n self._ckl_columns.Clear() #clear UI ready for the updated column...
[ "0.59135944", "0.5908762", "0.5777952", "0.56220776", "0.55436504", "0.553653", "0.55146056", "0.54708576", "0.53449965", "0.53338826", "0.53028584", "0.5295234", "0.52951986", "0.52939314", "0.52859485", "0.52724284", "0.52333355", "0.5230878", "0.5208454", "0.5191317", "0.5...
0.8247156
0
Check if df is our type of data frame.
def is_appropriate_data_instance(self, df) -> bool: return isinstance(df, pl.DataFrame) or isinstance(df, pl.LazyFrame)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_is_pandas_dataframe(dataframe):\n # type: (Any) -> Optional[bool]\n try:\n from pandas.core.dtypes.generic import ABCDataFrame, ABCSeries\n except ImportError:\n return None\n\n return isinstance(dataframe, (ABCDataFrame, ABCSeries))", "def check_is_dataframe(log):\r\n if p...
[ "0.83089334", "0.7898931", "0.73446316", "0.72243655", "0.71495837", "0.7011591", "0.69731927", "0.68874615", "0.6874195", "0.6718453", "0.66445", "0.66281843", "0.6620511", "0.65114653", "0.6497957", "0.64560986", "0.6443132", "0.64391744", "0.64388955", "0.6365003", "0.6362...
0.7933958
1
Copy of data frame without indices.
def clean_copy(self, df): assert self.is_appropriate_data_instance(df) # Polars doesn't need explicit copying due to copy on write semantics if isinstance(df, pl.LazyFrame): df = df.collect() return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self):\n return self.as_dataframe(self.data.copy())", "def copy(self):\n return DataFrameDefault.register(pandas.DataFrame.copy)(self)", "def copy(self) -> 'DataFrame':\n new_data: Dict[str, ndarray] = {dt: arr.copy() for dt, arr in self._data.items()}\n new_columns: Column...
[ "0.73028016", "0.7097624", "0.6912939", "0.65985554", "0.63843256", "0.63201576", "0.62304705", "0.6190933", "0.6181365", "0.61758137", "0.6172397", "0.61299825", "0.6113285", "0.6069707", "0.60625595", "0.6022115", "0.60139906", "0.601107", "0.6009206", "0.5998867", "0.59942...
0.734018
0
Drop indices in place.
def drop_indices(self, df) -> None: assert self.is_appropriate_data_instance(df) # no operation needed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dropIndices(df, indices):\n df_result = df.copy()\n sorted_indices = list(indices)\n sorted_indices.sort()\n sorted_indices.reverse()\n for idx in sorted_indices:\n df_result = df_result.drop(idx, axis=0)\n return df_result", "def drop_indexer(self):\n ...
[ "0.73479086", "0.6828171", "0.6826018", "0.6803876", "0.6755761", "0.67493826", "0.67117697", "0.667484", "0.66720355", "0.656553", "0.6530303", "0.6416044", "0.6336593", "0.6308048", "0.62827426", "0.62337536", "0.6230206", "0.6220681", "0.6217418", "0.62036103", "0.61914676...
0.7406762
0
Concatenate rows from frame_list
def concat_rows(self, frame_list: List): frame_list = list(frame_list) assert len(frame_list) > 0 if len(frame_list) == 1: return frame_list[0] pl.concat(frame_list, how="vertical")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def concat_columns(self, frame_list):\n frame_list = list(frame_list)\n if len(frame_list) <= 0:\n return None\n if len(frame_list) == 1:\n return frame_list[0]\n res = pl.concat(frame_list, how=\"horizontal\")\n return res", "def concat_dataframes(df_list...
[ "0.7292554", "0.62433743", "0.58531505", "0.5819938", "0.58153903", "0.5707574", "0.56982183", "0.5684668", "0.56657153", "0.55981946", "0.5595354", "0.5516637", "0.5506552", "0.5499398", "0.5459171", "0.5454933", "0.54327285", "0.5431124", "0.5403521", "0.53966844", "0.53566...
0.8323999
0
Concatenate columns from frame_list
def concat_columns(self, frame_list): frame_list = list(frame_list) if len(frame_list) <= 0: return None if len(frame_list) == 1: return frame_list[0] res = pl.concat(frame_list, how="horizontal") return res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def concat_rows(self, frame_list: List):\n frame_list = list(frame_list)\n assert len(frame_list) > 0\n if len(frame_list) == 1:\n return frame_list[0]\n pl.concat(frame_list, how=\"vertical\")", "def merge_df_columns(dlist):\n df = concat(dlist, axis=1, join='outer', so...
[ "0.7105472", "0.64836705", "0.6194675", "0.6131344", "0.60627306", "0.5979607", "0.59750664", "0.58871984", "0.5780783", "0.57681656", "0.5759695", "0.56699", "0.5550166", "0.55388355", "0.55323017", "0.5464589", "0.5461335", "0.5444337", "0.54035634", "0.53909314", "0.537643...
0.8233598
0
Check if a table is keyed by a given list of column names.
def table_is_keyed_by_columns(self, table, *, column_names: Iterable[str]) -> bool: # get rid of some corner cases if table.shape[0] < 2: return True if (column_names is None): return False # check for ill-condition if isinstance(column_names, str): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_columns_with_table(table: Table, columns: Sequence[str]) -> Optional[bool]:\n for column in columns:\n if column not in table.c.keys():\n raise TypeError(f\"Specified column {column} did not exist on table {table}\")\n return True", "def hasTable(*keys):\r\n\treturn getGameData...
[ "0.74475795", "0.7230916", "0.6756509", "0.65953285", "0.6539369", "0.65227795", "0.6516949", "0.6505129", "0.6407804", "0.6375676", "0.6365491", "0.63333", "0.630791", "0.62403756", "0.6179411", "0.6142976", "0.6142086", "0.61396044", "0.6136899", "0.61145663", "0.6077941", ...
0.8031529
0
Implementation of Polars evaluation of data algebra operators
def eval(self, op: data_algebra.data_ops_types.OperatorPlatform, *, data_map: Dict[str, Any]) -> pl.DataFrame: assert isinstance(data_map, Dict) assert isinstance(op, data_algebra.data_ops_types.OperatorPlatform) res = self._compose_polars_ops(op=op, data_map=data_map) if isinstance(res,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compose_polars_ops(self, op: data_algebra.data_ops_types.OperatorPlatform, *, data_map: Dict[str, Any]):\n assert isinstance(op, data_algebra.data_ops_types.OperatorPlatform)\n assert isinstance(data_map, Dict)\n res = self._method_dispatch_table[op.node_name](op=op, data_map=data_map)\n ...
[ "0.594313", "0.58582985", "0.5848473", "0.5826174", "0.580691", "0.5714196", "0.5708446", "0.5610988", "0.5571728", "0.5569609", "0.5528449", "0.5525464", "0.55234504", "0.5521969", "0.5510793", "0.549628", "0.5479389", "0.5432845", "0.5415921", "0.54081815", "0.54020023", ...
0.6366927
0
Convert ViewRepresentation into SQL string. Not at a useful level of development yet.
def to_sql( self, ops: data_algebra.data_ops.ViewRepresentation, *, sql_format_options: Optional[SQLFormatOptions] = None, ) -> str: assert isinstance(ops, data_algebra.data_ops_types.OperatorPlatform) sql_string = self.sql_model.to_sql(ops, sql_format_options=sql_for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dump(self):\n outputs = [\"View : %s\\n\" % self.name]\n cols = list(self.columns.values())\n cols.sort()\n for column in cols:\n outputs.append(\" %-30s %-12s\" % (column['name'], column['type']))\n outputs.append(\"%7s\" % self.__class__.calc_precision(colum...
[ "0.6891758", "0.67753863", "0.602609", "0.58587474", "0.58201617", "0.5788637", "0.5770388", "0.5770272", "0.5713707", "0.5700038", "0.56931585", "0.56305325", "0.55607957", "0.54777735", "0.5465645", "0.54528725", "0.5446647", "0.5409013", "0.53251743", "0.53138494", "0.5302...
0.69150776
0
Convert to polars operators
def _compose_polars_ops(self, op: data_algebra.data_ops_types.OperatorPlatform, *, data_map: Dict[str, Any]): assert isinstance(op, data_algebra.data_ops_types.OperatorPlatform) assert isinstance(data_map, Dict) res = self._method_dispatch_table[op.node_name](op=op, data_map=data_map) re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def polyrelsimp(expr):\n return expr.replace(lambda rel: isinstance(rel, Rel),\n lambda rel: expand_polyeq(rel))", "def vector_to_operator(op):\n if not op.isoperket:\n raise TypeError(\"only defined for operator-kets\")\n if op.superrep != \"super\":\n raise TypeErr...
[ "0.58798975", "0.56746614", "0.5629134", "0.5606589", "0.5464981", "0.5413567", "0.525755", "0.5249324", "0.5211202", "0.5190191", "0.51224834", "0.512151", "0.5102797", "0.5102489", "0.50968355", "0.5093059", "0.50912476", "0.5091109", "0.508995", "0.5073769", "0.5069107", ...
0.60903686
0
Execute a concat rows step, returning a data frame.
def _concat_rows_step(self, op: data_algebra.data_ops_types.OperatorPlatform, *, data_map: Dict[str, Any]): if op.node_name != "ConcatRowsNode": raise TypeError( "op was supposed to be a data_algebra.data_ops.ConcatRowsNode" ) common_columns = [c for c in op.colum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def concat_df(*args, **kwargs):\n return pd.concat(*args, **kwargs)", "def horizontal_concat():\n df_1 = pd.DataFrame(get_mixed_matrix())\n df_2 = pd.DataFrame(get_mixed_matrix())\n df_2.drop([9], inplace=True)\n print(\"df_1:\")\n print(df_1)\n print(\"df_2:\")\n print(df_2)\n # axis ...
[ "0.70432156", "0.6345361", "0.62852144", "0.60040194", "0.5998688", "0.59052885", "0.5786825", "0.57302916", "0.57057124", "0.5640618", "0.56404126", "0.5626552", "0.5614542", "0.56109685", "0.55836624", "0.55183625", "0.54283524", "0.5398583", "0.53867644", "0.538636", "0.53...
0.74464333
0
Execute record conversion step, returning a data frame.
def _convert_records_step(self, op: data_algebra.data_ops_types.OperatorPlatform, *, data_map: Dict[str, Any]): if op.node_name != "ConvertRecordsNode": raise TypeError( "op was supposed to be a data_algebra.data_ops.ConvertRecordsNode" ) res = self._compose_polar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Transform(self, record):\n pass", "def _wrap_result(data, columns, index_col=None, coerce_float=True,\n parse_dates=None):\n\n frame = DataFrame.from_records(data, columns=columns,\n coerce_float=coerce_float)\n\n _parse_date_columns(frame, parse_dat...
[ "0.61705667", "0.5865664", "0.58545697", "0.579415", "0.57474154", "0.5745956", "0.56665283", "0.55629575", "0.5491897", "0.54693615", "0.5429858", "0.5411135", "0.53952247", "0.53617454", "0.5330878", "0.5310792", "0.5309842", "0.53053737", "0.5295951", "0.5277967", "0.52676...
0.6401547
0
Execute an extend step, returning a data frame.
def _extend_step(self, op: data_algebra.data_ops_types.OperatorPlatform, *, data_map: Dict[str, Any]): if op.node_name != "ExtendNode": raise TypeError("op was supposed to be a data_algebra.data_ops.ExtendNode") res = self._compose_polars_ops(op.sources[0], data_map=data_map) partiti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extend_step(self, extend_fn, cached_states: NestedMap,\n step_inputs: NestedJTensor, *args: Any, **kwargs: Any) -> Any:\n # Wrap inputs in a NestedMap to conform to recurrent.scan interface.\n step_inputs_mp = NestedMap(carry=step_inputs)\n\n def _scan_fn(layer_in, vars_and_states):\n...
[ "0.52786916", "0.5227647", "0.518339", "0.51390845", "0.5085952", "0.49617696", "0.49617445", "0.4915461", "0.48625514", "0.48275822", "0.48263407", "0.48179108", "0.48105806", "0.47605127", "0.47605127", "0.4754624", "0.47451398", "0.47288862", "0.47099414", "0.4704686", "0....
0.6725283
0