query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
This tests if a probable point is contained in the result set not using hamming weights
def test_run_nicv_without_hamming_weight(self): traces, keys, plain = FileLoader.main(CONST_DEFAULT_TRACES_FILE, CONST_DEFAULT_KEYS_FILE, CONST_DEFAULT_PLAIN_FILE) result = NICV.run(traces, keys, plain, hamming...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contains(self, point):\n try:\n p = vector(point)\n except TypeError: # point not iterable or no common ring for elements\n if len(point)>0:\n return False\n else:\n p = vector(self.field(), [])\n\n if len(p)!=self.ambient_dim(...
[ "0.61201495", "0.611665", "0.5976837", "0.59243774", "0.5902452", "0.58742094", "0.5843434", "0.58403456", "0.58043325", "0.57743335", "0.574345", "0.5721326", "0.5709009", "0.5688945", "0.5687306", "0.568252", "0.5667856", "0.566138", "0.5656523", "0.5650271", "0.56464285", ...
0.0
-1
Initialize the GUI. Entire thing is in a VBox
def __init__(self, showCTWM, showWHM, showRTLE, algorithmCTWM, algorithmWHM, tool_type_text, material_text, flutes_text, coating_text, cutting_type_text, wpmaterial_text, heat_text, tool_diameter_num, parent_img_path=None): # Initialize the widget and the main window Q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_gui(self):\n # Choose a layout.\n main_vb = QtGui.QVBoxLayout(self)\n\n # Add a list or tree view.\n self.list_view = QtGui.QListWidget()\n\n # Add the buttons.\n load_btn = QtGui.QPushButton('Load Selected')\n cancel_btn = QtGui.QPushButton('Cancel')\n ...
[ "0.75043786", "0.74705076", "0.74529564", "0.7343875", "0.73165715", "0.724028", "0.7090761", "0.6991302", "0.69851357", "0.6964523", "0.69387114", "0.69001526", "0.689826", "0.68935543", "0.6855615", "0.6823794", "0.679639", "0.679639", "0.6773305", "0.67714626", "0.67638475...
0.0
-1
Starts the algorithm when Start button is pressed
def startButtonPressed(self): self.showtime = time.time() self.save_file = open(os.path.join(args.parent_img_path, self.save_file_name), "a") self.save_file.write("\nStart Button Pressed\n") self.save_file.close() # Timers for x axis scrolling. self.tmr = QElapsedTimer(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start():", "def start():", "def start():", "def start():", "def start(self):\n self.reset()\n self.on_start()", "def start_aco(self, event):\n if not self.running:\n self.start_btn_text.set(\"Start\")\n self.pause_btn_text.set(\"Pause\")\n self.ru...
[ "0.74529594", "0.74529594", "0.74529594", "0.74529594", "0.74321634", "0.7334844", "0.72592944", "0.72418106", "0.7226268", "0.7208373", "0.71964395", "0.717658", "0.717658", "0.71589386", "0.71589386", "0.71418023", "0.7085337", "0.7085337", "0.7085337", "0.7085337", "0.7085...
0.7719503
0
Stops the algorithm when Stop button is pressed
def stopButtonPressed(self): self.booleanStartButtonPressed = False # For RTLE's updateLabel function to check self.save_file = open(os.path.join(args.parent_img_path, self.save_file_name), "a") self.save_file.write("\nStop Button Pressed\n") self.save_file.close() print("Sto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop():", "def stop():", "def stop():", "def stop():", "def stop() -> None:", "def stop(self) -> None:", "def stop(self) -> None:", "def stop(self):", "def stop(self):", "def stop(self) -> None:\n ...", "def stop(self):\r\n self.terminating = True", "def stop(self):\r\n ...
[ "0.83906263", "0.83906263", "0.83906263", "0.83906263", "0.83332783", "0.81703377", "0.81703377", "0.8142883", "0.8142883", "0.8100799", "0.8086809", "0.8075801", "0.8071935", "0.8071935", "0.79884905", "0.79884905", "0.79884905", "0.79884905", "0.79884905", "0.79884905", "0....
0.81086093
9
Save a snapshot of the window state currently
def saveWindowState(self): print("Save button has been pressed!") screenshot = self.widgetHolder.grab() self.screenshotNum += 1 if(self.addressBox.text() != ""): screenshot.save(os.path.join(self.addressBox.text(), ("screenshot" + str(self.screenshotNum) + ".jpg"))) e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_state(self):\n pass", "def savestate(self, state):\n pass", "def save_state(self, state=None):\n state = {}\n for i in range(self.workspace.count()):\n tab: SubTab = self.workspace.widget(i)\n state[tab.__class__.__name__] = tab.get_state()\n\n ...
[ "0.7000904", "0.6870443", "0.67957085", "0.67244345", "0.66360146", "0.6524261", "0.65233535", "0.6421678", "0.6420142", "0.64183027", "0.64110035", "0.63840055", "0.63635343", "0.63402593", "0.62987524", "0.6275983", "0.6211945", "0.6211945", "0.615993", "0.61380464", "0.613...
0.759661
0
Reset CTWM and WHM graphs
def resetPressed(self): print("Reset button has been pressed!") self.save_file = open(os.path.join(args.parent_img_path, self.save_file_name), "a") self.save_file.write("\n" + "-------*Reset Button Pressed*-------" + "\n") self.save_file.close() # CTWM Resetting if self.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_wm(self):\n\n self.plan = []\n self.hist = []", "def clear_graphs(self):\n for ax in (self.master_plot, self.time_velocity, self.time_power, self.power_velocity):\n ax.cla()", "def reset_graph(self):\n self.sick_per_timestep = []\n self.steps = []\n ...
[ "0.7166075", "0.7093495", "0.67956966", "0.6758514", "0.6715742", "0.65326226", "0.64641696", "0.6345253", "0.6276858", "0.62762755", "0.6266019", "0.62618566", "0.62618566", "0.62618566", "0.62370765", "0.6226797", "0.6226797", "0.6226797", "0.61662453", "0.6132436", "0.6119...
0.61788464
18
Create a CTWM widget
def initCTWM(self): self.dataCTWM = deque(maxlen=100) # change this for how many seconds are visible before scrolling # To create one "big" widget, use a VBox self.secondRowCTWM = QtWidgets.QVBoxLayout() # Add the title on the first row of the VBox self.CTWMTitle = QLabel("Cut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_widget(self):\n pass", "def create_widgets( self ):", "def create_widgets(self):", "def createWidget(self, QWidget): # real signature unknown; restored from __doc__\n pass", "def create_widget(self):\n self.widget = UILabel()", "def create_widget(self):\n self.widge...
[ "0.7159517", "0.6920131", "0.6810839", "0.63586134", "0.635473", "0.63497394", "0.62045825", "0.6184778", "0.61779004", "0.61708486", "0.6128293", "0.611262", "0.61108136", "0.6102525", "0.60267544", "0.60147023", "0.60020727", "0.5925469", "0.59116405", "0.5875829", "0.58652...
0.59477204
17
Create a WHM widget
def initWHM(self): self.dataWHM = deque(maxlen=60) # To create on "big" widget, use Vbox self.secondRowWHM = QtWidgets.QVBoxLayout() # Add the title on the first row of the VBox self.WHMTitle = QLabel("Workpiece Hardness Monitoring") self.WHMTitle.setContentsMargins(0,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_widget(self):\n pass", "def create_widgets( self ):", "def create_widgets(self):", "def add_widget():\n\n return render_template('add_widget.html', widget=None)", "def create_widgets(self):\n self.Hi = Button(self, text= \"hi\", fg=\"red\", command=self.say_hi)\n self.Hi....
[ "0.64509976", "0.6141613", "0.60142595", "0.5879074", "0.5826547", "0.5790088", "0.5767244", "0.5724837", "0.56533223", "0.56099045", "0.5569504", "0.5506261", "0.5505972", "0.5505943", "0.54471457", "0.5392937", "0.5369088", "0.5306733", "0.53022355", "0.5286947", "0.5265175...
0.0
-1
Initialize the Remaining Tool Life Estimation widget
def initRTLE(self): # To create one "big" widget, use a VBox self.thirdRowRTLE = QtWidgets.QVBoxLayout() # Add the title on the first row of the VBox self.RTLETitle = QLabel("Remaining Tool Life Estimation") self.RTLETitle.setAlignment(QtCore.Qt.AlignHCenter) self.RTLETi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_widget(self):", "def __init__(self, parent=None):\n\n super().__init__(parent=parent)\n\n self.window_title = \"Goal Calibration\"\n\n screen_layout = QVBoxLayout()\n\n self.toolbar = ToolbarComponent(\n self.window_title, \"Back to Session\\n Record Check\")\n\n ...
[ "0.64532065", "0.6402616", "0.636205", "0.62868494", "0.62619424", "0.62104297", "0.6200258", "0.6080374", "0.60627997", "0.60533", "0.60170144", "0.6016117", "0.59908533", "0.5986326", "0.59852284", "0.596869", "0.594783", "0.5926786", "0.5923299", "0.5911436", "0.59096843",...
0.6814796
0
Add the grayed Good, Average, Advanced, and Failure images to the image/label/graph CTWMlayout
def initImgCTWM(self): # Initialize the image's layout self.CTWMimageShow = QtWidgets.QVBoxLayout() self.CTWMimageShow.setContentsMargins(0, 0, 15, 0) # someLayout.setContentsMargins(left, top, right, bottom) self.labelFailureGrayCTWM = QLabel() # default image for when algorit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initImgWHM(self):\n\n self.WHMimageShow = QtWidgets.QVBoxLayout()\n self.WHMimageShow.setContentsMargins(0, 0, 15, 0) # someLayout.setContentsMargins(left, top, right, bottom)\n\n self.labelLevelFourWHM = QLabel()\n # default image for when algorithm hasn't reached conclusion\n ...
[ "0.6386643", "0.5866134", "0.5834087", "0.5791963", "0.5699978", "0.56788355", "0.5668862", "0.5624913", "0.5623024", "0.5611453", "0.55672985", "0.5561185", "0.5535266", "0.55314267", "0.5491953", "0.54872274", "0.5486469", "0.547803", "0.5458148", "0.54550576", "0.54550034"...
0.7204687
0
Add the grayed Level 1, Level 2, Level 3, and Level 4 images to the image/label/graph WHM layout
def initImgWHM(self): self.WHMimageShow = QtWidgets.QVBoxLayout() self.WHMimageShow.setContentsMargins(0, 0, 15, 0) # someLayout.setContentsMargins(left, top, right, bottom) self.labelLevelFourWHM = QLabel() # default image for when algorithm hasn't reached conclusion self.lab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initImgCTWM(self):\n\n # Initialize the image's layout\n self.CTWMimageShow = QtWidgets.QVBoxLayout()\n self.CTWMimageShow.setContentsMargins(0, 0, 15, 0) # someLayout.setContentsMargins(left, top, right, bottom)\n\n self.labelFailureGrayCTWM = QLabel()\n # default image for ...
[ "0.61418724", "0.59853095", "0.58583283", "0.5804678", "0.57843477", "0.5706259", "0.5691361", "0.5661333", "0.56471395", "0.56023145", "0.55989903", "0.5558774", "0.5541108", "0.5524603", "0.54526556", "0.5450648", "0.54487604", "0.5443195", "0.54367644", "0.5435571", "0.542...
0.67650187
0
The realpart where threading takes place Update the image according to the prediction
def updateCTWM(self, wear): if wear == 1: self.labelGoodGrayCTWM.setPixmap(self.images['imageGoodGreenCTWM']) self.labelAverageGrayCTWM.setPixmap(self.images['imageAverageGrayCTWM']) self.labelAdvancedGrayCTWM.setPixmap(self.images['imageAdvancedGrayCTWM']) self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prediction_on_a_image(self, input, output,model_saved_path):\n\n # load the saved model\n if os.path.isfile(model_saved_path) is False:\n raise IOError('trained model: %s not exist' % model_saved_path)\n\n clf = joblib.load(model_saved_path)\n\n # split a large image to m...
[ "0.6702295", "0.6388779", "0.6322772", "0.623505", "0.6224272", "0.6121753", "0.610495", "0.6074917", "0.6060844", "0.6023864", "0.60219103", "0.6011753", "0.6009559", "0.5994741", "0.5991561", "0.5980041", "0.5951669", "0.59458995", "0.5937661", "0.59347117", "0.5926469", ...
0.0
-1
The realpart where threading takes place Update the image according to the prediction
def updateWHM(self, hardnessLevel): if hardnessLevel == 1: self.labelLevelOneWHM.setPixmap(self.images['imageLevelOneWHMgreen']) self.labelLevelTwoWHM.setPixmap(self.images['imageLevelTwoWHMgray']) self.labelLevelThreeWHM.setPixmap(self.images['imageLevelThreeWHMgray']) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prediction_on_a_image(self, input, output,model_saved_path):\n\n # load the saved model\n if os.path.isfile(model_saved_path) is False:\n raise IOError('trained model: %s not exist' % model_saved_path)\n\n clf = joblib.load(model_saved_path)\n\n # split a large image to m...
[ "0.67010075", "0.63886106", "0.63232195", "0.6234899", "0.6222673", "0.61210626", "0.6103139", "0.60747504", "0.6059498", "0.6023064", "0.6020609", "0.60128355", "0.6007971", "0.5993891", "0.5991003", "0.5980222", "0.59505093", "0.594541", "0.5936697", "0.59337837", "0.592689...
0.0
-1
Update the labels of the RTLE widget
def updateRTLE(self): x = [1] self.V = self.cuttingSpeed(diameter=float(self.radialDOC.text()), rpm=float(self.speed.text())) # V: cutting speed self.toolLife = self.algoRTLE(V=self.V, d=float(self.radialDOC.text()), f=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UpdateLabel(self) -> _n_6_t_0:", "def refresh_label(self):\n finalText = \"%s\" % (player.get_time())\n self.label.configure(text=finalText)", "def updateLabels(self):\n # Intensity range\n self.minIntensityLabel.setText(\"Intensity: \"+str(self.ABsettings[\"intensity_range\"][0...
[ "0.77404064", "0.7208904", "0.71542877", "0.70850414", "0.67943734", "0.67658687", "0.67152596", "0.66993445", "0.66086614", "0.6600246", "0.6563156", "0.6492608", "0.64926004", "0.6490954", "0.64440733", "0.64006895", "0.63831663", "0.6375843", "0.6358434", "0.62956876", "0....
0.0
-1
Return V, which is cutting speed in ft/min
def cuttingSpeed(self, diameter, rpm): return (math.pi * diameter * rpm)/12
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def v(self):\n\n # TODO This translation formula works, but needs simplified.\n\n # PWM duration can go from 0 to 4095 with 4095 representing max rpm\n# print(\"MuleBot.v MuleBot.dcMotorPWMDurationLeft:\", MuleBot.dcMotorPWMDurationLeft)\n speed_percentage = float(MuleBot.dcMotorPWMDurationLef...
[ "0.68396777", "0.6831442", "0.6686481", "0.662663", "0.65928245", "0.6527081", "0.65093327", "0.64494234", "0.63998115", "0.6390836", "0.6384986", "0.63512117", "0.63503695", "0.6310313", "0.62841654", "0.62701416", "0.62219393", "0.6217499", "0.6205035", "0.6155589", "0.6129...
0.5989146
31
Remaining Tool Life Estimation algorithm
def algoRTLE(self, V, d, f, rpm, flute): return math.pow(100, (1/0.15)) * math.pow(V, (-1/0.15)) * math.pow((d*25.4), -1) * math.pow(((f/(rpm * flute)) * 25.4), (-0.1/0.15))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def life_step(state):\n\t# For every cell each live cell in any of the 8 neighbouring cells contributes 1 to the sum\n\t# Rolling matricies is periodic so this implements periodic boundary conditions\n\tnumberOfNeigbours = sum(np.roll(np.roll(state, i, axis=0), j, axis=1)\n\t\t\t\t\t\t for i in (-1,0,1) for j i...
[ "0.63687664", "0.6017554", "0.5927634", "0.5862358", "0.583838", "0.5726555", "0.5698298", "0.56953895", "0.5654126", "0.5650383", "0.564668", "0.5615622", "0.56017554", "0.5594441", "0.5584126", "0.55805385", "0.55802566", "0.5572428", "0.55716723", "0.55690217", "0.5563431"...
0.0
-1
Algorithm that initializes PyAudio and opens stream
def run(self): self.p = pyaudio.PyAudio() self.stream = self.p.open(format=pyaudio.paFloat32, channels=self.CHANNELS, rate=self.RATE, input=True, output=False, stream_callback=self.callback) self.stream.start_stream() self.stop.setSingleShot(True) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initAudio(self):\n\t\t# Initialize pitch detection\n\t\tself.listener = PitchDetect(channels=1)\n\t\tself.listener.listen()\n\t\tself.recording = False\n\t\tself.paused = False", "def _open_stream(config):\n p = pyaudio.PyAudio()\n stream = p.open(\n format = config[\"format\"],\n channel...
[ "0.7018606", "0.6994479", "0.6726423", "0.66986895", "0.6595235", "0.65077215", "0.64140517", "0.63777816", "0.63583624", "0.6321371", "0.6317331", "0.6205806", "0.615547", "0.61343265", "0.61213106", "0.61016387", "0.60860324", "0.60803276", "0.6075874", "0.6051144", "0.6038...
0.68190736
2
Call backfunction to execute in a while loop for stream
def callback(self, in_data, *kwargs): self.receive_time = time.time() audio_data = np.fromstring(in_data, dtype=np.float32) self.audio.extend(audio_data) # if the queue is full then run SVM if len(self.audio) == self.count: self.algo_time = time.time() sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self, generator_function, from_fx_pairs, event):\n while True:\n try:\n data = generator_function(from_fx_pairs)\n if data is not None: self.put_record(data)\n time.sleep(self.stream_freq)\n except self.client.exceptions.ResourceNotF...
[ "0.7026612", "0.6525065", "0.65093267", "0.63132346", "0.63132346", "0.6280486", "0.62626505", "0.62330055", "0.62056196", "0.61215305", "0.61139697", "0.6093299", "0.60516274", "0.6039924", "0.5991768", "0.59885705", "0.59782594", "0.5967383", "0.59410816", "0.5939941", "0.5...
0.0
-1
Algorithm that terminates PyAudio and closes the stream
def stopit(self): self.stop.stop() self.stream.close() self.p.terminate() self.p = None print("Recording terminated!")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n\t\tself.stream.close()\n\t\tself.audio.terminate()", "def close(self):\n logger.debug(\"Microphone stream close and terminate\")\n self.stream.close()\n self._pyaudio.terminate()", "def stop(self):\n self.prestop()\n if not self._graceful:\n self...
[ "0.7369884", "0.7008636", "0.63397884", "0.6282891", "0.61975676", "0.61504495", "0.6128383", "0.612325", "0.61024195", "0.6040964", "0.60197383", "0.6008431", "0.6008409", "0.59876436", "0.59073836", "0.5902239", "0.5896446", "0.5868873", "0.5833217", "0.58225983", "0.582017...
0.6539381
2
Algorithm that takes in audio data and refers to the PKL file. Accordingly, emits the number that is the wear status
def algo(self): audio = np.array([self.audio.popleft() for _ in range(self.count)]) # Run Classifier wav_data = np.abs(np.fft.rfft(audio.flatten())) if len(wav_data) > 0: pred = self.clf.predict(np.expand_dims(wav_data, 0)) if self.verbose > 1: pri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def audio_pipeline(wav):\n sig = sb.dataio.dataio.read_audio(wav)\n return sig", "def audio_pipeline(wav):\n sig = sb.dataio.dataio.read_audio(wav)\n return sig", "def remix(self):\n self.original = audio.LocalAudioFile(self.infile)\n #for i, segment in enumerate(self....
[ "0.5776093", "0.5776093", "0.56258774", "0.55978847", "0.55217975", "0.5512466", "0.5434732", "0.5431233", "0.5403857", "0.53977406", "0.53871745", "0.5367683", "0.53582084", "0.5348625", "0.53290117", "0.5324296", "0.5322437", "0.5318418", "0.530289", "0.5295908", "0.5287586...
0.5391906
10
Overrides the normal exception stuff that PyCharm prints out. Essentially used for PyQt
def my_exception_hook(exctype, value, traceback): # Print the error and traceback print(exctype, value, traceback) # Call the normal Exception hook after sys._excepthook(exctype, value, traceback) sys.exit(1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exception(self):\n exc_type, exc_value, exc_tb = sys.exc_info()\n cui.message(traceback.format_exception_only(exc_type, exc_value)[-1],\n log_message=traceback.format_exc())", "def unexpectedException(self):", "def exception(self, *args, **kwargs):", "def exception(self, ...
[ "0.73990434", "0.7372801", "0.7122217", "0.70503515", "0.6976431", "0.694153", "0.6835531", "0.68346757", "0.68156236", "0.68044263", "0.6793362", "0.6764327", "0.6748077", "0.67356193", "0.66687626", "0.66634196", "0.6592502", "0.65720236", "0.6570988", "0.6555084", "0.64887...
0.0
-1
Set the Environment group in the AZFP netCDF file. AZFP includes additional variables 'salinity' and 'pressure'
def set_env(self, env_dict): # Only save environment group if file_path exists if not os.path.exists(self.file_path): print('netCDF file does not exist, exiting without saving Environment group...') else: ds = xr.Dataset({'temperature': (['ping_time'], env_dict['temperatu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_group(group_name):\n group_config = env.groups[group_name]\n set_role_defs(\n web=group_config['servers'][WEB_ROLE],\n db=group_config['servers'][DB_ROLE],\n )\n env.branch = group_config['branch']\n env.subdomain = group_config.get('subdomain', 'www')", "def SetEnvironmentVa...
[ "0.56730884", "0.54024184", "0.517299", "0.51126647", "0.50913596", "0.5072185", "0.5056159", "0.49816746", "0.4974198", "0.49667385", "0.4952896", "0.49426872", "0.4900217", "0.48419467", "0.48245883", "0.48163995", "0.48155674", "0.48152548", "0.48042238", "0.47832984", "0....
0.6874508
0
Set the Platform group in the AZFP nc file. AZFP does not record pitch, roll, and heave.
def set_platform(self, platform_dict): if not os.path.exists(self.file_path): print("netCDF file does not exist, exiting without saving Platform group...") elif self.format == '.nc': with netCDF4.Dataset(self.file_path, 'a', format='NETCDF4') as ncfile: plat = ncf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setGroup(self, group):\n\t\tself.config.GROUP = group", "def setPlatform(self):\n\t\treturn None", "def set_group(group_name):\n group_config = env.groups[group_name]\n set_role_defs(\n web=group_config['servers'][WEB_ROLE],\n db=group_config['servers'][DB_ROLE],\n )\n env.branch ...
[ "0.59620076", "0.58957833", "0.5449728", "0.5411098", "0.53018975", "0.52523345", "0.51879275", "0.517697", "0.5169259", "0.51625127", "0.5157414", "0.5132932", "0.5117618", "0.51081556", "0.5095792", "0.50628644", "0.50514495", "0.5050298", "0.5050298", "0.5050298", "0.50482...
0.73987556
0
Set the Beam group in the AZFP nc file.
def set_beam(self, beam_dict): ds = xr.Dataset({'backscatter_r': (['frequency', 'ping_time', 'range_bin'], beam_dict['backscatter_r']), 'equivalent_beam_angle': (['frequency'], beam_dict['EBA']), 'gain_correction': (['frequency'], beam_dict['gain_correction']),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setGroup(self, group):\n\t\tself.config.GROUP = group", "def set_group(self, group: str) -> None:\n self.group = group", "def set_file_group(host, fqpath, group):\n command = \"chgrp %s %s\" % (group, fqpath)\n rcode, _, rerr = g.run(host, command)\n\n if rcode == 0:\n return True\n\...
[ "0.6353727", "0.6137729", "0.6121417", "0.6094095", "0.6018096", "0.59595436", "0.5953777", "0.5921253", "0.5921253", "0.5921253", "0.582968", "0.58139074", "0.581362", "0.5798021", "0.57895154", "0.56825626", "0.56262505", "0.55935645", "0.5526058", "0.5416513", "0.541444", ...
0.0
-1
Set the Vendorspecific group in the AZFP nc file.
def set_vendor_specific(self, vendor_dict): ds = xr.Dataset({ 'digitization_rate': (['frequency'], vendor_dict['digitization_rate']), 'lockout_index': (['frequency'], vendor_dict['lockout_index']), 'number_of_bins_per_channel': (['frequency'], vendor_dict['num_bins']), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setNetGroup(addr): #status: Done, not tested\r\n pass", "def setGroup(self, group):\n\t\tself.config.GROUP = group", "def set_group(group_name):\n group_config = env.groups[group_name]\n set_role_defs(\n web=group_config['servers'][WEB_ROLE],\n db=group_config['servers'][DB_ROLE],\n...
[ "0.5818015", "0.5593389", "0.5420352", "0.531739", "0.5247919", "0.5210025", "0.52034104", "0.5056083", "0.4979666", "0.4961366", "0.4957649", "0.49375102", "0.49324661", "0.4869826", "0.48698074", "0.4861048", "0.48498112", "0.48484364", "0.48383456", "0.4813834", "0.48103",...
0.45308754
64
returns local pillar location
def get_unrendered_pillar_location(): if env.use_project_dir: # TODO: render pillar template to stdout / temp directory to sync it? (or just generate one file for remote) fab_location = os.path.dirname(env.real_fabfile) pillar_location = os.path.abspath(os.path.join(fab_location, '../config/...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def location(self) -> str:\n return pulumi.get(self, \"location\")", "def location(self) -> str:\n return pulumi.get(self, \"location\")", "def location(self) -> str:\n return pulumi.get(self, \"location\")", "def location(self) -> str:\n return pulumi.get(self, \"location\")", ...
[ "0.6535337", "0.6535337", "0.6535337", "0.6535337", "0.6535337", "0.6535337", "0.6535337", "0.6535337", "0.6535337", "0.6535337", "0.6535337", "0.6535337", "0.6535337", "0.6509677", "0.6489564", "0.64180577", "0.6398598", "0.6373534", "0.63255537", "0.62913543", "0.6271006", ...
0.7167248
0
Returns all local pillar locations If a boolean false is passed as an argument it will not include the project pillar
def get_unrendered_pillar_locations(include_project=True): pillar_locations = [] if include_project: pillar_locations.append(get_unrendered_pillar_location()) if 'pillar_dirs' in env: fab_location = os.path.dirname(env.real_fabfile) for root in env.pillar_dirs: pillar_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_locations(self):", "def __load_pillar_dirs(pillar_dir, projects_location, target=None):\n pillars = []\n\n # We can bypass the project directory when creating the pillar\n if pillar_dir is None and env.use_project_dir is True:\n if \"pillar_dir\" in env:\n pillar_dir = env....
[ "0.6342974", "0.6299826", "0.5687538", "0.5537646", "0.55367297", "0.54880726", "0.5416347", "0.54008824", "0.53594613", "0.53230286", "0.52886045", "0.52729845", "0.5245137", "0.52230793", "0.5211905", "0.5208852", "0.5167501", "0.5167501", "0.5167501", "0.51619965", "0.5159...
0.68797123
0
Returns path to rendered pillar. Use to render pillars written in jinja locally not to upload unwanted data to network.
def get_rendered_pillar_location( pillar_dir=None, projects_location=None, parse_top_sls=True, target=None ): if 'use_project_dir' not in 'env': env.use_project_dir = False if projects_location is None: projects_location = _get_projects_location() pillar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_unrendered_pillar_location():\n if env.use_project_dir:\n # TODO: render pillar template to stdout / temp directory to sync it? (or just generate one file for remote)\n fab_location = os.path.dirname(env.real_fabfile)\n pillar_location = os.path.abspath(os.path.join(fab_location, '....
[ "0.75512964", "0.5691066", "0.5684189", "0.5667313", "0.5623867", "0.5567444", "0.5545756", "0.544221", "0.54305345", "0.52963436", "0.5293972", "0.52757126", "0.5265386", "0.5236548", "0.519674", "0.51963544", "0.51852924", "0.5177533", "0.51751053", "0.51736486", "0.5154173...
0.6923811
1
Loads all of the pillar directories into a list
def __load_pillar_dirs(pillar_dir, projects_location, target=None): pillars = [] # We can bypass the project directory when creating the pillar if pillar_dir is None and env.use_project_dir is True: if "pillar_dir" in env: pillar_dir = env.pillar_dir else: assert env...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_list_emptydirs(load):\n # TODO - implement this\n _init()\n\n return []", "def _include_dir_list_yaml(\n loader: SafeLineLoader, node: yaml.nodes.Node\n) -> List[JSON_TYPE]:\n loc = os.path.join(os.path.dirname(loader.name), node.value)\n return [load_yaml(f) for f in _find_files(loc, ...
[ "0.6941456", "0.6524377", "0.65121335", "0.6506694", "0.6448074", "0.6384362", "0.63644636", "0.6255887", "0.6255887", "0.62340707", "0.6178828", "0.61648023", "0.6150959", "0.6123499", "0.6123203", "0.61123794", "0.60826766", "0.607872", "0.604056", "0.60251266", "0.60152185...
0.72813815
0
Render and save templates
def __render_templates(files_to_render, dest_location, jinja_env): errors = [] from jinja2.exceptions import TemplateNotFound for template_file in files_to_render: filename = os.path.abspath(os.path.join(dest_location, template_file)) print("Pillar template_file: {} --> {}".format(templat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_path(self):\n return self.template.manager.render_template_txt(self.path, self.template)", "def render_and_write(template_name, context, output_name, output_dir,templates_env):\n\ttemplate = templates_env.get_template(template_name)\n\tf = open(path.join(output_dir, output_name), \"w\")\n\tf.writ...
[ "0.7109811", "0.647686", "0.6470165", "0.6444019", "0.63979435", "0.6383757", "0.63684547", "0.634082", "0.6306804", "0.62989867", "0.6287836", "0.6213412", "0.62123626", "0.6194604", "0.6189029", "0.61879677", "0.61856616", "0.6149003", "0.6138681", "0.61366844", "0.61233246...
0.0
-1
Get the base unit for values (e.g. "s", "m", "V", etc). Meant to be overridden by subclasses.
def unit(self) -> str:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_unit() -> ureg:\n return ureg.meter", "def get_base_unit(self, obj: Dimension) -> Unit:\n return obj.base_unit", "def to_base_unit(val: float, unit: str = \"\") -> float:\n unit_scalar = UNITS.get(unit, None)\n if not unit_scalar:\n raise UnknownUnitError(f\"Unit '{unit}' is...
[ "0.76170635", "0.7149581", "0.7050399", "0.6910019", "0.6902238", "0.68939173", "0.68880665", "0.6882497", "0.6843663", "0.67957336", "0.67876023", "0.67799795", "0.67353696", "0.67060626", "0.668818", "0.6678495", "0.66487557", "0.6642006", "0.6631388", "0.66190445", "0.6609...
0.67968714
9
Get the base unit type for values. (e.g. for "s", this would be "time") Meant to be overridden by subclasses.
def unit_type(self) -> str:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unit_of_measurement(self) -> str | None:\n set_req = self.gateway.const.SetReq\n if (\n AwesomeVersion(self.gateway.protocol_version) >= AwesomeVersion(\"1.5\")\n and set_req.V_UNIT_PREFIX in self._values\n ):\n custom_unit: str = self._values[set_req.V_UNI...
[ "0.6967566", "0.68649644", "0.6752575", "0.6752575", "0.67353094", "0.66816056", "0.6639613", "0.66268444", "0.6624583", "0.65786624", "0.65508604", "0.65508604", "0.6527846", "0.6527846", "0.64999187", "0.64862823", "0.64670765", "0.6377557", "0.6360455", "0.6340261", "0.632...
0.73981583
0
Get the default prefix for values. (e.g. for time, specifying "n" would mean "0.25" would be interpreted as "0.25 ns".) Meant to be overridden by subclasses.
def default_prefix(self) -> str:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_prefix(self) -> str:\n return \"\"", "def default_prefix(self) -> str:\n return \"\"", "def get_default_prefix(path):\n if path in prefixes_dict.keys():\n return prefixes_dict[path]\n else:\n return ''", "def prefix_format(self) -> Optional[pulumi.Input[str]]:\n ...
[ "0.77152824", "0.77152824", "0.7141563", "0.6859565", "0.6859565", "0.6814326", "0.672612", "0.672612", "0.672612", "0.6715219", "0.6713998", "0.65031195", "0.64007133", "0.64007133", "0.6362454", "0.6357433", "0.6357433", "0.6347293", "0.62549293", "0.6252407", "0.6252407", ...
0.8122663
0
Create a value from parsing the given string.
def __init__(self, value: str, prefix: Optional[str] = None) -> None: import re default_prefix = get_or_else(prefix, self.default_prefix) regex = r"^(-?[\d.]+) *(.*){}$".format(re.escape(self.unit)) match = re.search(regex, value) if match is None: try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value_from_str(self, s):\n raise ValueError()", "def from_str(cls, string):", "def parse_string_value(str_value: Text) -> Any:\n try:\n return ast.literal_eval(str_value)\n except ValueError:\n return str_value\n except SyntaxError:\n # e.g. $var, ${func}\n retur...
[ "0.7565089", "0.69689536", "0.68060553", "0.66767126", "0.66733944", "0.66652083", "0.66652083", "0.6632383", "0.66079915", "0.65838414", "0.6569645", "0.656385", "0.6543991", "0.6525213", "0.6451549", "0.6448787", "0.6442351", "0.63843143", "0.632424", "0.6318356", "0.631835...
0.0
-1
Get the prefix string of this value.
def value_prefix(self) -> str: return self._value_prefix
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prefix(self):\n return self[\"prefix\"]", "def prefix(self):\n return self[\"prefix\"]", "def prefix(self) -> typing.Optional[str]:\n return self._values.get('prefix')", "def prefix(self) -> typing.Optional[str]:\n return self._values.get('prefix')", "def prefix(self) -> typ...
[ "0.8380622", "0.8380622", "0.8363356", "0.8363356", "0.8363356", "0.83399963", "0.83399963", "0.8309719", "0.82662296", "0.82662296", "0.82662296", "0.8106413", "0.80589676", "0.8014214", "0.7835368", "0.7776197", "0.7772175", "0.77160835", "0.76984036", "0.76984036", "0.7698...
0.83942115
0
Get the actual value of this value. (e.g. 10 ns > 1e9)
def value(self) -> float: return self._value * self._prefix
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value(self) -> float:\n return pulumi.get(self, \"value\")", "def value(self) -> float:\n return pulumi.get(self, \"value\")", "def get_t_value(self):\n return float(self.data[2]) / 10", "def __float__(self):\n return self.micros() / 1000000.0", "def value(self) -> Optional[...
[ "0.766291", "0.766291", "0.75711644", "0.7373624", "0.73642254", "0.73617727", "0.73385894", "0.7306384", "0.7273736", "0.7273736", "0.7273736", "0.7251572", "0.71604335", "0.71604335", "0.71604335", "0.7156556", "0.71227515", "0.7118567", "0.7075169", "0.69625294", "0.695686...
0.72715956
11
Get this value in the given prefix. e.g. "ns", "mV", etc.
def value_in_units(self, prefix: str, round_zeroes: bool = True) -> float: # e.g. extract "n" from "ns" or blank if it's blank (e.g. "V" -> "") letter_prefix = "" if prefix != self.unit: letter_prefix = "" if prefix == "" else prefix[0] retval = self._value * (self._prefix /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_key_group_value(self, prefix):\r\n return self.get(prefix, 0)", "def __init__(self, value: str, prefix: Optional[str] = None) -> None:\n import re\n\n default_prefix = get_or_else(prefix, self.default_prefix)\n\n regex = r\"^(-?[\\d.]+) *(.*){}$\".format(re.escape(self.unit))\...
[ "0.6545774", "0.64610213", "0.6451306", "0.63316613", "0.63316613", "0.6318682", "0.6318682", "0.6318682", "0.6223908", "0.62179166", "0.61228144", "0.6106077", "0.60550314", "0.60550314", "0.6023333", "0.6023333", "0.60072017", "0.5932636", "0.5902027", "0.5872409", "0.58686...
0.73336035
0
Get this value in the given prefix but including the units. e.g. return "5 ns".
def str_value_in_units(self, prefix: str, round_zeroes: bool = True) -> str: # %g removes trailing zeroes return "%g" % (self.value_in_units(prefix, round_zeroes)) + " " + prefix
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value_in_units(self, prefix: str, round_zeroes: bool = True) -> float:\n # e.g. extract \"n\" from \"ns\" or blank if it's blank (e.g. \"V\" -> \"\")\n letter_prefix = \"\"\n if prefix != self.unit:\n letter_prefix = \"\" if prefix == \"\" else prefix[0]\n\n retval = self...
[ "0.7767109", "0.66928834", "0.6519841", "0.63229734", "0.6318947", "0.6224571", "0.58197325", "0.57916725", "0.5767626", "0.5767626", "0.5767626", "0.5722515", "0.5713658", "0.5713658", "0.5702866", "0.56945306", "0.56730574", "0.56654096", "0.5658151", "0.5638247", "0.561698...
0.70049864
1
Compare equality of this value with another. The types must match.
def eq(self: _TT, other: _TT) -> bool: # pylint: disable=invalid-name if type(self) != type(other): raise TypeError("Types do not match") return self.value_in_units(self.default_prefix) == other.value_in_units(self.default_prefix)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n\n return self.type == other.type and self.value == other.value", "def __eq__(self, other):\r\n\t\treturn (self.type == other.type and self.value == other.value)", "def _is_equal_same_type(self, other):\n return True", "def __eq__(self, other):\n return self.val...
[ "0.8487615", "0.83492357", "0.8080564", "0.7810967", "0.77573514", "0.7740007", "0.7690485", "0.76048404", "0.7589608", "0.75584024", "0.7516329", "0.7493757", "0.7493757", "0.74235433", "0.74088377", "0.73990095", "0.73897755", "0.73827124", "0.7343608", "0.73415744", "0.734...
0.72294253
37
Compare equality of this value with another. The types must match.
def __eq__(self: _TT, other: object) -> bool: return self.eq(other) # type: ignore
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n\n return self.type == other.type and self.value == other.value", "def __eq__(self, other):\r\n\t\treturn (self.type == other.type and self.value == other.value)", "def _is_equal_same_type(self, other):\n return True", "def __eq__(self, other):\n return self.val...
[ "0.8489497", "0.83508813", "0.80812824", "0.7813282", "0.7759384", "0.77418506", "0.7691519", "0.76061225", "0.75919235", "0.7560689", "0.7518358", "0.7496791", "0.7496791", "0.7426171", "0.7410996", "0.7399769", "0.7391777", "0.7384996", "0.73464406", "0.73430836", "0.734204...
0.7189852
43
Compare inequality of this value with another. The types must match.
def ne(self: _TT, other: _TT) -> bool: # pylint: disable=invalid-name if type(self) != type(other): raise TypeError("Types do not match") return not self.eq(other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other):\r\n\t\treturn (self.type != other.type or self.value != other.value)", "def __eq__(self, other):\n return int.__ne__(self, other)", "def __ne__(self, other):\n return not_equal(self, other)", "def __ne__(self, other):\n return int.__eq__(self, other)", "def __n...
[ "0.7789724", "0.7358024", "0.73365855", "0.7321399", "0.73185587", "0.72969794", "0.726275", "0.7210425", "0.71830374", "0.7177267", "0.7163777", "0.7156712", "0.7136913", "0.71352273", "0.71352273", "0.7127493", "0.71195805", "0.7101706", "0.7090631", "0.707465", "0.70697814...
0.74639887
1
Compare inequality of this value with another. The types must match.
def __ne__(self: _TT, other: object) -> bool: return self.ne(other) # type: ignore
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other):\r\n\t\treturn (self.type != other.type or self.value != other.value)", "def ne(self: _TT, other: _TT) -> bool: # pylint: disable=invalid-name\n if type(self) != type(other):\n raise TypeError(\"Types do not match\")\n return not self.eq(other)", "def __eq__(se...
[ "0.7789724", "0.74639887", "0.7358024", "0.73365855", "0.7321399", "0.73185587", "0.72969794", "0.726275", "0.7210425", "0.71830374", "0.7177267", "0.7163777", "0.7156712", "0.7136913", "0.71352273", "0.71352273", "0.7127493", "0.71195805", "0.7101706", "0.7090631", "0.707465...
0.0
-1
Check if self is less than other. The types must match.
def __lt__(self: _TT, other: _TT) -> bool: if type(self) != type(other): raise TypeError("Types do not match") return self.value < other.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __lt__(self, other):\n return self.lessThan(other)", "def __lt__(self, other):\n\n # seems like this should be == -1 but we're using a min heap\n return self._comparator.compare_measurements(self, other) == 1", "def __lt__(self, other: Any) -> bool:\n\n if isinstance(other, Valu...
[ "0.8177419", "0.79188776", "0.79169124", "0.7903571", "0.78901744", "0.7861724", "0.78578293", "0.7849604", "0.7845744", "0.78049344", "0.78003174", "0.78003174", "0.77952206", "0.77952206", "0.7792081", "0.7786218", "0.7763305", "0.77572745", "0.77443147", "0.7683894", "0.76...
0.82047075
0
Check if self is less than or equal to other. The types must match.
def __le__(self: _TT, other: _TT) -> bool: if type(self) != type(other): raise TypeError("Types do not match") return self.value <= other.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ge__(self: _TT, other: _TT) -> bool:\n if type(self) != type(other):\n raise TypeError(\"Types do not match\")\n return self.value >= other.value", "def __lt__(self: _TT, other: _TT) -> bool:\n if type(self) != type(other):\n raise TypeError(\"Types do not match\"...
[ "0.8269749", "0.8156888", "0.7959218", "0.782644", "0.77851874", "0.77851874", "0.77802277", "0.7744213", "0.770726", "0.76717806", "0.7658956", "0.7649101", "0.76487803", "0.76363945", "0.76281005", "0.76281005", "0.76222974", "0.7605231", "0.76008826", "0.7593185", "0.75652...
0.8232501
1
Check if self is greater than other. The types must match.
def __gt__(self: _TT, other: _TT) -> bool: if type(self) != type(other): raise TypeError("Types do not match") return self.value > other.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gt__(self, other):\n return self.greaterThan(other)", "def __gt__(self, other):\n return greater(self, other)", "def __gt__(self, other):\n if isinstance(other, type(self)):\n return self.number > other.number\n return NotImplemented", "def __gt__(self, other):\n ...
[ "0.81865174", "0.8154882", "0.8097635", "0.80737174", "0.80651623", "0.79862756", "0.7908505", "0.7908505", "0.7897956", "0.7880695", "0.7827148", "0.78116065", "0.7770164", "0.77450734", "0.7710154", "0.7675555", "0.7668449", "0.7646003", "0.7645967", "0.7642438", "0.7638837...
0.84351224
0
Check if self is greater than or equal to other. The types must match.
def __ge__(self: _TT, other: _TT) -> bool: if type(self) != type(other): raise TypeError("Types do not match") return self.value >= other.value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gt__(self: _TT, other: _TT) -> bool:\n if type(self) != type(other):\n raise TypeError(\"Types do not match\")\n return self.value > other.value", "def __gt__(self, other):\n try:\n return self.length2 > other.length2\n except AttributeError:\n r...
[ "0.83619857", "0.79011303", "0.7867107", "0.7860233", "0.7860233", "0.7816087", "0.77685213", "0.77589154", "0.77209496", "0.76975673", "0.76957923", "0.7693637", "0.7683857", "0.7682663", "0.7681263", "0.7644248", "0.7611871", "0.76117724", "0.7608347", "0.7548623", "0.75484...
0.79357976
1
Add other and self. The types must match.
def __add__(self: _TT, other: _TT) -> _TT: if type(self) != type(other): raise TypeError("Types do not match") return type(self)(str(self.value + other.value),"")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __add__(self, other):\n raise NotImplementedError(\"Implement this if needed\")", "def _add(self, other):\n raise NotImplementedError(\n \"{} does not support addition\".format(type(self)))", "def __add__(self, other):\n raise NotImplementedError", "def __add__(self, other...
[ "0.84498745", "0.84130085", "0.8263157", "0.8263157", "0.8167373", "0.81477696", "0.81411535", "0.81411535", "0.8125277", "0.8097161", "0.80855507", "0.80210125", "0.80131054", "0.8011747", "0.7838893", "0.7798971", "0.7747998", "0.7718135", "0.77049744", "0.77047026", "0.765...
0.76568204
21
Subtract other from self. The types must match.
def __sub__(self: _TT, other: _TT) -> _TT: if type(self) != type(other): raise TypeError("Types do not match") return type(self)(str(self.value - other.value),"")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __sub__(self, other):\n return self.subtract(other)", "def subtract(self, other):\n return self.add(other.neg())", "def __sub__(self, other):\n return self.__add__(other.__neg__())", "def __sub__(self, other):\n return Difference(self, other)", "def __isub__(self, other):\n ...
[ "0.8162423", "0.8061757", "0.8008258", "0.78790694", "0.78551775", "0.7832752", "0.7816616", "0.78045857", "0.77872884", "0.77777314", "0.77621174", "0.77621174", "0.77544135", "0.7721392", "0.7713871", "0.77000594", "0.768165", "0.7656395", "0.7656395", "0.7549816", "0.75114...
0.77478105
13
Divide self by a float or an integer.
def __div__(self: _TT, other: float) -> _TT: raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __div__(self, other):\n if isinstance(other, (int, float)):\n return self * (1 / other)\n else:\n raise TypeError(\"Cannot divide vector by {}\".format(other))", "def __float__(self):\n return self.num / self.denom # result of / is of type float", "def __float__(...
[ "0.7320664", "0.69769216", "0.68392104", "0.67019427", "0.6665211", "0.6632792", "0.6573752", "0.65672463", "0.6504861", "0.6484198", "0.64667606", "0.64667606", "0.6462356", "0.6447575", "0.6424389", "0.642397", "0.6388483", "0.6358386", "0.6299705", "0.6291538", "0.62612695...
0.70374024
1
Multiply self by a float or an integer.
def __mul__(self: _TT, other: float) -> _TT: return type(self)(str(self.value * other),"")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __mul__(self, other):\n if type(other) == int:\n other = float(other)\n\n if type(other) == float:\n other = Tensor(other)\n\n return F.Mul.apply(self, other)", "def mul(self, b):\n self.a *= float(b)", "def __mul__(self, other):\n # print other\n ...
[ "0.746456", "0.74008584", "0.69636357", "0.69331527", "0.6896253", "0.6732022", "0.6716748", "0.6716622", "0.6689995", "0.66637236", "0.66038084", "0.6579064", "0.6557357", "0.6550477", "0.6539418", "0.65228546", "0.6500558", "0.6485024", "0.6470488", "0.6463008", "0.6459259"...
0.6993518
2
Default is plain volts (e.g. "0.1" > 0.1 V).
def default_prefix(self) -> str: return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vol(data):\n vol = re.search(\"[^a-zA-Z](v\\s*o\\s*l\\s*\\.?\\s*[^a-zA-Z\\n,]+)\",\n data, re.IGNORECASE)\n # Check if the search result contains at least a digit\n if has_num(vol.group()):\n return ''.join([num for num in vol.group() if num.isdigit()])\n return '(nf)'...
[ "0.6248852", "0.6132869", "0.5956207", "0.59514725", "0.5886631", "0.5851418", "0.57665557", "0.5765345", "0.5717004", "0.5715589", "0.56967413", "0.56261235", "0.55732507", "0.55618525", "0.55560267", "0.55431825", "0.548996", "0.54645324", "0.54476786", "0.5446104", "0.5423...
0.0
-1
Default is plain degrees Celsius (e.g. "25" > "25 C").
def default_prefix(self) -> str: return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fahr_to_celsius(temp):\n tempInCel = (temp - 32) * 5/9\n return tempInCel", "def to_celsius(degrees):\n return (degrees - 32) * (5/9)", "def convert_to_celsius(self):\n try:\n self.root.ids.fahrenheit_input.hint_text = 'Enter amount in Fahrenheit'\n self.root.ids.celsi...
[ "0.7114742", "0.70627195", "0.7028331", "0.70053196", "0.69676816", "0.6908136", "0.68408805", "0.6737831", "0.670488", "0.6697212", "0.6691799", "0.66807866", "0.66803306", "0.6575728", "0.657497", "0.65448105", "0.65448105", "0.65448105", "0.65448105", "0.65448105", "0.6544...
0.0
-1
Validate added security group consistent even after vm migration. This test verifies the traffic after migrating the vms across the host in a cluster is consistent.
def test_vm_migration_across_hosts(self): # Create security group for the server group_create_body_update, _ = self._create_security_group() # Create server with security group name = data_utils.rand_name('server-with-security-group') server_id = self._create_server_with_sec_gr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_08_security_group(self):\n # Validate the following:\n # 1. Create a project\n # 2. Assign some security groups to that project\n # 3. Verify the security groups can only be assigned to VM belonging\n # to that project.\n\n security_group = SecurityGroup.create...
[ "0.7178881", "0.70037806", "0.6828526", "0.66916764", "0.657983", "0.6543968", "0.6481899", "0.63965064", "0.6386143", "0.636805", "0.6284797", "0.6166038", "0.6160074", "0.60916567", "0.60476494", "0.5986398", "0.5939112", "0.58760035", "0.5817561", "0.5788604", "0.5755191",...
0.6191417
11
Verify port update after moving a VM from one host to another host
def test_port_update_after_vm_migration(self): # Create security group for the server group_create_body_update, _ = self._create_security_group() # Create server with security group name = data_utils.rand_name('server-with-security-group') server_id = self._create_server_with_se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_vm_migration(self):\n self.check_vm_host_after_migration(positive=True)", "def test_vm_migration(self):\n self.check_vm_host_after_migration(positive=True)", "def test_vm_migration(self):\n self.check_vm_host_after_migration(positive=False)", "def test_vm_migration(self):\n ...
[ "0.69940156", "0.69940156", "0.69489974", "0.69489974", "0.6794242", "0.6575186", "0.6541067", "0.6435429", "0.64352536", "0.64352536", "0.6385107", "0.62896746", "0.61800104", "0.61411965", "0.613042", "0.613016", "0.6078066", "0.60733455", "0.6018333", "0.6010813", "0.60108...
0.69380987
4
Make default values for query loads from file Inputs
def _make_query_defaults(fpath=None): if issubclass(fpath.__class__, dict): return fpath if fpath is None: dirname = os.path.dirname(__file__) fpath = os.path.join(dirname, 'gaia_query_defaults.json') with open(fpath, 'r') as file: defaults = json.load(file) defaults[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_default_parameters(self):\n super().set_default_parameters()\n if not \"replace_existing_files\" in vars(self):\n self.replace_existing_files = False\n if not \"num_files_per_point\" in vars(self):\n self.num_files_per_point = -1\n if not \"input_location_t...
[ "0.60389036", "0.601876", "0.5980216", "0.58689564", "0.58154815", "0.57716036", "0.5697071", "0.5696502", "0.5696502", "0.5669771", "0.5663183", "0.56288123", "0.5566678", "0.55634654", "0.5559713", "0.5559713", "0.5547716", "0.5538425", "0.5533474", "0.55144423", "0.5504232...
0.61275357
0
Makes the SELECT portion of a gaia query
def _make_query_SELECT(user_cols=None, use_AS=True, all_columns=False, gaia_mags=False, panstarrs1=False, query=None, defaults=None): #################### # Defaults defaults = _make_query_defaults(defaults) if use_AS is False: # replace with blank dict ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_query(self):", "def query(self, query):", "def visit_query(self, query):\n return query", "def generate_query(self):\n return", "def make_simple_gaia_query(WHERE=None, ORDERBY=None, user_cols=None,\n FROM=None, all_columns=False,\n ...
[ "0.64430755", "0.6442068", "0.615831", "0.61445934", "0.6131003", "0.61132264", "0.59930974", "0.5955837", "0.5937012", "0.5934444", "0.58332866", "0.581894", "0.57986873", "0.57915705", "0.578208", "0.5773503", "0.5758811", "0.5740433", "0.5710199", "0.5698792", "0.5687067",...
0.59111494
10
Make the FROM portion of a gaia query
def _make_query_FROM(FROM=None, inmostquery=False, _tab=' '): # FROM if FROM is None: FROM = 'gaiadr2.gaia_source' else: # Tab level FROM = _tab + FROM FROM = FROM.replace('\n', '\n{tab}'.format(tab=_tab)) if inmostquery is False: p1, p2 ='(\n', '\n)' else...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter(self, **kwargs):\n kwargs['query'] += ' FROM {0}'\n return kwargs", "def make_simple_gaia_query(WHERE=None, ORDERBY=None, user_cols=None,\n FROM=None, all_columns=False,\n panstarrs1=False, gaia_mags=False, user_ASdict=None,\n ...
[ "0.6614978", "0.61699456", "0.6159343", "0.58413786", "0.5812289", "0.5739446", "0.5714148", "0.56808925", "0.566304", "0.5579747", "0.5577638", "0.5536559", "0.54920757", "0.5476934", "0.5460719", "0.5455013", "0.5453083", "0.5445262", "0.5438601", "0.5314289", "0.5314045", ...
0.76869965
0
Add tab level to query indents the whoel query by the tab level INPUTS
def _query_tab_level(query, tablevel, _tab=' '): # Tab level query = (_tab * tablevel) + query query = query.replace('\n', '\n{tab}'.format(tab=_tab * tablevel)) return query
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def indent(self):\n cursor = self.parent.textCursor()\n # Check if something is selected\n if cursor.hasSelection():\n # get the line/block nr\n temp = cursor.blockNumber()\n # Move to last line of the selection\n cursor.setPosition(cursor.selectionE...
[ "0.59627014", "0.5929822", "0.57490826", "0.5587191", "0.55496967", "0.5524422", "0.55157614", "0.5461489", "0.54595464", "0.54595464", "0.54491377", "0.5444654", "0.54384845", "0.53927594", "0.53513", "0.53413427", "0.5338122", "0.5308848", "0.5278413", "0.52711105", "0.5251...
0.7476199
0
Makes a whole Gaia query INPUTS
def make_gaia_query(WHERE=None, ORDERBY=None, user_cols=None, FROM=None, use_AS=False, all_columns=False, panstarrs1=False, gaia_mags=False, user_ASdict=None, inmostquery=False, defaults=None, _tab=' ', pprint=False): query = _make_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_query(self):", "def query3() :", "def query(self, query):", "def query(self):", "def request(query):", "def _get_queries(args):\n if args.mode == '2DSEQ':\n queries = [\"@type=='2dseq'\", \"@is_spectroscopy==True\", \"@is_complex==True\"]\n elif args.mode == 'FID':\n queries ...
[ "0.704493", "0.6805561", "0.6736679", "0.651075", "0.64275736", "0.6379464", "0.6321146", "0.6177671", "0.61580193", "0.60477513", "0.5905798", "0.5864041", "0.58513844", "0.57891357", "0.57891357", "0.57891357", "0.57891357", "0.5750254", "0.5728295", "0.56535566", "0.558617...
0.55082023
25
make_gaia_query wrapper for singlelayer queries with some defaults changed and options removed use_AS and inmostquery are now True. _tab is set to default
def make_simple_gaia_query(WHERE=None, ORDERBY=None, user_cols=None, FROM=None, all_columns=False, panstarrs1=False, gaia_mags=False, user_ASdict=None, defaults=None, pprint=False): return make_gaia_query(WH...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_gaia_query(WHERE=None, ORDERBY=None, user_cols=None,\n FROM=None, use_AS=False, all_columns=False,\n panstarrs1=False, gaia_mags=False, user_ASdict=None,\n inmostquery=False, defaults=None, _tab=' ',\n pprint=False):\n\n que...
[ "0.6972428", "0.6177298", "0.59810084", "0.5893489", "0.5882486", "0.5809476", "0.5776969", "0.57672256", "0.5734848", "0.57066286", "0.56771684", "0.56697667", "0.56555134", "0.55999047", "0.5582388", "0.55091554", "0.548246", "0.5457023", "0.5439728", "0.5434059", "0.542945...
0.7225929
0
Role definition assignable scopes.
def assignable_scopes(self) -> Optional[Sequence[str]]: return pulumi.get(self, "assignable_scopes")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scope(self): # noqa: ANN201", "def resourcescope(self, **content):\n self.resource_scopes.update(content)\n self.resource_scopes.update(self.overwrite_resource_scopes)", "def sync_role_definitions(self) -> None:\n\n logger.info(\"Syncing role definition\")\n\n self.create_custo...
[ "0.60752875", "0.6011554", "0.5966682", "0.58738226", "0.5784672", "0.5532327", "0.5522923", "0.5497077", "0.54913694", "0.5475104", "0.54418015", "0.5439452", "0.54112625", "0.5387419", "0.5387419", "0.5361026", "0.535442", "0.53304493", "0.5325078", "0.53107214", "0.5287417...
0.6489873
0
The role definition description.
def description(self) -> Optional[str]: return pulumi.get(self, "description")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_description(cls, role: \"AccountRole\"):\n return {\n cls.MEMBER.name: \"Can create, update and delete projects.\",\n cls.MANAGER.name: \"As for member and can create, update and delete teams.\",\n cls.OWNER.name: \"As for manager and can also add and remove users an...
[ "0.7291691", "0.713695", "0.6822831", "0.67424566", "0.67307407", "0.67307407", "0.67175555", "0.6639696", "0.6635819", "0.6635819", "0.65242153", "0.65151143", "0.6494775", "0.64869565", "0.64869565", "0.64869565", "0.6442813", "0.64203185", "0.6412879", "0.6356025", "0.6356...
0.0
-1
The role definition ID.
def id(self) -> str: return pulumi.get(self, "id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def role_definition_id(self) -> str:\n return pulumi.get(self, \"role_definition_id\")", "def role_definition_id(self) -> str:\n return pulumi.get(self, \"role_definition_id\")", "def role_definition_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"role_definition_id\"...
[ "0.92847645", "0.92847645", "0.89062196", "0.87532693", "0.73740727", "0.7302534", "0.71669817", "0.65901786", "0.64608437", "0.6436954", "0.643008", "0.6317053", "0.6286119", "0.62274575", "0.6195852", "0.6175391", "0.6090258", "0.60839397", "0.60839397", "0.60839397", "0.60...
0.0
-1
The role definition name.
def name(self) -> str: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def role_definition_id(self) -> str:\n return pulumi.get(self, \"role_definition_id\")", "def role_definition_id(self) -> str:\n return pulumi.get(self, \"role_definition_id\")", "def role(self) -> str:\n\n assert self.data is not None\n return self.data[\"role\"][\"name\"]", "def...
[ "0.7743742", "0.7743742", "0.7698516", "0.7415485", "0.72732705", "0.7130731", "0.7030387", "0.6917913", "0.688072", "0.67929935", "0.6619846", "0.6619846", "0.65851176", "0.65649706", "0.6559848", "0.6522246", "0.64689267", "0.64689267", "0.64689267", "0.6463127", "0.6463127...
0.0
-1
The role definition type.
def type(self) -> str: return pulumi.get(self, "type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def role(self):\n _DEPRECATION_ERROR_ATTRIBUTE(\n self, \"role\", \"Use attribute 'construct_type' instead\"\n ) # pragma: no cover", "def role_definition_id(self) -> str:\n return pulumi.get(self, \"role_definition_id\")", "def role_definition_id(self) -> str:\n return ...
[ "0.6698811", "0.6515991", "0.6515991", "0.64343756", "0.6321531", "0.62716305", "0.6129937", "0.6101933", "0.6066323", "0.60542077", "0.60542077", "0.60542077", "0.6051389", "0.60352767", "0.6028405", "0.6020705", "0.59910566", "0.5984608", "0.5984608", "0.5984608", "0.598460...
0.0
-1
Creates get server time request.
def create_get_server_time_request(self) -> Request:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_time_request(self, time_request=None, **kwargs):\n pass", "async def server_time(self):\n uri = \"/fapi/v1/time\"\n success, error = await self.request(\"GET\", uri)\n return success, error", "async def server_time(self):\n uri = \"/v3/time\"\n success, error ...
[ "0.71161586", "0.710048", "0.7074786", "0.63061607", "0.6067773", "0.6006844", "0.5954438", "0.5925175", "0.5921816", "0.5905734", "0.58900654", "0.5886727", "0.5805509", "0.57868576", "0.5767524", "0.56739175", "0.56166404", "0.55978155", "0.55939704", "0.5588009", "0.557775...
0.92682254
0
Creates get exchange information request.
def create_get_exchange_info_request(self) -> Request:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_exchange_info(self):\n return self.request.get(path=\"/info\")", "async def exchange_information(self):\n uri = \"/fapi/v1/exchangeInfo\"\n success, error = await self.request(\"GET\", uri)\n return success, error", "def info_request():\n return SentmanRequest(Sentman...
[ "0.6371393", "0.626008", "0.61865425", "0.5915095", "0.5806554", "0.57620054", "0.56828505", "0.56110024", "0.5597447", "0.5590681", "0.55883807", "0.5579138", "0.55778676", "0.5576951", "0.55403996", "0.55241215", "0.55219364", "0.54678017", "0.54575783", "0.54566455", "0.54...
0.9146309
0
Creates get order book request.
def create_get_order_book_request(self, symbol: str, limit: Optional[int] = None ) -> Request:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_get_order_book_ticker_request(self, symbol: Optional[str] = None) -> Request:", "def create_get_active_orders_request(self, symbol: Optional[Symbol] = None) -> Request:\n\n method = \"GET\"\n path = \"/order\"\n params: Params = {}\n if symbol is not None:\n para...
[ "0.732504", "0.6521436", "0.6265566", "0.6235177", "0.6190984", "0.6113074", "0.60771656", "0.600444", "0.58509076", "0.58471024", "0.58257186", "0.5825667", "0.5776991", "0.57641727", "0.57420135", "0.57350874", "0.5727396", "0.57121", "0.57111156", "0.5689941", "0.5679834",...
0.8088169
0
Creates get trades request.
def create_get_trades_request(self, symbol: str, limit: Optional[int] = None ) -> Request:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_trades(self, custom_id=None, **params):\n self.conn.send('getTrades', custom_id=custom_id, **params)", "def create_get_old_trades_request(self, symbol: str,\n limit: Optional[int] = None,\n from_id: Optional[int] = None\...
[ "0.70739233", "0.6914997", "0.6770701", "0.6479608", "0.6251119", "0.6111586", "0.6002261", "0.59284556", "0.5846841", "0.582136", "0.5813551", "0.5812295", "0.55721855", "0.5497863", "0.54819024", "0.54717994", "0.544952", "0.54111767", "0.54066515", "0.54021704", "0.5368807...
0.77220756
0
Creates get old trades request.
def create_get_old_trades_request(self, symbol: str, limit: Optional[int] = None, from_id: Optional[int] = None ) -> Request:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_get_trades_request(self, symbol: str,\n limit: Optional[int] = None\n ) -> Request:", "async def get_trades(self) -> List[TradeRequest]:\n data = j.dumps({\n 'startindex': 0,\n 'statustype': 'inbound'\n ...
[ "0.68606144", "0.5969047", "0.5944057", "0.585075", "0.5561133", "0.5437442", "0.543485", "0.5401337", "0.5395618", "0.53787464", "0.5301194", "0.53001654", "0.5294499", "0.52473414", "0.52418077", "0.51947874", "0.51888263", "0.51588106", "0.5120697", "0.51170117", "0.507229...
0.77538776
0
Creates get aggregate trades request.
def create_get_aggregate_trades_request(self, symbol: str, from_id: Optional[int] = None, start_time: Optional[int] = None, end_time: Optional[int] = None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_get_trades_request(self, symbol: str,\n limit: Optional[int] = None\n ) -> Request:", "def get_aggregate_trades(self, **params):\n return self._get('aggTrades', data=params)", "async def get_trades(self) -> List[TradeRequest]:\...
[ "0.68014985", "0.6169688", "0.6037264", "0.599703", "0.5987353", "0.5858652", "0.5748156", "0.5577184", "0.53568965", "0.5333962", "0.51393855", "0.51202315", "0.5112776", "0.5110323", "0.5027064", "0.5026124", "0.497617", "0.4972202", "0.49705622", "0.49700186", "0.496191", ...
0.7781773
0
Creates get candles request.
def create_get_candles_request(self, symbol: str, interval: CandleInterval, start_time: Optional[int] = None, end_time: Optional[int] = None, limit: Optional[int] = None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def candles(Symbol='tBTCUSD', TimeFrame='1m', Section='last', **params):\n endpoint = f'candles/trade:{TimeFrame}:{Symbol}/{Section}'\n return request(authenticate=False, version=2, endpoint=endpoint, method='GET', query_params=params)", "def create_get_order_book_ticker_request(self, symbol: Optional[str]...
[ "0.6428837", "0.63910097", "0.6307044", "0.6032909", "0.5932165", "0.5737868", "0.5690126", "0.5639366", "0.56390595", "0.5533687", "0.54466134", "0.5438658", "0.54099303", "0.5408952", "0.53919846", "0.53648704", "0.5350378", "0.53325224", "0.5304621", "0.52980816", "0.52812...
0.7876789
0
Creates get average price request.
def create_get_average_price_request(self, symbol: str) -> Request:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def market_avg_price(**params):\n endpoint = 'calc/trade/avg'\n return request(authenticate=False, version=2, endpoint=endpoint, method='POST', query_params=params)", "def get_avg_price(request):\n Domestic = list((\n Domesticinvoice.objects.values(\"part_number\")\n .order_by(\"part_n...
[ "0.74623203", "0.621032", "0.59907883", "0.5593431", "0.55899495", "0.55266565", "0.5448381", "0.536205", "0.5281099", "0.5275768", "0.52384526", "0.52199763", "0.5152695", "0.51318204", "0.5119559", "0.509412", "0.50874466", "0.5057626", "0.50513655", "0.5045796", "0.5042818...
0.8379332
0
Creates get 24 hr ticker price change statistics request.
def create_get_ticker_price_change_stat_request(self, symbol: Optional[str] = None) -> Request:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_get_price_ticker_request(self, symbol: Optional[str] = None) -> Request:", "async def stocks(request: Request, ticker, period=\"1d\", interval=\"1d\"):\n logger.info(F\"NewApiRequest: /stocks/{ticker} - Client: {request.client.host}\")\n result = req_yfinance_data(ticker, period, interval)\n ...
[ "0.6441152", "0.6221633", "0.59904134", "0.59666836", "0.59625936", "0.59306914", "0.58434874", "0.58414406", "0.580836", "0.58030313", "0.5784473", "0.57638127", "0.5753864", "0.57435334", "0.5716701", "0.57016826", "0.57014763", "0.5695598", "0.5677654", "0.56690216", "0.56...
0.75477177
0
Creates get price ticker request.
def create_get_price_ticker_request(self, symbol: Optional[str] = None) -> Request:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_get_order_book_ticker_request(self, symbol: Optional[str] = None) -> Request:", "def create_get_ticker_price_change_stat_request(self, symbol: Optional[str] = None) -> Request:", "def ticker(Symbol='tBTCUSD', **params):\n endpoint = f'ticker/{Symbol}'\n return request(authenticate=False, versi...
[ "0.7758816", "0.7129887", "0.67537385", "0.65345323", "0.6506096", "0.64805275", "0.642444", "0.62744725", "0.6256892", "0.62148654", "0.6125416", "0.6053881", "0.60432076", "0.6020693", "0.6019181", "0.6018983", "0.59284323", "0.59092075", "0.5872912", "0.5797917", "0.579233...
0.83962804
0
Creates get order book ticker request.
def create_get_order_book_ticker_request(self, symbol: Optional[str] = None) -> Request:
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_get_order_book_request(self, symbol: str,\n limit: Optional[int] = None\n ) -> Request:", "def create_get_price_ticker_request(self, symbol: Optional[str] = None) -> Request:", "def create_get_active_orders_request(self, symbo...
[ "0.77037174", "0.73872566", "0.66121036", "0.6435228", "0.63414663", "0.63413537", "0.63181764", "0.6157562", "0.61130935", "0.6103782", "0.6067148", "0.6040989", "0.6039777", "0.59814703", "0.5929844", "0.5920914", "0.58353144", "0.5794885", "0.57883084", "0.57195693", "0.56...
0.84829605
0
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments.
def __init__(self, *args, **kwds): if args or kwds: super(LIMITS_STATUS, self).__init__(*args, **kwds) #message fields cannot be None, assign default values for those that are if self.sysid is None: self.sysid = 0 if self.compid is None: self.compid = 0 if self.limits_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ...
[ "0.7794013", "0.7718835", "0.7718835", "0.7685622", "0.76249295", "0.7561895", "0.74385226", "0.74156964", "0.73515606", "0.7307414", "0.72803426", "0.7237456", "0.72262406", "0.7222833", "0.7222833", "0.7218459", "0.72099864", "0.72099864", "0.72099864", "0.72099864", "0.720...
0.0
-1
serialize message into buffer
def serialize(self, buff): try: _x = self buff.write(_struct_3B4IH3B.pack(_x.sysid, _x.compid, _x.limits_state, _x.last_trigger, _x.last_action, _x.last_recovery, _x.last_clear, _x.breach_count, _x.mods_enabled, _x.mods_required, _x.mods_triggered)) except struct.error as se: self._check_types(struc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self, buff):\n try:\n _x = self\n buff.write(_struct_2d2q14dq.pack(_x.tcp, _x.ori, _x.zone, _x.vacuum, _x.workx, _x.worky, _x.workz, _x.workq0, _x.workqx, _x.workqy, _x.workqz, _x.toolx, _x.tooly, _x.toolz, _x.toolq0, _x.toolqx, _x.toolqy, _x.toolqz, _x.ret))\n _x = self.msg\n ...
[ "0.6972838", "0.6802016", "0.6796291", "0.67317253", "0.66948694", "0.66847515", "0.6658851", "0.6626311", "0.66227144", "0.6618303", "0.6607444", "0.65361035", "0.6529462", "0.65220654", "0.64863104", "0.6467052", "0.64530367", "0.6438432", "0.6427743", "0.6426063", "0.63947...
0.61143404
68
unpack serialized message in str into this message instance
def deserialize(self, str): try: end = 0 _x = self start = end end += 24 (_x.sysid, _x.compid, _x.limits_state, _x.last_trigger, _x.last_action, _x.last_recovery, _x.last_clear, _x.breach_count, _x.mods_enabled, _x.mods_required, _x.mods_triggered,) = _struct_3B4IH3B.unpack(str[start:e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deserialize(self, str):\n try:\n end = 0\n _x = self\n start = end\n end += 152\n (_x.tcp, _x.ori, _x.zone, _x.vacuum, _x.workx, _x.worky, _x.workz, _x.workq0, _x.workqx, _x.workqy, _x.workqz, _x.toolx, _x.tooly, _x.toolz, _x.toolq0, _x.toolqx, _x.toolqy, _x.toolqz, _x.ret,) = _stru...
[ "0.7633603", "0.74642533", "0.732128", "0.73038477", "0.72709143", "0.7223599", "0.72191226", "0.7175671", "0.71700495", "0.709591", "0.7095633", "0.70419884", "0.70281994", "0.6962232", "0.6956503", "0.6955446", "0.69451785", "0.6942254", "0.6942078", "0.6912403", "0.6894626...
0.67458564
30
serialize message with numpy array types into buffer
def serialize_numpy(self, buff, numpy): try: _x = self buff.write(_struct_3B4IH3B.pack(_x.sysid, _x.compid, _x.limits_state, _x.last_trigger, _x.last_action, _x.last_recovery, _x.last_clear, _x.breach_count, _x.mods_enabled, _x.mods_required, _x.mods_triggered)) except struct.error as se: self._chec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize_numpy(self, buff, numpy):\n try:\n pass\n except struct.error as se: self._check_types(se)\n except TypeError as te: self._check_types(te)", "def serialize_numpy(self, buff, numpy):\n try:\n _x = self\n buff.write(_struct_2d2q14dq.pack(_x.tcp, _x.ori, _x.zone, _x.vacuum, ...
[ "0.79946846", "0.79733205", "0.7894134", "0.78557587", "0.7741082", "0.767947", "0.7658682", "0.7627832", "0.75884074", "0.75668263", "0.7563204", "0.7563108", "0.75591797", "0.7544295", "0.75356185", "0.7529538", "0.7527064", "0.7518283", "0.751168", "0.750116", "0.74992543"...
0.7288833
56
unpack serialized message in str into this message instance using numpy for array types
def deserialize_numpy(self, str, numpy): try: end = 0 _x = self start = end end += 24 (_x.sysid, _x.compid, _x.limits_state, _x.last_trigger, _x.last_action, _x.last_recovery, _x.last_clear, _x.breach_count, _x.mods_enabled, _x.mods_required, _x.mods_triggered,) = _struct_3B4IH3B.unpac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deserialize_numpy(self, str, numpy):\n try:\n end = 0\n _x = self\n start = end\n end += 152\n (_x.tcp, _x.ori, _x.zone, _x.vacuum, _x.workx, _x.worky, _x.workz, _x.workq0, _x.workqx, _x.workqy, _x.workqz, _x.toolx, _x.tooly, _x.toolz, _x.toolq0, _x.toolqx, _x.toolqy, _x.toolqz, _x....
[ "0.8089381", "0.7977111", "0.7917557", "0.7906678", "0.78938705", "0.78324383", "0.7812286", "0.7810312", "0.7784814", "0.7759985", "0.7740565", "0.77144724", "0.7713694", "0.76961666", "0.7692816", "0.76852655", "0.76734024", "0.76390827", "0.7637298", "0.76295316", "0.76239...
0.74325603
44
Create a quantized module from a float module.
def from_float(cls, mod, rt_spec): assert rt_spec, 'Runtime spec must be provided for quantized module.' assert type(mod) == cls._FLOAT_MODULE, \ '{}.from_float() only accepts {}, but got {}'.format( cls.__name__, cls._FLOAT_MODULE, type(mod)) if rt_spec.config: approx_mode = rt_spe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_float(cls, mod, qconfig=None):\n assert type(mod) == cls._FLOAT_MODULE, 'qat.' + cls.__name__ + '.from_float only works for ' + \\\n cls._FLOAT_MODULE.__name__\n if not qconfig:\n assert hasattr(mod, 'qconfig'), 'Input float module must have qconfig defined'\n ...
[ "0.5964679", "0.5546134", "0.539766", "0.53756374", "0.53318864", "0.509586", "0.50848216", "0.50687", "0.50204843", "0.5019796", "0.49529195", "0.4937981", "0.4924518", "0.49216995", "0.49216995", "0.49122363", "0.49056807", "0.48999634", "0.48298004", "0.48293215", "0.48261...
0.6295467
0
Converts the result to a report string.
def get_report(self, cmd: CompileCommand) -> str: cmd_line_str = shlex_join(self.clang_tidy_cmd_line) report_helper = ReportHelper() report_helper.add_items([ ("clang-tidy input file", cmd.rel_file_path), ("clang-tidy command line", cmd_line_str), ("Success",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ReportStringForResult(self):\n return self._reportstringforresult", "def formatResult(self, result):\r\n return str(result)", "def _to_string(self):\n self.results.print_results()\n self.results.print_comparison()", "def report_text(self):\n # type: () -> Optional[AnySt...
[ "0.7588318", "0.7077909", "0.7047003", "0.69582903", "0.66876906", "0.6684218", "0.66395324", "0.6553416", "0.6527297", "0.6367176", "0.6314035", "0.63128984", "0.63068676", "0.62298846", "0.6199471", "0.6117863", "0.6107905", "0.61073196", "0.6097745", "0.6039566", "0.603110...
0.59223455
29
Get operating profile information from Services.Service. This is used if VehicleJourney does not contain the information.
def get_service_operative_days_info(data): try: reg_weekdays = data.TransXChange.Services.Service.OperatingProfile.RegularDayType.DaysOfWeek.get_elements() weekdays = [] for elem in reg_weekdays: weekdays.append(elem._name) if len(weekdays) == 1: return weekda...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def os_profile(self) -> pulumi.Output[Optional['outputs.OSProfileResponse']]:\n return pulumi.get(self, \"os_profile\")", "def os_profile(self) -> Optional[pulumi.Input['OSProfileArgs']]:\n return pulumi.get(self, \"os_profile\")", "def test_ucs_get_serviceProfile(self):\n api_data = reque...
[ "0.6485337", "0.6206977", "0.57241213", "0.5448196", "0.5407499", "0.533839", "0.5318977", "0.5285577", "0.5218922", "0.52165645", "0.52060455", "0.52026814", "0.5198788", "0.51943624", "0.5192773", "0.517744", "0.5139162", "0.51334214", "0.511963", "0.5090074", "0.506123", ...
0.6011837
2
Parses weekday info from TransXChange VehicleJourney element
def get_weekday_info(vehicle_journey_element): j = vehicle_journey_element try: reg_weekdays = j.OperatingProfile.RegularDayType.DaysOfWeek.get_elements() weekdays = [] for elem in reg_weekdays: weekdays.append(elem._name) if len(weekdays) == 1: return wee...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weekday(self, *args, **kwargs): # real signature unknown\r\n pass", "def weekday(self):\n return 0", "def weekday(self):\n return 0", "def _add_weekday(cab_data):\n return cab_data.assign(weekday=lambda x: x.time.dt.weekday)", "def day_of_the_week(arg):", "def get_weekday():\n...
[ "0.5879346", "0.580937", "0.580937", "0.572081", "0.56893337", "0.5650452", "0.5637283", "0.5607974", "0.56014806", "0.5592245", "0.5551809", "0.554587", "0.55122876", "0.55105877", "0.548227", "0.54800606", "0.5450938", "0.5450938", "0.54231006", "0.53793997", "0.5354168", ...
0.73737246
0
Parse day range from TransXChange DayOfWeek element
def parse_day_range(dayinfo): # Converters weekday_to_num = {'monday': 0, 'tuesday': 1, 'wednesday': 2, 'thursday': 3, 'friday': 4, 'saturday': 5, 'sunday': 6} num_to_weekday = {0: 'monday', 1: 'tuesday', 2: 'wednesday', 3: 'thursday', 4: 'fr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sacred_wednesdays_in_range(range):\n a = range[0]\n b = range[1]\n wed = DayOfWeek.Wednesday.on_or_after(a)\n h_date = HinduLunarDate.from_fixed(wed)\n ell = [wed] if (h_date.day == 8) else []\n if is_in_range(wed, range):\n ell[:0] = sacred_wednesdays_in_range([wed + 1, ...
[ "0.5496665", "0.543932", "0.5376049", "0.53370285", "0.53251046", "0.53128916", "0.52130604", "0.52100086", "0.51588666", "0.51536095", "0.51492774", "0.5116746", "0.51075894", "0.51075894", "0.5061645", "0.5046265", "0.5030777", "0.49754682", "0.49712953", "0.49668193", "0.4...
0.57446337
0
Parse calendar attributes from GTFS info DataFrame
def get_calendar(gtfs_info): # Parse calendar use_cols = ['service_id', 'weekdays', 'start_date', 'end_date'] calendar = gtfs_info.drop_duplicates(subset=use_cols) calendar = calendar[use_cols].copy() calendar = calendar.reset_index(drop=True) # Container for final results gtfs_calendar = p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_gdelt(self, data):\n event_columns = data.split('\\t')\n\n event_id = event_columns[0]\n event_day = event_columns[1]\n log.debug('Processing GlobalEventID|Day: \"%s|%s\"' %\n (event_id, event_day))\n self.event_id = event_id\n self.event_day =...
[ "0.54350966", "0.5254869", "0.5206205", "0.5167809", "0.51677114", "0.51135755", "0.5051638", "0.49221087", "0.4899555", "0.48970625", "0.48751247", "0.48377562", "0.48232663", "0.47850588", "0.47701675", "0.47611856", "0.47551274", "0.47356272", "0.47324926", "0.4717232", "0...
0.58480823
0
initiate a ADB connection from serial no the serial no should be in output of `adb devices`
def __init__(self, device): self.logger = logging.getLogger('ADB') self.device = device self.cmd_prefix = ['adb'] r = subprocess.check_output(['adb', 'devices']).split('\n') if not r[0].startswith("List of devices attached"): raise ADBException() online_devi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect(self):\n # open serial port\n try:\n #device = self.get_device_name(self.serial_number)\n device = \"/dev/ttyAMA0\"\n self.serial.port = device\n # Set RTS line to low logic level\n self.serial.rts = False\n self.serial.ope...
[ "0.67472816", "0.65029484", "0.64100915", "0.6381892", "0.6342285", "0.6325248", "0.63164395", "0.6304663", "0.61662054", "0.6122394", "0.6122376", "0.6105283", "0.6094325", "0.6092108", "0.6060073", "0.6025387", "0.5989021", "0.59819984", "0.59798574", "0.59719366", "0.59409...
0.6257876
8
run an adb command and return the output
def run_cmd(self, extra_args): if isinstance(extra_args, str) or isinstance(extra_args, unicode): extra_args = extra_args.split() if not isinstance(extra_args, list): msg = "invalid arguments: %s\nshould be list or str, %s given" % (extra_args, type(extra_args)) self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adb_call(self, *args):\n cmds = ['adb', '-s', self._serial] + list(args)\n logger.debug(\"RUN: %s\", subprocess.list2cmdline(cmds))\n return subprocess.call(cmds)", "def adb(self, command):\n\n self.android_device_driver.adb.raw_cmd(command)", "def _do_adb_command(self, cmd, timeout...
[ "0.77839327", "0.7782089", "0.7441324", "0.65842384", "0.6568436", "0.6467626", "0.6247571", "0.6188062", "0.61494297", "0.60836667", "0.6079937", "0.60534143", "0.5969787", "0.5964977", "0.594977", "0.59213686", "0.59148526", "0.589085", "0.5890752", "0.5876091", "0.58655304...
0.63799727
6
run an `adb shell` command
def shell(self, extra_args): if isinstance(extra_args, str) or isinstance(extra_args, unicode): extra_args = extra_args.split() if not isinstance(extra_args, list): msg = "invalid arguments: %s\nshould be list or str, %s given" % (extra_args, type(extra_args)) self.lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adb(self, command):\n\n self.android_device_driver.adb.raw_cmd(command)", "def adb_call(self, *args):\n cmds = ['adb', '-s', self._serial] + list(args)\n logger.debug(\"RUN: %s\", subprocess.list2cmdline(cmds))\n return subprocess.call(cmds)", "def shell(cmd):\n return G.DEVICE.s...
[ "0.7564464", "0.7304644", "0.703009", "0.68937296", "0.64927363", "0.63763684", "0.63204384", "0.63204384", "0.62837964", "0.62414473", "0.6222676", "0.61897874", "0.61544037", "0.61306256", "0.60718423", "0.60510087", "0.5996491", "0.5981081", "0.5951952", "0.5948671", "0.59...
0.6144514
13
check if adb is connected
def check_connectivity(self): r = self.run_cmd("get-state") return r.startswith("device")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_device_connected(device_id):\n try:\n device_name = subprocess.check_output([ADB_EXECUTOR, '-s', device_id, 'shell', 'getprop', 'ro.product.model'])\n device_name = device_name.decode(DEFAULT_CHARSET).replace('\\n', '').replace('\\r', '')\n logger.info('device {} online'.format(devic...
[ "0.73818606", "0.7364723", "0.73521507", "0.7299695", "0.72198457", "0.70618016", "0.70165664", "0.70124036", "0.6980912", "0.6940776", "0.68797505", "0.68780655", "0.68642193", "0.6814958", "0.6766598", "0.6758024", "0.67454946", "0.6730256", "0.67227554", "0.67028314", "0.6...
0.7338357
3
get the value of property
def get_property(self, property): return self.shell(["getprop", property])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_property_value(self, property, db):\n try:\n for p in self.properties:\n if p.idProperty == int(property):\n return p.get_value()\n except:\n return None", "def get_property(self,name):\n...
[ "0.7941893", "0.7909971", "0.77775764", "0.7767588", "0.77223784", "0.77041876", "0.76570535", "0.7650142", "0.7638551", "0.76133937", "0.76112604", "0.749107", "0.73521394", "0.7293686", "0.72851413", "0.72355616", "0.72355616", "0.72355616", "0.72355616", "0.72355616", "0.7...
0.8040457
0
Get version of SDK, e.g. 18, 20
def get_sdk_version(self): return int(self.get_property(ADB.VERSION_SDK_PROPERTY))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sdk_version() -> str:\n return definitions.get_sdk_version()", "def version(self) -> str:\n return utils._auxiliary.get_current_sdk_version()", "def get_version():\n click.echo(get_current_version_number())", "def get_minimum_sdk(self):\n return self.minimum_sdk", "def clml_...
[ "0.8255099", "0.78960824", "0.7217137", "0.7184722", "0.7184337", "0.717295", "0.71220213", "0.7114795", "0.7055784", "0.70247614", "0.69913155", "0.69021213", "0.6900543", "0.68793565", "0.6876516", "0.68452424", "0.6832525", "0.67988247", "0.6773105", "0.67716837", "0.67678...
0.76126605
2
Get release version, e.g. 4.3, 6.0
def get_release_version(self): return self.get_property(ADB.VERSION_RELEASE_PROPERTY)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version():\n vers = [\"%(major)i.%(minor)i\" % __version_info__, ]\n\n if __version_info__['micro']:\n vers.append(\".%(micro)i\" % __version_info__)\n if __version_info__['releaselevel'] != 'final':\n vers.append('%(releaselevel)s' % __version_info__)\n return ''.join(vers)", "...
[ "0.77913886", "0.76947", "0.76920176", "0.7547371", "0.74932665", "0.748319", "0.74643856", "0.74372", "0.74146926", "0.7410422", "0.7371019", "0.7371019", "0.7371019", "0.7309727", "0.7307411", "0.7293789", "0.7246911", "0.72350556", "0.7227028", "0.7217797", "0.71741927", ...
0.77419925
1
Gets C{mDefaultViewport} and then C{deviceWidth} and C{deviceHeight} values from dumpsys. This is a method to obtain display dimensions and density
def getDisplayInfo(self): displayInfo = {} logicalDisplayRE = re.compile(".*DisplayViewport\{valid=true, .*orientation=(?P<orientation>\d+)," " .*deviceWidth=(?P<width>\d+), deviceHeight=(?P<height>\d+).*") dumpsys_display_result = self.shell("dumpsys displa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPhysicalDisplayInfo(self) -> Dict[str, Union[int, float]]:\n phyDispRE = re.compile(\n r'.*PhysicalDisplayInfo{(?P<width>\\d+) x (?P<height>\\d+), .*, density (?P<density>[\\d.]+).*')\n ret = self.raw_shell('dumpsys display')\n if m := phyDispRE.search(ret):\n disp...
[ "0.74370897", "0.70635206", "0.68633056", "0.6790453", "0.6726588", "0.67075944", "0.6488533", "0.63612247", "0.63053894", "0.62600154", "0.62398136", "0.62202364", "0.6205368", "0.6180356", "0.61504287", "0.6013623", "0.5996462", "0.5982676", "0.595784", "0.5908984", "0.5905...
0.7067989
1
Get the focused window
def getFocusedWindow(self): for window in self.getWindows().values(): if window.focused: return window return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_focus():\n\n grab = Gtk.grab_get_current()\n if grab:\n return grab\n\n for win in Gtk.Window.list_toplevels():\n if win.get_property('has-toplevel-focus'):\n return win.get_focus()\n return None", "def get_current_window_hwnd():\n\...
[ "0.82754207", "0.7990088", "0.79269695", "0.78902453", "0.7771113", "0.77084357", "0.76523995", "0.7572203", "0.7493838", "0.74732333", "0.7388945", "0.737243", "0.7316451", "0.72121274", "0.71596885", "0.7146752", "0.7128303", "0.7115939", "0.7070776", "0.70313734", "0.70070...
0.89264476
0
Get the focused window name
def getFocusedWindowName(self): window = self.getFocusedWindow() if window: return window.activity return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_window_name():\n\n hwnd = get_current_window_hwnd()\n length = GetWindowTextLength(hwnd)\n buff = ctypes.create_unicode_buffer(length + 1)\n GetWindowText(hwnd, buff, length + 1)\n\n return buff.value", "def get_active_window():\n import sys\n active_window_name = None\n i...
[ "0.8290948", "0.79969233", "0.77145165", "0.7210582", "0.7204464", "0.7195852", "0.7187464", "0.7000211", "0.6848736", "0.6820531", "0.6781241", "0.67631227", "0.67302585", "0.671873", "0.6689578", "0.6682993", "0.66681176", "0.6588884", "0.6539611", "0.6511903", "0.6504544",...
0.8592689
0
Unlock the screen of the device
def unlock(self): self.shell("input keyevent MENU") self.shell("input keyevent BACK")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AutoUnlockScreen(self):\n try:\n adb_unlock_args = _UNLOCK_SCREEN_KEYEVENT % {\n \"adb_bin\": self._adb_command,\n \"device_serial\": self._device_serial}\n subprocess.check_call(adb_unlock_args.split())\n except subprocess.CalledProcessError:\n...
[ "0.78045547", "0.6979634", "0.68082917", "0.66119015", "0.6594464", "0.6511773", "0.6493254", "0.6444232", "0.64277303", "0.6415282", "0.6392453", "0.63728315", "0.63514555", "0.63182056", "0.6295242", "0.6275887", "0.62549883", "0.62520796", "0.6246753", "0.61857814", "0.617...
0.7007274
1
Long touches at (x, y)
def longTouch(self, x, y, duration=2000, orientation=-1): self.drag((x, y), (x, y), duration, orientation)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_longpress(self, str_arg):\n arg = validateString(str_arg)\n # if arg.startswith(r'('):\n # raise ValueError('Bad argument, You may want to use longpress2 with coordinates as auguments.')\n x = 0\n y = 0\n seconds = 2000\n try:\n if arg.startswith(r...
[ "0.6385681", "0.6150676", "0.6017381", "0.5978405", "0.58477354", "0.5800321", "0.5673395", "0.5568427", "0.5531724", "0.5509743", "0.5380173", "0.5319348", "0.53193176", "0.5300884", "0.52711636", "0.5261942", "0.5232455", "0.52198887", "0.5178191", "0.5171264", "0.5168396",...
0.7007885
0
Sends drag event n PX (actually it's using C{input swipe} command.
def drag(self, (x0, y0), (x1, y1), duration, steps=1, orientation=-1): if orientation == -1: orientation = self.getOrientation() (x0, y0) = self.__transformPointByOrientation((x0, y0), orientation, self.getOrientation()) (x1, y1) = self.__transformPointByOrientation((x1, y1), orienta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drag(self, event):\n self.yview('scroll', self.ypos - event.y, 'units')\n self.xview('scroll', self.xpos - event.x, 'units')\n self.ypos = event.y\n self.xpos = event.x", "def ClickAndDrag(self, delta_x=0, delta_y=0):\n self._EnsureHIDValueInRange(delta_x)\n self._EnsureHIDV...
[ "0.62665534", "0.6111395", "0.5892968", "0.5777181", "0.57424283", "0.57383215", "0.57218766", "0.57197344", "0.5630357", "0.56054354", "0.5605419", "0.5514419", "0.5508359", "0.5495053", "0.53900796", "0.5375627", "0.53695005", "0.53499943", "0.53412974", "0.53388983", "0.53...
0.6404803
0