query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
The Interrupt Persistence sets a value which is compared with the accumulated amount of ALS cycles in which results were outside threshold values. Any Proximity or ALS result that is inside threshold values resets the count.\n
def set_als_interrupt_persistence(self, persistence): if not (0 <= persistence <= 15): raise ValueError("Persistence must be in range [0 - 15]") flag = [] for i in range(4): flag.append(bool(persistence & (1 << i))) self.write_flag_data(flag, APDS_9960.INTERRUPT_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_proximity_interrupt_persistence(self, persistence):\n if not (0 <= persistence <= 15):\n raise ValueError(\"persistance must be in range [0-15]\")\n\n flag = []\n for i in range(4):\n flag.append(bool(persistence & (1 << i)))\n self.write_flag_data(flag, AP...
[ "0.5933555", "0.5064672", "0.5031599", "0.50105256", "0.500727", "0.49721605", "0.49680948", "0.4959001", "0.4926938", "0.49013528", "0.4897051", "0.48954308", "0.48909703", "0.48878804", "0.488631", "0.48823065", "0.4871497", "0.48599643", "0.48292905", "0.48122618", "0.4798...
0.6456317
0
The ATIME register controls the internal integration time of ALS/Color analog to digital converters. The maximum count (or saturation) value can be retrieved with the get_saturation method.
def set_als_integration_time(self, wtime): if not (2.78 <= wtime <= 712): raise ValueError("The integration time must be in range [2.78 - 712] millis.") value = 256 - int(wtime / 2.78) self.write_byte_data(value, APDS_9960.ALS_ATIME_REG_ADDRESS)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_saturation(self):\n cycles = 256 - self.read_byte_data(APDS_9960.ALS_ATIME_REG_ADDRESS)\n return min(65535, cycles * 1025)", "def arming_time(self, time):\n self.write(\":FREQ:ARM:STAR:SOUR IMM\")\n self.write(\":FREQ:ARM:STOP:SOUR TIM\")\n self.write((\":FR...
[ "0.64724326", "0.563255", "0.51065123", "0.49832928", "0.4893324", "0.48625252", "0.4853138", "0.48348826", "0.48339704", "0.478559", "0.4782315", "0.47527668", "0.47326314", "0.47261244", "0.47188354", "0.4714407", "0.46628112", "0.4647732", "0.46390954", "0.4639064", "0.462...
0.5712123
1
Returns the saturation value. The values returned by get_color_data can not exceed this value.
def get_saturation(self): cycles = 256 - self.read_byte_data(APDS_9960.ALS_ATIME_REG_ADDRESS) return min(65535, cycles * 1025)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saturation(value):\n value = int(value)\n if value < 0 or value > 254:\n raise ValueError('Minimum saturation is 0, to the maximum 254')\n return value", "def saturation(self):\n raise NotImplementedError", "def SaturationIteration(self):\n\t\treturn self._get_attribute('saturationIt...
[ "0.75432783", "0.7071739", "0.6463091", "0.6442149", "0.63868296", "0.638218", "0.63512975", "0.6325678", "0.6062935", "0.5933715", "0.58989453", "0.58589077", "0.5809527", "0.5754634", "0.5749245", "0.57135993", "0.5665404", "0.56161374", "0.55984116", "0.559381", "0.5559254...
0.7205243
1
Causes immediate entry in to the gesture state machine. (Sets GMODE bit to 1).
def enter_immediately_gesture_engine(self): self.write_flag_data([True], APDS_9960.GESTURE_CONFIG_4_REG_ADDRESS, 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tempo_mode_switch(event):\n value = gremlin.actions.Value(event.is_pressed)\n tempo_mode_switch_container(event, value)", "def reset_gesture_engine_interrupt_settings(self):\n self.write_flag_data([True], APDS_9960.GESTURE_CONFIG_4_REG_ADDRESS, 2)", "def start_game_mode_0(self):\n pygam...
[ "0.64456195", "0.6436026", "0.6280486", "0.604037", "0.6018092", "0.595716", "0.5912481", "0.58597565", "0.57941246", "0.5740382", "0.5719762", "0.5699554", "0.5676315", "0.5588025", "0.5577839", "0.5577839", "0.55683905", "0.5566166", "0.5562105", "0.5535422", "0.55093366", ...
0.7515096
0
Causes exit of gesture when current analog conversion has finished. (Sets GMODE bit to 0).
def exit_gesture_engine(self): self.write_flag_data([False], APDS_9960.GESTURE_CONFIG_4_REG_ADDRESS, 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enter_immediately_gesture_engine(self):\n self.write_flag_data([True], APDS_9960.GESTURE_CONFIG_4_REG_ADDRESS, 0)", "def end_meassuring(self):\n self.enabler = 0\n #self.t.join()\n return 1", "def reset_gesture_engine_interrupt_settings(self):\n self.write_flag_data([True...
[ "0.6204986", "0.61876327", "0.6119402", "0.60128915", "0.58192956", "0.5805768", "0.58045125", "0.5732705", "0.5648836", "0.56200397", "0.5600777", "0.5567693", "0.556139", "0.55331045", "0.5531628", "0.551762", "0.551595", "0.55131304", "0.5508788", "0.5508114", "0.5504611",...
0.7086376
0
The Gesture Proximity Enter Threshold Register value is compared with Proximity value, to determine if the gesture state machine is entered. The proximity persistence filter, is not used to determine gesture state machine entry.\n
def set_gesture_prox_enter_threshold(self, enter_thr): if not (0 <= enter_thr <= 0xFF): raise ValueError("enter_thr must be in range [0-0xFF]") self.write_byte_data(enter_thr, APDS_9960.GESTURE_PROX_ENTER_THR_REG_ADDRESS)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _proximity_thread(self):\n count = 0\n while True:\n print(\"---------------- Analizo si debo detectar enemigos - PROXIMITY\")\n print(\"----- DEBO?? ::::> self.enemy_not_detected = {}\".format(self.enemy_not_detected))\n while self.enemy_not_detected:\n ...
[ "0.5757454", "0.56020814", "0.53926754", "0.5352367", "0.53383684", "0.52304655", "0.5219664", "0.51235837", "0.5075878", "0.50137794", "0.5001173", "0.50007147", "0.49675512", "0.49580908", "0.49561635", "0.49509966", "0.49507138", "0.49507138", "0.49507138", "0.49507138", "...
0.61184835
0
Gesture Gain Control. Sets the gain of the proximity receiver in gesture mode.\n
def set_gesture_gain(self, gesture_gain): if not (APDS_9960.PROXIMITY_GAIN_1X <= gesture_gain <= APDS_9960.PROXIMITY_GAIN_8X): raise ValueError("gesture_gain must be one of PROXIMITY_GAIN_NX.") self.write_flag_data([bool(gesture_gain & 0b01), bool(gesture_gain & 0b10)], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gain(self, value: int):\n self._gain = value", "def set_gain(self, *args):\n return _uhd_swig.usrp_source_set_gain(self, *args)", "def set_gain(self, *args):\n return _uhd_swig.usrp_sink_set_gain(self, *args)", "def servo_gain(self, *args, **kwargs) -> Any:\n pass", "def gai...
[ "0.72236526", "0.7142051", "0.71037644", "0.670552", "0.6676222", "0.6616772", "0.6583288", "0.654424", "0.6536786", "0.636523", "0.6328636", "0.628973", "0.6206066", "0.62003624", "0.6175178", "0.61648065", "0.6162114", "0.6161054", "0.6148989", "0.6107458", "0.60962665", ...
0.78268313
0
Gesture LED Drive Strength. Sets LED Drive Strength in gesture mode.\n
def set_gesture_led_drive(self, led_drive): if not (APDS_9960.LED_DRIVE_100_mA <= led_drive <= APDS_9960.LED_DRIVE_12_5_mA): raise ValueError("led_drive must be one of APDS_9960.LED_DRIVE_N_mA") self.write_flag_data([bool(led_drive & 0b01), bool(led_drive & 0b10)], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setStrength(self, strength):\n self.st = strength", "def _update_strength(self, event=None):\n password = self.password.GetValue()\n nd = calc_password_strength(password, WEB_SPEED)\n self.strength.UpdateStrength(nd)", "def passive(self,target):\r\n target.shield_increase...
[ "0.6159737", "0.58596337", "0.5856965", "0.58434373", "0.58287036", "0.580724", "0.5727781", "0.5701948", "0.56999344", "0.5685342", "0.5637115", "0.5624758", "0.5582452", "0.55279744", "0.55041975", "0.54653424", "0.54322726", "0.53898245", "0.53835577", "0.53776944", "0.532...
0.59419864
1
Gesture Wait Time. The wait time controls the amount of time in a low power mode between gesture detection cycles.\n
def set_gesture_wait_time(self, wait_time): if not (APDS_9960.GESTURE_WAIT_0_MILLIS <= wait_time <= APDS_9960.GESTURE_WAIT_39_2_MILLIS): raise ValueError("wait_time must be one of GESTURE_WAIT_N_MILLIS.") flag = [bool(wait_time & 0b001), bool(wait_time & 0b010), bool(wait_ti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait(wait_time):\n\n time.sleep(wait_time)", "def wait(wait_time=WAIT_TIME):\n # time.sleep(wait_time)\n pass", "def _probe_wait_time(self):\n r = self.probe_cycle_time / float(len(self.servers)) #self.probe_cycle_time=5\n r = max(.25, r) # Cap it at four per second\n ...
[ "0.57153314", "0.57148886", "0.5602625", "0.55212903", "0.54715544", "0.5466659", "0.5333803", "0.5330431", "0.5311649", "0.52756834", "0.5274838", "0.52264786", "0.51597995", "0.5156371", "0.5150652", "0.51452655", "0.51131916", "0.5106126", "0.50989145", "0.5072049", "0.506...
0.69317573
0
The Gesture pulse count sets the number of pulses to be output on the LDR pin. The Gesture Length sets the amount of time the LDR pin is sinking current during a gesture pulse.\n
def set_gesture_pulse_count_and_length(self, pulse_count, pulse_length): if not (1 <= pulse_count <= 64): raise ValueError("pulse_count must be in range [1-64].") if not (APDS_9960.PULSE_LEN_4_MICROS <= pulse_length <= APDS_9960.PULSE_LEN_32_MICROS): raise ValueEr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pulse_width_record(self, pin):\n self._time = time.ticks_us()\n if self._prev_time == 0:\n self._prev_time = self._time\n return\n self.pulse_buffer.append(self._time - self._prev_time)\n self._prev_time = self._time\n self.lenth = self.lenth + 1", "d...
[ "0.58871394", "0.5812478", "0.53247136", "0.52602947", "0.5230236", "0.52116054", "0.51759845", "0.50555176", "0.50435483", "0.50218105", "0.49391502", "0.48018453", "0.47807133", "0.47458133", "0.47376844", "0.47105458", "0.46696803", "0.46682718", "0.4660123", "0.46519205", ...
0.7343269
0
Enables or disables all gesture engine related interrupts.
def enable_gesture_interrupts(self, enable_interrupts=True): self.write_flag_data([enable_interrupts], APDS_9960.GESTURE_CONFIG_4_REG_ADDRESS, 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_gesture_engine_interrupt_settings(self):\n self.write_flag_data([True], APDS_9960.GESTURE_CONFIG_4_REG_ADDRESS, 2)", "def __enableControls(self):\n for key in self._keyMap.keys():\n self.__acceptKeyDown(key)\n self.__acceptKeyUp(key)", "def reset_interrupts(self):\...
[ "0.6738598", "0.593146", "0.5893441", "0.58042115", "0.57367915", "0.57062775", "0.56397986", "0.5504371", "0.5497118", "0.5495267", "0.5455906", "0.5451774", "0.5438363", "0.53805196", "0.5355464", "0.53459203", "0.53361106", "0.53002137", "0.52094555", "0.5185152", "0.51653...
0.7029731
0
Gesture FIFO Threshold. This value is compared with the FIFO Level (i.e. the number of UDLR datasets) to generate an interrupt (if enabled).\n
def set_gesture_fifo_threshold(self, fifo_thr): if not (APDS_9960.FIFO_INT_AFTER_1_DATASET <= fifo_thr <= APDS_9960.FIFO_INT_AFTER_16_DATASETS): raise ValueError("fifo_thr must be one of FIFO_INT_AFTER_N_DATASET(S)") flag = [bool(fifo_thr & 0b01), bool(fifo_thr & 0b10)] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Get_FifoThreshold_Value(self):\r\n return self.__readFromRegister(self.__REG_RW_FIFO_CTRL_REG, self.__MASK_FIFO_CTRL_REG_WTM)", "def get_number_of_datasets_in_fifo(self):\n return self.read_byte_data(APDS_9960.GESTURE_FIFO_LEVEL_REG_ADDRESS)", "def Get_IsFifoGreaterOrEqualThanWatermark_Value(...
[ "0.7217201", "0.6184922", "0.6143215", "0.5877546", "0.5784132", "0.5784132", "0.5784132", "0.5784132", "0.5784132", "0.57625073", "0.5756488", "0.56993127", "0.55141264", "0.54837537", "0.54837537", "0.54837537", "0.5465431", "0.54647267", "0.54647267", "0.5459775", "0.54504...
0.67023325
1
Returns a dictionary containing data about the gesture engine status.
def get_gesture_status(self): status_dict = dict() status = self.read_byte_data(APDS_9960.GESTURE_STATUS_REG_ADDRESS) status_dict["Gesture FIFO Overflow"] = bool(status & 0x02) status_dict["Gesture FIFO Data"] = bool(status & 0x01) return status_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status() -> Dict[str, Any]:", "def get_status(self):\n try:\n status = {\n 'camexptime': self.opt.getParameter(\"ExposureTime\"),\n 'camtemp': self.opt.getParameter(\"SensorTemperatureReading\"),\n 'camspeed': self.opt.getParameter(\"...
[ "0.67118496", "0.6359854", "0.63554245", "0.63188607", "0.63046604", "0.63020104", "0.6280393", "0.62538207", "0.6187765", "0.6148763", "0.6148763", "0.60787195", "0.6050782", "0.6022429", "0.5923977", "0.59058446", "0.5827834", "0.5772614", "0.57632864", "0.5760877", "0.5758...
0.78221256
0
Sets the wait time in WTIME register. This is the time that will pass between two cycles.The wait time should be configured before the proximity and the als engines get enabled.\n
def set_wait_time(self, wtime, long_wait=False): if not (2.78 <= wtime <= 712): raise ValueError("The wait time must be between 2.78 ms and 712 ms") # long_wait self.write_flag_data([long_wait], APDS_9960.CONFIG_1_REG_ADDRESS, 1) # wtime reg_value = 256 - int(wtime /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_wait_time(self, wait_time):\n\n self.wait_time = wait_time", "def set_wait_time(self, wait_time: float) -> float:\n old_value = self.ctx.wait_time\n self.logger.info(\"Previous wait time: %f\", old_value)\n self.ctx.wait_time = wait_time\n self.logger.info(\"Current wai...
[ "0.71683836", "0.704844", "0.6420835", "0.63204366", "0.6306031", "0.6263331", "0.6172487", "0.6112949", "0.6088477", "0.6068016", "0.6060896", "0.6039526", "0.59966606", "0.59099597", "0.58910114", "0.5890448", "0.58388716", "0.58361197", "0.58211887", "0.580388", "0.5752", ...
0.7931268
0
Returns a dict of dbus interfaces.
def get_dbus_ifaces(self): return self._dbus_ifaces
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interfaces():\n network_interfaces = SCNetworkInterfaceCopyAll()\n interfaces = {}\n for interface in network_interfaces:\n interfaces[SCNetworkInterfaceGetLocalizedDisplayName(interface)] = (\n SCNetworkInterfaceGetBSDName(interface),\n SCNetworkInterfaceGetHardwareAddres...
[ "0.7358894", "0.7150124", "0.68616456", "0.6820615", "0.66954243", "0.66954243", "0.66954243", "0.6686356", "0.6671246", "0.6556159", "0.64973927", "0.6446753", "0.6399331", "0.62750125", "0.62499094", "0.6212139", "0.6208432", "0.6115565", "0.5980625", "0.59045655", "0.58903...
0.77575576
0
Returns the loaded SystemBus.
def get_bus(self): return self._bus
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bus_dict(self):\n return self.__bus_dict", "def get_smbus():\n i2c__bus = 1\n # detect the device that is being used\n device = platform.uname()[1]\n\n if device == \"orangepione\": # running on orange pi one\n i2c__bus = 0\n\n elif device == \"orangepipl...
[ "0.6234107", "0.5998028", "0.59519386", "0.5855848", "0.5798353", "0.570983", "0.5569113", "0.55527186", "0.5532193", "0.55319244", "0.54964405", "0.53938514", "0.53630793", "0.53336924", "0.52561456", "0.52470714", "0.52383316", "0.5221863", "0.5217714", "0.5209887", "0.5207...
0.71137506
0
Connects to wicd's dbus interfaces and loads them into a dict.
def connect_to_dbus(self): if not self._connected_to_dbus: self._connected_to_dbus = True proxy_obj = self._bus.get_object("org.wicd.daemon", '/org/wicd/daemon') self.proxy_obj = proxy_obj daemon = dbus.Interface(proxy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dbus_ifaces(self):\n return self._dbus_ifaces", "def get_dbus_iface(self):\n bus = dbus.SessionBus()\n proxy = bus.get_object('org.gnome.OnlineAccounts',\n '/org/gnome/OnlineAccounts')\n #create an interface\n iface=dbus.Interface(proxy, dbus_i...
[ "0.63243794", "0.61948055", "0.6133798", "0.6085817", "0.6025295", "0.5993055", "0.598986", "0.5967712", "0.5866993", "0.57578254", "0.570974", "0.570974", "0.570974", "0.56391793", "0.562033", "0.5609738", "0.5578401", "0.5575785", "0.549144", "0.5474739", "0.5416814", "0....
0.72666514
0
Instanciates the network service identified by nsi_id, according to the infomation contained in the body and placement info.
def instantiate_ns(self, nsi_id, ns_descriptor, vnfds_descriptor, body, placement_info, resources, nestedInfo): # def instantiate_ns(self, nsi_id, ns_descriptor, body, placement_info): instantiationLevel = body.ns_instantiation_level_id # for composition/federation if nestedInfo: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_nat(self, **attrs):\n return self._create(_gw.Service, tenant_id=self.get_project_id(), **attrs)", "def instantiate_ns(self, nsi_id, ns_descriptor, vnfds_descriptor, body, placement_info, resources, nestedInfo):\n # def instantiate_ns(self, nsi_id, ns_descriptor, body, placement_info):\n\n ...
[ "0.6335052", "0.6247537", "0.55753195", "0.5547516", "0.5483825", "0.5348924", "0.5348753", "0.5343674", "0.53388757", "0.52977514", "0.52889186", "0.5284363", "0.5252318", "0.5211557", "0.52037406", "0.51928276", "0.5176395", "0.51586324", "0.51461804", "0.5130979", "0.51220...
0.6352651
0
Scales the network service identified by nsi_id, according to the infomation contained in the body and current instantiation level.
def scale_ns(self, nsi_id, ns_descriptor, vnfds_descriptor, body, current_df, current_il, placement_info): scale_ns_instantiation_level_id = self.extract_target_il(body) blueprint_name = nsi_id + "_" +ns_descriptor['nsd']['nsdIdentifier'] + "_" + scale_ns_instantiation_level_id blueprints = self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scale_ns(self, nsi_id, ns_descriptor, vnfds_descriptor, body, current_df, current_il, placement_info):\n scale_ns_instantiation_level_id = self.extract_target_il(body)\n blueprint_name = nsi_id + \"_\" +ns_descriptor['nsd']['nsdIdentifier'] + \"_\" + scale_ns_instantiation_level_id\n bluep...
[ "0.6663936", "0.53656894", "0.5346644", "0.529986", "0.5265903", "0.51705396", "0.51446146", "0.50951284", "0.49811757", "0.49804008", "0.4920104", "0.49189124", "0.4805336", "0.4800882", "0.47781575", "0.4775109", "0.47595185", "0.47415102", "0.47363317", "0.47081032", "0.46...
0.67621905
0
Terminates the network service identified by nsi_id.
def terminate_ns(self, nsi_id): # undeploying ns_descriptor = ns_db.get_ns_description(nsi_id) rvm_agents_execute_scripts = RvmAgentsExecuteScripts(ns_descriptor) vnfds_json = {} # for each vnf in the NSD, get its json descriptor vnfdIds = ns_descriptor["nsd"]["vnfdId"]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def terminate_ns(self, nsi_id):\n\n # undeploying\n try:\n self.__cloudify_client.executions.start(nsi_id, \"uninstall\")\n log_queue.put([\"DEBUG\", \"CLOUDIFY_WRAPPER: Deployment %s uninstalling started\" % (nsi_id)])\n except Exception as e:\n log_queue.put...
[ "0.71575254", "0.62177163", "0.5835222", "0.56933314", "0.5600671", "0.5458452", "0.5437729", "0.5433288", "0.5391267", "0.5322592", "0.5261191", "0.5252593", "0.5244304", "0.5236414", "0.52300787", "0.52211785", "0.5210781", "0.5204278", "0.5184484", "0.517949", "0.5172703",...
0.71344113
1
Return image description, given card number, orientation, and side
def get_image(self, card_placement, side): transform = dict() for orient in ['left','bottom','right','top']: transform[orient] = dict() transform['left'][0] = 'left' transform['left'][90] = 'top' transform['left'][180] = 'right' transform['left'][270...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getImage(cardTitle, size=\"normal\"):\n page = requests.get(\"https://api.scryfall.com/cards/named?exact=\"+name)\n page_json = json.loads(page.content)\n image_link = page_json[\"image_uris\"][size]\n image_response = requests.get(image_link)\n img = Image.open(BytesIO(image_response.content))\...
[ "0.5829418", "0.5798083", "0.579327", "0.579327", "0.579327", "0.5719987", "0.5631038", "0.5527739", "0.547468", "0.54480004", "0.5408572", "0.5397182", "0.53926843", "0.53478795", "0.5347723", "0.530061", "0.5299182", "0.52908343", "0.52543336", "0.52498025", "0.52470237", ...
0.6755359
0
Return a list of potential include directories The directories are looked for in $ROS_WORKSPACE.
def GetRosIncludePaths(): try: from rospkg import RosPack except ImportError: return [] rospack = RosPack() includes = [] includes.append(os.path.expandvars('$ROS_WORKSPACE') + '/devel/include') for p in rospack.list(): if os.path.exists(rospack.get_path(p) + '/include'):...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def include_dirs(self):", "def include_directories(self):\n\n status, stdout, stderr = self.__xcall__(['--cflags-only-I'])\n\n if status != 0:\n raise RuntimeError(\"error querying --cflags-only-I for package `%s': %s\" % (self.name, stderr))\n\n retval = []\n for token in stdout.split():\n ...
[ "0.7431349", "0.7071893", "0.6695784", "0.6391757", "0.62534636", "0.6206104", "0.61698794", "0.6164818", "0.6162465", "0.61130905", "0.59863424", "0.59671843", "0.595017", "0.5910829", "0.5864319", "0.5818589", "0.5818256", "0.5804679", "0.57835627", "0.57746977", "0.5763365...
0.7856859
0
checks if text is english
def is_english(s): return s.isascii()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_english(text):\n\n lang = langid.classify(text)\n if lang and 'en' in lang[0]:\n return True\n return False", "def is_english (self, testing_string): \n try:\n self.testing_string.encode(encoding='utf-8').decode('ascii')\n except UnicodeDecodeError:\n ...
[ "0.83676195", "0.7401827", "0.7362285", "0.73488593", "0.7216915", "0.6941378", "0.67869246", "0.67321897", "0.6659703", "0.64074117", "0.63667846", "0.6357376", "0.6318342", "0.63002014", "0.6296254", "0.6283613", "0.6254338", "0.61328095", "0.61248124", "0.6075229", "0.6049...
0.7584006
1
Yield samples that match the sizes given in test_set_sizes
def generate_bootstrap_samples(num_samples, test_universe, test_set_sizes): for sample_idx, sample_size in zip(range(num_samples), cycle(test_set_sizes)): yield random.sample(test_universe, sample_size)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_testset_by_size(detections_test, size_of_test):\n np.random.shuffle(detections_test)\n detections_test = detections_test[:size_of_test]\n return detections_test", "def generate_all_sizes():\n dimension = 4\n h = 1\n while h <= dimension:\n w = 1\n while w <= dimension:\n ...
[ "0.7003292", "0.6358629", "0.6354436", "0.63406867", "0.6215302", "0.61314887", "0.61234194", "0.61158", "0.5919841", "0.59143543", "0.5912967", "0.5894723", "0.5880695", "0.58752054", "0.58684736", "0.58575505", "0.58524823", "0.5847237", "0.5845906", "0.5837592", "0.5824021...
0.7094605
0
Calculate the pvalue for the statistic's value given the bootstrap values.
def bootstrap_p_value(bootstrap_stats, stat_value): return 1. - bisect.bisect_left(bootstrap_stats, stat_value) / float(len(bootstrap_stats))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_pvalue(self):\n # Run permutation test\n self.PermutationTest()\n # TS obtained from the original B,T samples\n self.compute_obs_TS()\n \n # Mean and std of the TS distribution\n self.mu = np.mean(self.TS_tilde)\n self.sigma = np.std(s...
[ "0.7119551", "0.6831631", "0.6723791", "0.6578932", "0.63636523", "0.6330244", "0.6273115", "0.61739874", "0.61700726", "0.60664284", "0.6063051", "0.60404253", "0.5994923", "0.59388614", "0.58792776", "0.5878404", "0.58015406", "0.57798564", "0.5777446", "0.5767656", "0.5734...
0.81658536
0
V.InsertUniquePoint((float, float, float), int) > int
def InsertUniquePoint(self, , p_int): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def InsertUniquePoint(self, p_int, p_int_1, p_float=..., p_float=..., p_float=..., *args, **kwargs):\n ...", "def InsertPoint(self, p_int, ):\n ...", "def IsInsertedPoint(self, p_float, p_float_1, p_float_2):\n ...", "def insert_point(mutated_genome,index):\n Xval = random.randint(-int...
[ "0.8360211", "0.70485127", "0.6657257", "0.6240049", "0.6117624", "0.61017", "0.6094638", "0.60448194", "0.6002602", "0.5940192", "0.5917521", "0.590941", "0.5883831", "0.5880281", "0.58686423", "0.58084434", "0.5799359", "0.57562137", "0.5697369", "0.5687507", "0.56654364", ...
0.8587277
1
V.IsInsertedPoint((float, float, float)) > int
def IsInsertedPoint(self, ): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IsInsertedPoint(self, p_float, p_float_1, p_float_2):\n ...", "def ok(self, point):\n return True", "def ok(self, point):\n return True", "def ispoint(x):\n if isvect(x) and x[3] > 0.0:\n return True\n return False", "def HasPoint(self, vtkAMRBox, , , p_float_6, p_float_7, p_f...
[ "0.8541304", "0.6527406", "0.6527406", "0.6503304", "0.64666", "0.62288606", "0.61674756", "0.5932806", "0.58874726", "0.58293164", "0.58153427", "0.5787648", "0.5787648", "0.5770268", "0.57607293", "0.5741381", "0.5737718", "0.5704304", "0.5689921", "0.5685091", "0.5650125",...
0.8298714
1
Return quantity of the order.
def quantity(self): return self._quantity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quantity(self) -> int:\n return self._quantity", "def qty(self):\n return self._qty", "def qty(self):\n return self._qty", "def qty(self):\n return self._qty", "def total_quantity(self) -> int:\n total = 0\n for i in self.order_items:\n total += i.qu...
[ "0.8015016", "0.7847789", "0.7847789", "0.7847789", "0.78415835", "0.7685493", "0.76751775", "0.7309251", "0.715508", "0.707938", "0.7042906", "0.6954872", "0.69489163", "0.6915853", "0.6905254", "0.6826707", "0.6753263", "0.6720973", "0.66257733", "0.6593004", "0.65346134", ...
0.80501735
0
Return order num of the order.
def order_num(self): return self._order_number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_order_number(self):\n return self.__order_number", "def order(self):\n return self.n", "def Order(self) -> int:\n return self.m_order", "def get_last_order_number_used():\n return Order.__last_order_number_used", "def order(self):\n return self._order + 1", "def...
[ "0.79488564", "0.70072585", "0.6980242", "0.6847151", "0.68226755", "0.6744299", "0.6601344", "0.6524124", "0.6422934", "0.64189935", "0.6404078", "0.6331946", "0.62859553", "0.62710696", "0.62633264", "0.62296635", "0.6177362", "0.61700857", "0.61622244", "0.61126214", "0.61...
0.8370637
0
Return item type of the order.
def item_type(self): return self._item_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def item_type(self) -> str:\n return self.__item_type", "def GetItemType(self, item):\r\n\r\n return item.GetType()", "def item_type(self):\n pass", "def _type(self, item):\n return self.cv.type(item)", "def _get_item_type(item_dict):\n\n if 'object' in item_dict:\n ...
[ "0.7878613", "0.7632085", "0.76022285", "0.72713494", "0.7140311", "0.65833795", "0.65375483", "0.653278", "0.64914745", "0.64649284", "0.6431173", "0.6399569", "0.6393856", "0.6391988", "0.63863796", "0.6381702", "0.63592213", "0.6328614", "0.6316727", "0.631637", "0.6296000...
0.78946465
0
Return the factory that can generate the item.
def factory(self): return self._factory
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_factory():", "def get_factory(self):\n\n return Factory(type(self), self.kwargs)", "def factory(self):\n raise NotImplementedError()", "def factory_method(self):\n pass", "def factory_method(self):\n pass", "def _get_factory(self):\n if self._factory_ref is None...
[ "0.7887471", "0.75268686", "0.697487", "0.65337443", "0.65337443", "0.6531187", "0.63111997", "0.62964106", "0.6270321", "0.62666076", "0.6263436", "0.6226908", "0.6197814", "0.6036466", "0.60276216", "0.60200506", "0.597823", "0.59461373", "0.59301263", "0.59115803", "0.5893...
0.75969225
1
Return the holiday that the item for.
def holiday(self): return self._holiday
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _holiday_parser(item):\n\n return item['summary'], item.get('start',{}).get('date'), item.get('end',{}).get('date')", "def holiday_type() -> Holiday:\n return Holiday.EASTER", "def holiday_type() -> Holiday:\n return Holiday.CHRISTMAS", "def get_holiday(self, date):\n if date....
[ "0.72972995", "0.67561626", "0.6577892", "0.6061763", "0.6009833", "0.5928844", "0.5921662", "0.5920972", "0.5895366", "0.5789303", "0.576882", "0.57558805", "0.57488185", "0.5738588", "0.5726189", "0.56056666", "0.5596636", "0.5571406", "0.554734", "0.554123", "0.5535749", ...
0.81748694
0
Return the invalid notes if the item is invalid.
def invalid_notes(self): return self._invalid_notes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invalid_items(self) -> ItemLog:\n if self._invalid_items is None:\n self._invalid_items = ItemLog(self.dir / 'dropped-invalid.log.csv', DROPPED_INVALID_FIELDNAMES, 'id')\n return self._invalid_items", "def validate(self, item):\n attempt, pkg_analyzer, journal_and_issue_data =...
[ "0.6333943", "0.6028125", "0.58779836", "0.56173664", "0.55850476", "0.5572299", "0.5564198", "0.5547777", "0.5545694", "0.54040706", "0.5341804", "0.53410447", "0.5324947", "0.5315656", "0.5315656", "0.5273683", "0.52681017", "0.5253155", "0.52450603", "0.52310336", "0.51989...
0.77436805
0
Set the status to invalid.
def is_invalid(self): self._is_valid = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mark_error(self):\r\n self.status = ERROR", "def invalid(self):\n return (self.status == self.STATUS_INVALID)", "def status(self, status):\n allowed_values = [\"I\", \"A\", \"S\", \"T\", \"D\"]\n if status not in allowed_values:\n raise ValueError(\n \"...
[ "0.67097574", "0.6690293", "0.665468", "0.64974946", "0.6438207", "0.63692117", "0.6282161", "0.6252383", "0.6192", "0.6186325", "0.61751336", "0.617271", "0.61149913", "0.6073517", "0.59190804", "0.58979946", "0.58979946", "0.58979946", "0.58765507", "0.58672804", "0.5861923...
0.69518065
0
Set the invalid notes.
def set_invalid_notes(self, error): self._invalid_notes = error
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invalid_notes(self):\n return self._invalid_notes", "def notes(self, notes: str):\n self._notes = notes", "def notes(self, notes):\n\n self._notes = notes", "def notes(self, notes):\n\n self._notes = notes", "def notes(self, notes):\n\n self._notes = notes", "def no...
[ "0.730826", "0.67267275", "0.66282713", "0.66282713", "0.66282713", "0.66282713", "0.66282713", "0.6261393", "0.6240077", "0.6159089", "0.6155227", "0.60829383", "0.599079", "0.5827429", "0.5736566", "0.5701913", "0.5699494", "0.5683367", "0.5591186", "0.5569768", "0.547599",...
0.84916085
0
Returns the volume for tetrahedras volume specified by the indexes A to D.
def volume_tetrahedron(xyz, A, B, C, D): AD = xyz[A, :] - xyz[D, :] BD = xyz[B, :] - xyz[D, :] CD = xyz[C, :] - xyz[D, :] V = ( (BD[:, 0] * CD[:, 1] - BD[:, 1] * CD[:, 0]) * AD[:, 2] - (BD[:, 0] * CD[:, 2] - BD[:, 2] * CD[:, 0]) * AD[:, 1] + (BD[:, 1] * CD[:, 2] - BD[:, 2] * CD...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def axisDist2angledTubeVol(x, r, D, A):\n # return nan if nan provided\n if np.isnan(x):\n return x\n\n\n a = np.deg2rad(A)\n p1 = r-(r*np.cos(a))\n p2 = r+(r*np.cos(a))\n R12 = p2-p1\n d = D-x\n D1 = D-p1\n D2 = D-p2 \n\n \n if x < D2:\n if a == 0:\n ...
[ "0.6061158", "0.59955364", "0.5901134", "0.58852816", "0.58514327", "0.56547886", "0.5585238", "0.5480292", "0.54227465", "0.5333869", "0.52877015", "0.5269688", "0.52646565", "0.5262885", "0.5262885", "0.5262885", "0.52567464", "0.5251512", "0.5222472", "0.5217979", "0.52089...
0.656877
0
function [N] = face_info(y,A,B,C,D) Returns the averaged normal, area, and edge lengths for a given set of faces. If average option is FALSE then N is a cell array {nA,nB,nC,nD}
def face_info(xyz, A, B, C, D, average=True, normalize_normals=True, **kwargs): if "normalizeNormals" in kwargs: warnings.warn( "The normalizeNormals keyword argument has been deprecated, please use normalize_normals. " "This will be removed in discretize 1.0.0", Deprecat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_face_dimensions(face):\n vertical = filter_vertical_edges(face.edges, face.normal).pop()\n horizontal = filter_horizontal_edges(face.edges, face.normal).pop()\n return horizontal.calc_length(), vertical.calc_length()", "def calcFaceAreas(x,y,z):\n (nLonP1, nLatP1) = x.shape\n (nLon, nLat) = (...
[ "0.6128122", "0.5623433", "0.5455483", "0.53822756", "0.5266499", "0.52573895", "0.52217734", "0.5124519", "0.5121855", "0.51065016", "0.50514275", "0.49905944", "0.49698538", "0.49379957", "0.49335214", "0.49335214", "0.49173236", "0.49082252", "0.490456", "0.48455828", "0.4...
0.69601613
0
Loads model by primary key
def load_by_pk(cls, _pk): try: return cls.q.get(_pk) except SQLAlchemyError: cls.s.rollback() raise
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_by_id(self, model, key_name):\n return model.get_by_id(key_name)", "def load_model(self) -> Any:", "def get_by_id(self, pkId: int):\n if not self.model:\n raise NameError('database model has not been set.')\n if not pkId:\n raise ValueError('invalid primary key va...
[ "0.70651364", "0.6780844", "0.6774344", "0.6482686", "0.646522", "0.64646775", "0.6379586", "0.6347097", "0.6278477", "0.62661743", "0.6229536", "0.61591846", "0.61561114", "0.6148742", "0.61474085", "0.6110309", "0.6107565", "0.60854894", "0.6079037", "0.60689956", "0.606445...
0.6947319
1
Loads existing model or creates new with specified params
def load_or_create(cls, **_params): result = cls.load_by_params(**_params) try: if not result: result = cls.create(**_params) return result except SQLAlchemyError: cls.s.rollback() raise
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model(self) -> Any:", "def get_or_initialize_model(self, payload):\n try:\n model = self.get_model(payload)\n except DoesNotExistException:\n model = self.initialize_model()\n\n model.id = payload.get('local_id', model.id)\n return model", "def create_...
[ "0.65934944", "0.65590775", "0.6513674", "0.6513674", "0.6363146", "0.63582635", "0.6342739", "0.63159627", "0.63078123", "0.6289935", "0.6281164", "0.6264362", "0.62459695", "0.61406463", "0.61226374", "0.610249", "0.6092199", "0.6066695", "0.606548", "0.605637", "0.60524654...
0.6859225
0
Dumps model to JSON. Also dumps all it's relations. Useful in handlers, where we want to return model in JSON to client. In `_except_fields` you can specify fields, which you don't want to see in an output JSON (i.e. `password`).
def data(self, *_except_fields, **kwargs): _max_level = kwargs.get('max_level', 2) def model_to_dict(obj, ignore_fields=list(), back_relationships=set(), max_level=2, current_level=0): current_level += 1 ignore_in_cur_iteration = list() for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dump_model(self):", "def serialize(cls, model, *fields):\n\n if fields:\n raw_model = {field: model.get(field) for field in fields}\n\n else:\n raw_model = {field: model.get(field) for field in cls.fields}\n\n if 'posted_at' in raw_model:\n raw_model['pos...
[ "0.67281026", "0.61066914", "0.607794", "0.603821", "0.6022249", "0.6012465", "0.5979109", "0.59433246", "0.59128547", "0.5836147", "0.57523715", "0.56892914", "0.5668894", "0.5653489", "0.5605367", "0.5582743", "0.5582743", "0.5582743", "0.55505604", "0.55456686", "0.5518192...
0.634077
1
Returns JSONscheme of all tables from current DB. If you pass `only_self=True`, it returns only scheme for current table of model, which is taken from `cls`
def schema(cls, only_self: bool=False): try: md_tbls = cls.metadata.tables insp = reflection.Inspector.from_engine(cls.s.bind.engine) tbls = dict() for tbl in insp.get_table_names(): if not only_self or (only_self and tbl == cls.__tablename__): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tables(self):\n return Table.objects.filter(schema__database=self)", "def getTable(self):\n return self.db.table(self.entity)", "def db_table(self):", "def meta_db_tables(self) -> list:\r\n def _passer(**kwargs):\r\n data = self.engine.execute(\"\"\"\r\n SEL...
[ "0.58558553", "0.5649703", "0.5498926", "0.5450927", "0.54185534", "0.5340448", "0.52658796", "0.5190706", "0.5184151", "0.51694363", "0.51438534", "0.5143179", "0.5114235", "0.50626093", "0.50591", "0.50570554", "0.5045505", "0.50410146", "0.5040687", "0.50340265", "0.502784...
0.7112505
0
Test import of nashville half off coupons from feed xml
def test_nash_half_off_feed(self): feed_provider_name = "Nashville Half Off Deals" advertiser = Advertiser.objects.get(id=114) advertiser.is_emailable = False advertiser.unemailablereason = 2 # do not email this advertiser advertiser.save() coupon_count = 2 feed_u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_incentrev_scrape_coupons(self):\n feed_provider_name = \"IncentRev Coupon Scrape\"\n advertiser = Advertiser.objects.get(id=114)\n feed_url = \"http://bmlnm.incentrev.com/\"\n FeedProvider.objects.create(name=feed_provider_name,\n advertiser=advertiser, feed_url=feed...
[ "0.62421864", "0.6081836", "0.57239056", "0.5553608", "0.5408395", "0.5300064", "0.52758473", "0.5225514", "0.51674193", "0.5122483", "0.50906634", "0.50708205", "0.5040356", "0.4978729", "0.49634647", "0.4955896", "0.49540544", "0.48912942", "0.48896828", "0.48893234", "0.48...
0.609456
1
Assert sync of coupon business to SugarCRM
def test_sync_biz_to_sugar_coupon(self): LOG.debug('test_sync_biz_to_sugar_coupon') consumer = Consumer.objects.get(id=300) consumer.first_name = 'Danielle' consumer.last_name = 'Dongo' consumer.save() coupon = Coupon.objects.get(id=300) location = Location.object...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fake_sync_biz_to_sugar(self):\n LOG.debug('config.TEST_MODE: %s' % str(config.TEST_MODE))\n if config.TEST_MODE:\n coupon = Coupon.objects.get(id=300)\n sync_business_to_sugar(coupon=coupon)\n self.assertTrue(True)", "def test_update_coupon_definition(self):\n ...
[ "0.7443322", "0.7388754", "0.71110976", "0.71038574", "0.6866979", "0.679285", "0.66437405", "0.65857124", "0.6511695", "0.6365888", "0.6344713", "0.63403803", "0.61000824", "0.6031989", "0.6018751", "0.5987457", "0.58690345", "0.5826196", "0.58079934", "0.5797071", "0.576107...
0.8059085
0
Assert sync of offer business to SugarCRM
def test_sync_biz_to_sugar_offer(self): LOG.debug('test_sync_biz_to_sugar_offer') #business = Business.objects.get(id=114) consumer = Consumer.objects.get(id=300) consumer.first_name = 'Danielle' consumer.last_name = 'Dongo' consumer.save() offer = Offer.objects.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_sync_biz_to_sugar(self):\n LOG.debug('test_sync_biz_to_sugar')\n consumer = Consumer.objects.get(id=300)\n consumer.first_name = 'Danielle'\n consumer.last_name = 'Dongo'\n consumer.save()\n business = Business.objects.get(id=114)\n business.business_name =...
[ "0.7203027", "0.6902418", "0.6616441", "0.6555277", "0.6442863", "0.624157", "0.6141938", "0.6139024", "0.61344576", "0.6126873", "0.6095541", "0.60492224", "0.60330796", "0.60225266", "0.6018561", "0.6014029", "0.59683883", "0.59544384", "0.59514916", "0.5950562", "0.5947972...
0.79798996
0
Assert business synched to SugarCRM and get_sugar_relationship.
def test_sync_biz_to_sugar(self): LOG.debug('test_sync_biz_to_sugar') consumer = Consumer.objects.get(id=300) consumer.first_name = 'Danielle' consumer.last_name = 'Dongo' consumer.save() business = Business.objects.get(id=114) business.business_name = 'test14 biz...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_sync_modify_biz_from_sugar(self):\n LOG.debug('test_sync_modify_biz_from_sugar')\n sync_business_from_sugar(get_modified=True, sugar=self.sugar)\n self.assertTrue(True)", "def test_sync_from_sugar_contact(self):\n LOG.debug('test_sync_from_sugar_contact')\n business = ...
[ "0.7130112", "0.7045469", "0.68213195", "0.66852915", "0.6457075", "0.6441253", "0.63051504", "0.5865568", "0.57541513", "0.56637245", "0.5626019", "0.558659", "0.5575909", "0.5566339", "0.55663025", "0.5534019", "0.55004907", "0.5476099", "0.5469382", "0.5463141", "0.5458386...
0.75713044
0
Assert that a SugarCRM task will be created for this business.
def test_create_sugar_reminder_task(self): LOG.debug('test_create_sugar_reminder_task') business = Business.objects.get(id=114) subject = 'Test task' offset_days = 120 create_sugar_reminder_task(self.sugar, business, subject, offset_days) # get parent_id from get_entry_li...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create(self):\n Todo = self.env[\"todo.task\"]\n task = Todo.create({'name': 'Test Task'})\n self.assertItemsEqual(task.is_done, False)", "def test_user_01_newtask(self):\r\n # Del previous TaskRuns\r\n self.create()\r\n self.del_task_runs()\r\n\r\n # Reg...
[ "0.7182495", "0.69349855", "0.6839725", "0.6669995", "0.6632623", "0.65959543", "0.65847784", "0.6427798", "0.6418475", "0.64059", "0.6247542", "0.622359", "0.6222988", "0.6190438", "0.6183464", "0.61740184", "0.61312586", "0.61312586", "0.61285764", "0.61160403", "0.6107462"...
0.761346
0
Assert that sugar create coupon expires task completes
def test_create_sugar_cpn_exp_task(self): offset_days = 2 coupon = Coupon.objects.get(id=416) coupon.expiration_date = (datetime.date.today() + datetime.timedelta(days=offset_days)) coupon.save() self.assertEqual(create_sugar_coupon_expire_task(MockSugar(), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_sugar_cc_exp_task(self):\n current_date = datetime.datetime.now()\n order = Order.objects.create(billing_record_id=114)\n credit_card = CreditCard.objects.get(id=500)\n credit_card.exp_month = int(current_date.strftime(\"%m\"))\n credit_card.exp_year = int(current...
[ "0.68798816", "0.6572687", "0.6529624", "0.6429473", "0.641452", "0.6319681", "0.63013834", "0.6182696", "0.61526746", "0.6136876", "0.6083815", "0.6065378", "0.6035142", "0.60144424", "0.60144424", "0.60060614", "0.5955513", "0.59325475", "0.59280187", "0.5923616", "0.591271...
0.77054924
0
Assert that sugar create cc expire task completes.
def test_create_sugar_cc_exp_task(self): current_date = datetime.datetime.now() order = Order.objects.create(billing_record_id=114) credit_card = CreditCard.objects.get(id=500) credit_card.exp_month = int(current_date.strftime("%m")) credit_card.exp_year = int(current_date.strfti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_sugar_cpn_exp_task(self):\n offset_days = 2\n coupon = Coupon.objects.get(id=416)\n coupon.expiration_date = (datetime.date.today() + \n datetime.timedelta(days=offset_days))\n coupon.save()\n self.assertEqual(create_sugar_coupon_expire_task(MockSugar()...
[ "0.73353577", "0.7269789", "0.6586084", "0.64264536", "0.6367853", "0.631532", "0.6197102", "0.607421", "0.6005354", "0.6001555", "0.5989575", "0.59839094", "0.58908397", "0.583277", "0.5800318", "0.57816434", "0.575709", "0.57498825", "0.571332", "0.57026815", "0.5695674", ...
0.7577372
0
Assert that sugar sync all businesses task completes.
def test_sync_all_to_sugar(self): self.assertEqual(sync_all_to_sugar(sugar=MockSugar()), None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_all_parts_completed(self, syn):\n\n upload = self._init_upload_attempt(syn)\n\n upload_id = \"1234\"\n parts_state = \"11\"\n\n create_status_response = {\n \"uploadId\": upload_id,\n \"partsState\": parts_state,\n \"state\": \"UPLOADING\",\n ...
[ "0.62963516", "0.6295621", "0.621548", "0.62080395", "0.6192989", "0.6173972", "0.6164685", "0.6074397", "0.60276186", "0.60241795", "0.59956443", "0.5966392", "0.5952906", "0.5945244", "0.5940101", "0.5938747", "0.592649", "0.59052604", "0.5902428", "0.5901853", "0.5889295",...
0.6495739
0
Interpolate all the columns of a matrix `fp` based on new values `x`
def multiInterp(x, xp, fp, extrap='bounded'): # Sanity x = np.asarray(x) xp = np.asarray(xp) assert fp.shape[1]==len(xp), 'Second dimension of fp should have the same length as xp' j = np.searchsorted(xp, x) - 1 dd = np.zeros(len(x)) bOK = np.logical_and(j>=0, j< len(xp)-1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interpArray(x, xp, fp, extrap='bounded'):\r\n # Sanity\r\n xp = np.asarray(xp)\r\n assert fp.shape[1]==len(xp), 'Second dimension of fp should have the same length as xp'\r\n\r\n j = np.searchsorted(xp, x) - 1\r\n if j<0:\r\n # Before bounds\r\n if extrap=='bounded':\r\n ...
[ "0.6965829", "0.6590167", "0.64857244", "0.64553636", "0.64214194", "0.6270792", "0.61107546", "0.59749234", "0.5958125", "0.59576446", "0.5905598", "0.58379525", "0.5791142", "0.5704261", "0.5675316", "0.5542017", "0.5498557", "0.54851395", "0.5475216", "0.5469916", "0.54636...
0.7065358
0
Interpolate all the columns of a matrix `fp` based on one new value `x`
def interpArray(x, xp, fp, extrap='bounded'): # Sanity xp = np.asarray(xp) assert fp.shape[1]==len(xp), 'Second dimension of fp should have the same length as xp' j = np.searchsorted(xp, x) - 1 if j<0: # Before bounds if extrap=='bounded': return fp[:,0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multiInterp(x, xp, fp, extrap='bounded'):\r\n # Sanity\r\n x = np.asarray(x)\r\n xp = np.asarray(xp)\r\n assert fp.shape[1]==len(xp), 'Second dimension of fp should have the same length as xp'\r\n\r\n j = np.searchsorted(xp, x) - 1\r\n dd = np.zeros(len(x))\r\n bOK = np.logical_and(j...
[ "0.705838", "0.6619287", "0.6555274", "0.6444966", "0.6392715", "0.6249282", "0.6101598", "0.6089653", "0.5984777", "0.59563166", "0.58954734", "0.57981503", "0.57871944", "0.5667313", "0.5612767", "0.5533479", "0.5526936", "0.54846734", "0.5482374", "0.54413885", "0.5436352"...
0.69804823
1
1st order low pass filter
def lowpass1(y, dt, fc=3) : tau=1/(2*np.pi*fc) alpha=dt/(tau+dt) y_filt=np.zeros(y.shape) y_filt[0]=y[0] for i in np.arange(1,len(y)): y_filt[i]=alpha*y[i] + (1-alpha)*y_filt[i-1] return y_filt
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_low_pass(x, filt_data, cutoff, fs, order=1, rows=[0,-1]):\n\n from scipy.signal import butter, filtfilt\n import numpy as np\n import matplotlib.pyplot as plt \n\n def butter_lowpass(cutoff, fs, order=5):\n nyq = 0.5 * fs\n normal_cutoff = cutoff / nyq\n b, a = butter(or...
[ "0.71313614", "0.70275563", "0.69224167", "0.68453467", "0.6807482", "0.6783777", "0.67287827", "0.6629645", "0.6614578", "0.65434146", "0.6522392", "0.6470765", "0.6469156", "0.6450254", "0.6424356", "0.6410205", "0.6375127", "0.6330572", "0.6251508", "0.6209557", "0.6194551...
0.7241261
0
1st order high pass filter
def highpass1(y, dt, fc=3) : tau=1/(2*np.pi*fc) alpha=tau/(tau+dt) y_filt=np.zeros(y.shape) y_filt[0]=0 for i in np.arange(1,len(y)): y_filt[i]=alpha*y_filt[i-1] + alpha*(y[i]-y[i-1]) m0=np.mean(y) m1=np.mean(y_filt) y_filt+=m0-m1 return y_filt
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def butter_highpass_filter(data, cutoff, fs, order=1):\n b, a = butter_highpass(cutoff, fs, order=order)\n y = filtfilt(b, a, data)\n return y", "def lowpass1(y, dt, fc=3) :\r\n tau=1/(2*np.pi*fc)\r\n alpha=dt/(tau+dt)\r\n y_filt=np.zeros(y.shape)\r\n y_filt[0]=y[0]\r\n for i in np.arange...
[ "0.6740725", "0.6653167", "0.6633017", "0.6436991", "0.6383848", "0.629565", "0.62608844", "0.6234676", "0.61076397", "0.6095083", "0.6085736", "0.6056559", "0.60563815", "0.6035713", "0.60116965", "0.5978692", "0.59777987", "0.5958039", "0.594976", "0.5948143", "0.5947825", ...
0.710744
0
Create a correlated random signal of length `n` based on the correlation coefficient `coeff` value[t] = coeff value[t1] + (1coeff) random
def correlated_signal(coeff, n=1000, seed=None): if coeff<0 or coeff>1: raise Exception('Correlation coefficient should be between 0 and 1') if seed is not None: np.random.seed(seed) x = np.zeros(n) rvec = rand(n) x[0] = rvec[0] for m in np.arange(1,n): x[m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_normal_correlated_data(\n N,\n r=0.5,\n mu_a=0,\n mu_b=0,\n sig_a=1,\n sig_b=1,\n lim_a=None,\n lim_b=None,\n tolerance=0.05,\n seed=None,\n verbose=False,\n):\n np.random.seed(seed)\n\n # Construct mean vector\n mu = np.array([mu_a, mu_b])\n\n # Construct ...
[ "0.6543086", "0.63841903", "0.6228304", "0.6159539", "0.61279804", "0.60582393", "0.59953517", "0.5940001", "0.5919091", "0.58453345", "0.5834957", "0.58325607", "0.5791859", "0.5704279", "0.5678215", "0.5678087", "0.5651459", "0.56434083", "0.56399286", "0.5638942", "0.56245...
0.8384586
0
Find time offset between two signals (may be negative) t_offset = find_time_offset(t, f, g) f(t+t_offset) ~= g(t)
def find_time_offset(t, f, g, outputAll=False): import scipy from scipy.signal import correlate # Remove mean and normalize by std f = f.copy() g = g.copy() f -= f.mean() g -= g.mean() f /= f.std() g /= g.std() # Find cross-correlation xcorr = correlate(f, g) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_time_offset(source, target, search_range=200):\r\n assert source.shape[1] == target.shape[1]\r\n best_offset = 688\r\n time_offset = 0\r\n if best_offset >= 0:\r\n time_offset = target[best_offset, 0] - source[0, 0]\r\n elif best_offset < 0:\r\n time_offset = target[0, 0] -...
[ "0.5972519", "0.5830573", "0.58109057", "0.57050276", "0.56272084", "0.5602879", "0.5560157", "0.5410567", "0.5351085", "0.5277255", "0.52644086", "0.52525896", "0.52351123", "0.5225274", "0.52198476", "0.5204406", "0.5141116", "0.51281154", "0.5116382", "0.5086718", "0.50661...
0.6923712
0
Get a migration of a specified server
def get(self, server, migration): return self._get('/servers/%s/migrations/%s' % (base.getid(server), base.getid(migration)), 'migration')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(self, server):\n return self._list(\n '/servers/%s/migrations' % (base.getid(server)), \"migrations\")", "def get_migration(self, _id: int) -> Optional[Migration]:\n for migration in self.migrations:\n if migration.id == _id:\n return migration\n ...
[ "0.65762854", "0.5903064", "0.57015634", "0.5498266", "0.5447161", "0.53921473", "0.5252999", "0.51654613", "0.5109671", "0.5014758", "0.49973872", "0.49665922", "0.4944251", "0.4910747", "0.4888143", "0.48865587", "0.48741516", "0.4832848", "0.48080567", "0.48019844", "0.478...
0.8369567
0
Get a migrations list of a specified server
def list(self, server): return self._list( '/servers/%s/migrations' % (base.getid(server)), "migrations")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_applied_migrations(self):\n with self.internal_db.begin() as conn:\n sql = \"SELECT name from migration;\"\n migrations = conn.execute(sql).fetchall()\n return [m[0] for m in migrations]", "def get(self, server, migration):\n return self._get('/servers/%s/migrat...
[ "0.6635136", "0.6470522", "0.63409764", "0.59359926", "0.5868745", "0.5838271", "0.57854855", "0.57466656", "0.56155324", "0.5562354", "0.5559403", "0.5559026", "0.55545276", "0.5531459", "0.5406119", "0.53998864", "0.5366492", "0.53645813", "0.5352012", "0.53041464", "0.5299...
0.86654884
0
Cancel an ongoing live migration
def live_migration_abort(self, server, migration): return self._delete( '/servers/%s/migrations/%s' % (base.getid(server), base.getid(migration)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def migrate_cancel(self):\n\t\treturn Job(SDK.PrlVm_MigrateCancel(self.handle)[0])", "def cancel(self):\n self.session.rollback()", "def cancel(self) -> None:\n c = self.pgconn.get_cancel()\n c.cancel()", "def cancel(self):\n pass", "def cancel():", "def cancel(self):", "def...
[ "0.764301", "0.6904926", "0.65942436", "0.6392075", "0.6307264", "0.6264627", "0.6264627", "0.6264627", "0.62033683", "0.6092558", "0.6092558", "0.60868293", "0.6083494", "0.6041118", "0.5979406", "0.59677255", "0.59653294", "0.596301", "0.59626913", "0.5956265", "0.59348416"...
0.72220004
1
Backs up a folder to a zip file This function takes the contents (recursively) of a folder and backs them up to a zip file.
def backupToZip(folder): folder = os.path.abspath(folder) #Ensure we're using the absolute path number = 1 while True: zipFilename = os.path.basename(folder) + '_' + str(number) + '.zip' if not os.path.exists(zipFilename): break number += 1 #Create the zip file ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_zip_backup(folder_path):\n\n # checking that parameter contains absolute path\n if not os.path.isabs(folder_path):\n print(\"Required an absolute path to generate a zip backup\")\n return\n\n # checking that folder exists before backuping\n if not os.path.isdir(folder_path):\n ...
[ "0.7182938", "0.70816165", "0.66951454", "0.6578646", "0.6496767", "0.64625716", "0.64222264", "0.63613576", "0.62886965", "0.6280407", "0.6269397", "0.6232583", "0.6067449", "0.60649943", "0.6032387", "0.60246265", "0.60167176", "0.5995485", "0.5989524", "0.59724647", "0.596...
0.80446476
0
Unregisters and registers with new custom admin panels
def reg_admin(): for model in models.get_models(): if _check_name(model): admin.site.unregister(model) admin.site.register(model, LocationAuditAdmin)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_module():\n\n # Course Dashboard\n tabs.Registry.register(\n base.OfflineAssignmentBase.DASHBOARD_NAV,\n base.OfflineAssignmentBase.DASHBOARD_TAB,\n base.OfflineAssignmentBase.DESCRIPTION,\n off_ass_dashboard.OfflineAssignmentDashboardHandler)\n\n dashboard.Dashboa...
[ "0.60133576", "0.5804296", "0.55303526", "0.5491801", "0.54885453", "0.54811734", "0.5326041", "0.5307102", "0.52954674", "0.5272991", "0.5260019", "0.5254747", "0.52482134", "0.5233564", "0.5233559", "0.5215448", "0.52059233", "0.5200994", "0.5189056", "0.5153242", "0.514729...
0.6133607
0
Returns the direction the detect objects (contours) are compared to the center of the image, this is returned in normalized screen space 1 to 1 (1 meaning the most left compared to the center, and 1 the most right compared to the center and 0 meaning perfectly centered xy_center_directions returns x and y center direct...
def xy_center_directions(contours, image: ndarray): return contours_.calculate_normalized_screen_space(contours, image)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center_directions(contours, image: ndarray):\n return contours_.contour_average_center(contours)", "def _centered_coords(self):\n\n array = self.detection_base.height_model.array\n height, width = self.detection_base.height_model.cell_size_x * array.shape[0], \\\n self...
[ "0.6688183", "0.5997663", "0.59733456", "0.5901859", "0.5878864", "0.58696026", "0.5829185", "0.57540023", "0.5694345", "0.56603926", "0.5657609", "0.5637801", "0.5630213", "0.5619939", "0.5613608", "0.5605313", "0.55993795", "0.55470574", "0.55371344", "0.5507005", "0.549903...
0.72629136
0
Returns the average center of the contours or list of contours that are the final targets This is the default directions function since it doesnt calculate any directions, only finds the center
def center_directions(contours, image: ndarray): return contours_.contour_average_center(contours)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_center( contours ):\r\n ret = []\r\n\r\n for x in contours:\r\n M = cv2.moments( x )\r\n pt = Point()\r\n pt.x = int( M['m10']/M['m00'] )\r\n pt.y = int( M['m01']/M['m00'] )\r\n\r\n ret.append( pt )\r\n\r\n return( ret );", "def xy_center_directions(contours, ...
[ "0.6287653", "0.6173183", "0.61626303", "0.5972788", "0.5970468", "0.57259196", "0.5716139", "0.57096714", "0.5702477", "0.57018715", "0.5674532", "0.5667665", "0.563917", "0.5589692", "0.55148965", "0.54906875", "0.5481084", "0.5470445", "0.5454891", "0.5452313", "0.5449522"...
0.735926
0
Retime a generic OpenRAVE trajectory into a timed for OWD. First, try to retime the trajectory into a MacTrajectory using OWD's MacRetimer. If MacRetimer is not available, then fall back on the default OpenRAVE retimer. traj input trajectory max_jerk maximum jerk allowed during retiming synchronize enable synchronizati...
def RetimeTrajectory(self, traj, max_jerk=30.0, synchronize=False, stop_on_stall=True, stop_on_ft=False, force_direction=None, force_magnitude=None, torque=None, **kw_args): # Fall back on the standard OpenRAVE retimer if MacTrajectory is not # available...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ExecuteTrajectory(self, traj, timeout=None, blend=True, retime=True, limit_tolerance=1e-3, synchronize=True, **kw_args):\n # Query the active manipulators based on which DOF indices are\n # included in the trajectory.\n active_manipulators = self.GetTrajectoryManipulators(traj)\n ne...
[ "0.64776725", "0.57618105", "0.5051099", "0.50354636", "0.4887224", "0.48129752", "0.47852176", "0.47836939", "0.47655028", "0.4751602", "0.4736376", "0.47340217", "0.46570545", "0.46272182", "0.4611437", "0.46056557", "0.45990774", "0.45985407", "0.45913064", "0.45853823", "...
0.75501573
0
Blend a trajectory for execution in OWD. Blending a trajectory allows the MacRetimer to smoothly accelerate through waypoints. If a blend radius is not specified, it defaults to zero and the controller must come to a stop at each waypoint. This adds the \tt blend_radius group to the input trajectory. traj input traject...
def BlendTrajectory(self, traj, maxsmoothiter=None, resolution=None, blend_radius=0.2, blend_attempts=4, blend_step_size=0.05, linearity_threshold=0.1, ignore_collisions=None, **kw_args): with self: return self.trajectory_module.blendtrajectory(traj=tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def blendTangent(self, blend):\n if blend and self._patches:\n self._prevPatchStartIndex = self._patches[-1].startIndex()\n else:\n self._prevPatchStartIndex = 1e10", "def set_blend_radius(print_organizer, d_fillet=10, buffer=0.3):\n\n logger.info(\"Setting blend radius\")\...
[ "0.6246105", "0.58287215", "0.5367136", "0.5344815", "0.5186415", "0.51465267", "0.51189536", "0.50626063", "0.5061908", "0.5035875", "0.50047594", "0.49633598", "0.49114856", "0.49037868", "0.4902819", "0.48953748", "0.48922417", "0.48837733", "0.4830077", "0.48256335", "0.4...
0.7580831
0
Execute a trajectory. By default, this function retimes, blends, and adds the stop_on_stall flag to all trajectories. This behavior can be overriden using the \tt blend and \tt retime flags or by passing the appropriate \tt kw_args arguments to the blender and retimer. By default, this function blocks until trajectory ...
def ExecuteTrajectory(self, traj, timeout=None, blend=True, retime=True, limit_tolerance=1e-3, synchronize=True, **kw_args): # Query the active manipulators based on which DOF indices are # included in the trajectory. active_manipulators = self.GetTrajectoryManipulators(traj) needs_synch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_hybrid_control_trajectory(self, trajectory, model, max_force_torque, timeout=5.0,\n stop_on_target_force=False, termination_criteria=None,\n displacement_epsilon=0.002, check_displacement_time=2.0,\n ...
[ "0.5539077", "0.5405223", "0.5195004", "0.51543003", "0.51397663", "0.49278358", "0.47854707", "0.46823263", "0.46326283", "0.4627261", "0.45890072", "0.4556019", "0.45381248", "0.44984668", "0.44904834", "0.4479847", "0.44633135", "0.44597632", "0.44556123", "0.44518995", "0...
0.67021406
0
function returns n combination r from pascals triangle
def pascal_triangle(n: int, r: int): if n==0 return 1 elif r ==0: return 1 elif n==r: return 1 else return pascal_triangle(n-1,r) + pascal_triangle(n-1, r-1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def r_combinations(n,r):\n return r_permutations(n,r) / math.factorial(r)", "def triangleNumber(n):\n return sum(range(n+1))", "def get_triangle_numbers(n):\n r = []\n for i in xrange(1, n + 1):\n t = ((i * (i + 1)) / 2)\n r.append(t)\n return r", "def permutations(n, r):\n re...
[ "0.75085384", "0.7400091", "0.7251817", "0.7202176", "0.7190689", "0.71306235", "0.7108646", "0.7101338", "0.7094721", "0.70332265", "0.70266634", "0.7013671", "0.6937788", "0.69373167", "0.6901856", "0.68888044", "0.68879896", "0.68220484", "0.6811778", "0.6787959", "0.67834...
0.74600625
1
>>> temp = io_helper.set_new("12\\nname\\naddr\\n") >>> val= ConsoleInterface(MemoryRecordStorage([])).add_rec() >>> io_helper.set_former(temp) >>> val 'Record added successfully' function implements interface that adds record
def add_rec(self): print("Write phone number:") add_phone_number_input = input() print("Write name of the record:") add_name_input = input() print("Write address:") add_address_input = input() return self.storage.add( add_phone_number_input, add_name_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_record(self, record):\n pass", "def test_record_add():\n\n display = Display()\n display.add('first')\n display.add('second')\n\n assert len(display.display_output) == 2", "def _add_recorder(self, variable):\n raise NotImplementedError", "def FILE_RTRV_record(self):\n eor...
[ "0.5955477", "0.5844077", "0.54942876", "0.54797316", "0.54465395", "0.52920324", "0.5285212", "0.5279746", "0.52550757", "0.5236633", "0.52354974", "0.52162975", "0.5192673", "0.51570594", "0.51551163", "0.51312655", "0.51297307", "0.51247436", "0.51221544", "0.50602716", "0...
0.5862049
1
>>> temp = io_helper.set_new("12\\n") >>> res= ConsoleInterface(MemoryRecordStorage()).remove_rec() >>> io_helper.set_former(temp) >>> res 'Record not found' function implements interface that removes record
def remove_rec(self): print("Write phone number:") remove_phone_number_input = input() return self.storage.remove(remove_phone_number_input)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pop_write(self):\n ...", "def undo(self):\r\n previous = self.memory.pop()\r\n if not isinstance(previous, task2.ListADT):\r\n raise TypeError(\"Did not expect any other object in memory\")\r\n if previous[0] == \"d\":\r\n index = previous[1]\r\n f...
[ "0.53218615", "0.5136622", "0.51338655", "0.51264924", "0.5107625", "0.5001114", "0.49959147", "0.4910786", "0.49040174", "0.4860867", "0.47833407", "0.47785375", "0.47783056", "0.47436464", "0.47293022", "0.47262895", "0.47256777", "0.4703999", "0.46816048", "0.46761337", "0...
0.5560903
0
>>> [ConsoleInterface(MemoryRecordStorage()).remove_all_recs()] ['All records have been erased'] function implements interface that removes all records
def remove_all_recs(self): return self.storage.clear()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_records(self) -> None:\n for container in self.record_containers:\n container.clear_records()", "def clear_all():\n bpy.ops.object.select_all(action='SELECT')\n bpy.ops.object.delete()", "def remove_all():\n storage = FileStorage()\n objects = storage.all()\n ...
[ "0.66904634", "0.6276651", "0.6266155", "0.61560607", "0.6145792", "0.6092948", "0.60891646", "0.6065167", "0.60158616", "0.6007153", "0.59672874", "0.5888242", "0.58739835", "0.5846741", "0.5836213", "0.58347726", "0.5826493", "0.5804345", "0.5804345", "0.5804345", "0.580434...
0.72792065
0
>>> temp = io_helper.set_new("12\\nname\\naddr\\n") >>> res= ConsoleInterface(MemoryRecordStorage()).update_rec() >>> io_helper.set_former(temp) >>> res 'Record not found' function implements interface that updates record
def update_rec(self): print("Write phone number:") update_phone_number_input = input() print("Write new name of the record:") update_name_input = input() print("Write new address:") update_address_input = input() return self.storage.update( update_phon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, read, info: ModificationInfo):", "def update(self, line):", "def test_patch_record(self):\n pass", "def _set_packed_record(self, i, s):\n\n raise NotImplementedError()", "def _add_to_ref(self, rec_curr, line):\n # Examples of record lines containing ':' include:\n ...
[ "0.5850617", "0.5622828", "0.5558996", "0.54402775", "0.5307458", "0.5306181", "0.5289004", "0.5260318", "0.5247207", "0.5246717", "0.52426815", "0.513985", "0.5122304", "0.5113792", "0.51074845", "0.50957656", "0.5067799", "0.50669193", "0.5039942", "0.5013815", "0.49793434"...
0.5651579
1
Sets the bid_percentage of this CreateAdsByInventoryReferenceRequest.
def bid_percentage(self, bid_percentage): self._bid_percentage = bid_percentage
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def percent_b(self, percent_b: float):\n\n self._percent_b = percent_b", "def __init__(self, bid_percentage=None, inventory_reference_id=None, inventory_reference_type=None): # noqa: E501 # noqa: E501\n self._bid_percentage = None\n self._inventory_reference_id = None\n self._invent...
[ "0.61821496", "0.59257495", "0.5638984", "0.5638984", "0.5638984", "0.5638984", "0.5567468", "0.5258507", "0.5230827", "0.514761", "0.5127867", "0.5127867", "0.5078384", "0.5002187", "0.49656045", "0.4949226", "0.49074405", "0.484597", "0.4835447", "0.4820097", "0.47924873", ...
0.770684
0
Sets the inventory_reference_id of this CreateAdsByInventoryReferenceRequest.
def inventory_reference_id(self, inventory_reference_id): self._inventory_reference_id = inventory_reference_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inventory_id(self, inventory_id):\n\n self._inventory_id = inventory_id", "def inventory_reference_type(self, inventory_reference_type):\n\n self._inventory_reference_type = inventory_reference_type", "def inventory_id(self, inventory_id):\n if inventory_id is None:\n raise ...
[ "0.69871175", "0.6377572", "0.62650263", "0.5741707", "0.5696567", "0.5647767", "0.54511845", "0.51018476", "0.5013131", "0.4810151", "0.46328503", "0.45902228", "0.45902228", "0.4568547", "0.45499918", "0.4547038", "0.4534739", "0.45183787", "0.449545", "0.44950244", "0.4469...
0.82257956
0
Sets the inventory_reference_type of this CreateAdsByInventoryReferenceRequest.
def inventory_reference_type(self, inventory_reference_type): self._inventory_reference_type = inventory_reference_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inventory_reference_id(self, inventory_reference_id):\n\n self._inventory_reference_id = inventory_reference_id", "def inventory_id(self, inventory_id):\n\n self._inventory_id = inventory_id", "def inventory(self, inventory):\n\n self._inventory = inventory", "def inventory_items(sel...
[ "0.64331234", "0.5246117", "0.5223081", "0.49133226", "0.47064462", "0.4672102", "0.46364635", "0.46090922", "0.46090922", "0.46090922", "0.46090922", "0.45791408", "0.45752478", "0.45637342", "0.45555532", "0.45555532", "0.45555532", "0.4546563", "0.45451772", "0.45405617", ...
0.8307037
0
Lists all the blobs in the bucket.
def list_blobs(bucket_name): # bucket_name = "your-bucket-name" storage_client = storage.Client() print(storage_client.current_batch) # Note: Client.list_blobs requires at least package version 1.17.0. blobs = storage_client.list_blobs(bucket_name) # print(len([1 for blob in blobs])) for b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_blobs(bucket_name):\n storage_client = storage.Client()\n\n # Note: Client.list_blobs requires at least package version 1.17.0.\n blobs = storage_client.list_blobs(bucket_name)\n\n return blobs", "def list_blobs(bucket):\n bucket = default_bucket if bucket is None else bucket\n bucket_...
[ "0.8128892", "0.8061956", "0.80099964", "0.79986364", "0.7891933", "0.7788305", "0.7717934", "0.7613284", "0.75719094", "0.75032365", "0.7491481", "0.7415898", "0.73129493", "0.7272844", "0.7269232", "0.72229993", "0.72042584", "0.7180795", "0.7155484", "0.7136133", "0.711413...
0.80805486
1
Fill config diff form page
def config_diff_form_page(): #  connect to database cur_db = connect_db("172.20.38.50", "mvelay", "user", "sandbox") cursor = cur_db.cursor() modules_query = """SELECT DISTINCT module from t_ck5050_ini ORDER BY module ASC""" versions_query = """SELECT DISTINCT version from t_ck5050_ini ORDER BY ver...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_diff_config_result_page():\n #  Get all fields from form\n module = request.forms.getall('module')\n client = request.forms.getall('client')\n version1 = request.forms.getall('version1')\n version2 = request.forms.getall('version2')\n\n # Build html\n modif = do_ck5050_ini_diff_req...
[ "0.745162", "0.59874326", "0.5777113", "0.5688203", "0.56571525", "0.5592918", "0.5590933", "0.5562555", "0.5546954", "0.55440426", "0.55340624", "0.55173373", "0.551184", "0.55098534", "0.5509276", "0.5473541", "0.5454012", "0.54499644", "0.54456383", "0.53727114", "0.537029...
0.7766916
0
Display diff config result page
def perform_diff_config_result_page(): #  Get all fields from form module = request.forms.getall('module') client = request.forms.getall('client') version1 = request.forms.getall('version1') version2 = request.forms.getall('version2') # Build html modif = do_ck5050_ini_diff_request(module, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_diff_form_page():\n #  connect to database\n cur_db = connect_db(\"172.20.38.50\", \"mvelay\", \"user\", \"sandbox\")\n cursor = cur_db.cursor()\n\n modules_query = \"\"\"SELECT DISTINCT module from t_ck5050_ini ORDER BY module ASC\"\"\"\n versions_query = \"\"\"SELECT DISTINCT version fr...
[ "0.7269731", "0.66847414", "0.6483663", "0.6056483", "0.6012005", "0.598935", "0.59349424", "0.5911885", "0.5906873", "0.58858836", "0.5866859", "0.57950294", "0.5726039", "0.56618685", "0.5660241", "0.5645076", "0.56382066", "0.5587175", "0.5567943", "0.55608356", "0.5559825...
0.80938596
0
perform request on t_performance table
def do_perf_request(script_name=None, module_type=None, tag=None, version=None, value_sup=None, value_inf=None): #  connect to database cur_db = connect_db("172.20.38.50", "mvelay", "user", "sandbox") cursor = cur_db.cursor() conditions = [] if script_name and script_name[0] !...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def performance(self, id):", "def _run_query(self):", "def test_fetch_traffic(self):\n assert isinstance(_tabular.fetch_traffic_data(), \n pd.DataFrame)", "def get_chartdata():\n callback = bottle.request.query.get('callback')\n y_axis = bottle.request.query.get('y_axis'...
[ "0.631114", "0.58254516", "0.5335217", "0.53163964", "0.5313429", "0.5274424", "0.5222381", "0.5192167", "0.5174108", "0.5169717", "0.5151157", "0.5150998", "0.51382655", "0.51242495", "0.51175666", "0.5111949", "0.5109519", "0.51076305", "0.5089668", "0.50836945", "0.5045464...
0.6207883
1
perform request on t_feature table
def do_features_request(module_type=None, version=None, software=None): #  connect to database cur_db = connect_db("172.20.38.50", "mvelay", "user", "sandbox") cursor = cur_db.cursor() # build whole query cur_query = """ SELECT feature, supported FROM t_feature WHERE module="%s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_features_request_2(features=None):\n\n #  connect to database\n cur_db = connect_db(\"172.20.38.50\", \"mvelay\", \"user\", \"sandbox\")\n cursor = cur_db.cursor()\n\n # build whole query\n cur_query = \"\"\" SELECT module, sw, version FROM t_feature\n WHERE feature=\"%s\" ...
[ "0.6873913", "0.628006", "0.6004172", "0.59714735", "0.58861274", "0.5775854", "0.5727609", "0.5681115", "0.5681115", "0.5681115", "0.5641183", "0.5640868", "0.5630228", "0.5585226", "0.5566278", "0.5546612", "0.5524076", "0.55190283", "0.5511565", "0.5466498", "0.54205346", ...
0.6668402
1
perform request on t_feature table
def do_features_request_2(features=None): #  connect to database cur_db = connect_db("172.20.38.50", "mvelay", "user", "sandbox") cursor = cur_db.cursor() # build whole query cur_query = """ SELECT module, sw, version FROM t_feature WHERE feature="%s" AND supported=1;""" % (fea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_features_request(module_type=None, version=None, software=None):\n\n #  connect to database\n cur_db = connect_db(\"172.20.38.50\", \"mvelay\", \"user\", \"sandbox\")\n cursor = cur_db.cursor()\n\n # build whole query\n cur_query = \"\"\" SELECT feature, supported FROM t_feature\n ...
[ "0.6668402", "0.628006", "0.6004172", "0.59714735", "0.58861274", "0.5775854", "0.5727609", "0.5681115", "0.5681115", "0.5681115", "0.5641183", "0.5640868", "0.5630228", "0.5585226", "0.5566278", "0.5546612", "0.5524076", "0.55190283", "0.5511565", "0.5466498", "0.54205346", ...
0.6873913
0
perform diff request between ck5050_ini files
def do_ck5050_ini_diff_request(module, client, version1, version2): #  connect to database cur_db = connect_db("172.20.38.50", "mvelay", "user", "sandbox") cursor = cur_db.cursor() # build whole query cur_query_1 = """SELECT ck5050 FROM t_ck5050_ini WHERE module='%s' AND client=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config_diff(context, target, file1, file2):\n\n result = context.get_operation('get_config_diff')\n return result", "def perform_diff_config_result_page():\n #  Get all fields from form\n module = request.forms.getall('module')\n client = request.forms.getall('client')\n version1 = requ...
[ "0.63707644", "0.58933586", "0.58889127", "0.56575066", "0.5535803", "0.5533335", "0.5454924", "0.5425166", "0.54007334", "0.5384806", "0.52225465", "0.5211675", "0.5190184", "0.5159502", "0.514443", "0.51250166", "0.512453", "0.5076124", "0.50507396", "0.5043625", "0.5035158...
0.6821847
0
Get from DBPhone test_to_redo stats
def get_test_to_redo_stats(url): import os import requests from lxml import etree from collections import OrderedDict categories = [('avrcp',), ('usb',), ('wifi',), ('upnp',), ('mtp',), ('ipod',), ('3way',), ('map',), ('pan',), ('dun',), ('pandora',), ('hdmi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testRedo(self):\n raw_data = TEST_DATA.copy()\n raw_data['redo'] = 'true'\n uma_data = UMASamplingProfilerData(\n raw_data, ChromeDependencyFetcher(self.GetMockRepoFactory()))\n self.assertTrue(uma_data.redo)", "def rrd_out(db):\n stats = basic_stats(db)\n print(\"rp:%d l:%d u:%d\" %...
[ "0.5556036", "0.54881424", "0.5412877", "0.5391689", "0.53793645", "0.5367809", "0.5247977", "0.5117082", "0.5116823", "0.50810045", "0.50738573", "0.5022342", "0.5014269", "0.49937323", "0.49274036", "0.49090567", "0.48934725", "0.48873225", "0.48542276", "0.4847499", "0.484...
0.5758006
0
Enable static image directory
def server_static_img(filename): return static_file(filename, root='static/img')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def images(name):\n return static_file(name, root=os.path.join(BASEDIR, \"images\"))", "def include_static_files(app):\n file_path = sphinx_prolog.get_static_path(STATIC_FILE)\n if file_path not in app.config.html_static_path:\n app.config.html_static_path.append(file_path)", "def path_static()...
[ "0.67881405", "0.63470244", "0.6251868", "0.61576533", "0.60136217", "0.5939546", "0.58997166", "0.58471245", "0.58220434", "0.57930964", "0.57122254", "0.5705205", "0.56905645", "0.56310606", "0.5624631", "0.56046736", "0.5533824", "0.5532665", "0.5532572", "0.55227333", "0....
0.6483689
1
Enable static stats directory
def server_static(filename): return static_file(filename, root='static/stats')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collectstatic():\n puts(yellow(\"Collect statics\"))\n django_manage('collectstatic', '-l', '--noinput')", "def glr_path_static():\n return os.path.join(base_path, \"static\")", "def monitor_page(path):\n return send_from_directory(os.path.join(os.path.dirname(__file__), \"..\", \"static\"), pa...
[ "0.5921597", "0.59045035", "0.58725524", "0.58487236", "0.5800601", "0.5593384", "0.55906385", "0.555093", "0.55357283", "0.5500581", "0.5452615", "0.54239327", "0.5393831", "0.53820044", "0.5364286", "0.53436893", "0.5338043", "0.5338043", "0.5316681", "0.5310895", "0.530017...
0.6684303
0
Change IP adress in header
def change_header(host="172.20.22.104", port=8081): # Read header template with open("./header_template.html", "r") as header: content = header.read() content_modified = re.sub("172.20.22.104:8081", "%s:%s" % (host, port), content) # Modify header with host:port with open("./header.html",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_ip(self, address: int) -> None:\n self.regs[\"ip\"].write(address)", "def set_host_ip(self, host, host_ip):\n host.setIP(str(host_ip.ip), prefixLen=self.NETPREFIX)", "def change_IP(self,server_IP,MAC):\n content = {'server_IP':server_IP,'MAC_address':MAC}\n content = json...
[ "0.69159824", "0.6746876", "0.6670021", "0.66584", "0.6627055", "0.6463176", "0.6415992", "0.6415992", "0.63854414", "0.6344735", "0.6266228", "0.6223221", "0.62148654", "0.61933804", "0.6174796", "0.6165831", "0.61656237", "0.616364", "0.61261654", "0.6106321", "0.60913247",...
0.6824174
1
Number of polynomial spline parts for system variables.
def n_parts_x(self): return self._parameters['n_parts_x']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_polys(self):\n ret_val = self._num_polys()\n return ret_val", "def numpoints(self):\n return len(self.pars) + 1 # so dof is 1", "def raise_spline_parts(self, n_spline_parts=None):\n if n_spline_parts is None:\n # usual case\n self._parameters['n_parts_...
[ "0.6299914", "0.60816807", "0.5986085", "0.5851045", "0.5821581", "0.57989854", "0.5776984", "0.5741229", "0.5738567", "0.57093143", "0.56891906", "0.5685901", "0.5649587", "0.557969", "0.55761206", "0.5537348", "0.55140233", "0.54845166", "0.5477328", "0.5477328", "0.5477328...
0.6224824
1
This method is used to create the necessary spline function objects.
def init_splines(self, export=False): self.log_debug("Initialise Splines") # store the old splines to calculate the guess later if not export: # self.old_splines = auxiliary.copy_splines(self.splines) self.old_splines = copy.deepcopy(self.splines) if sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spline(self):\n self.rho = np.linspace(0,1,self.nrho)\n self.te = self._spline(self.rho_in, self.te_in, self.rho)\n self.ne = self._spline(self.rho_in, self.ne_in, self.rho)\n self.ti = self._spline(self.rho_in, self.ti_in, self.rho)\n for i in range(self.nion):\n ...
[ "0.6794472", "0.67718244", "0.6634991", "0.6493209", "0.64013946", "0.6399138", "0.6325015", "0.6313537", "0.6291308", "0.6267896", "0.62008584", "0.6166823", "0.6108051", "0.60902315", "0.6086035", "0.60783106", "0.60377806", "0.60334915", "0.60260427", "0.59802824", "0.5972...
0.70828134
0
Set found numerical values for the independent parameters of each spline. This method is used to get the actual splines by using the numerical solutions to set up the coefficients of the polynomial spline parts of every created spline.
def set_coeffs(self, sol): # TODO: look for bugs here! self.log_debug("Set spline coefficients") # task: find which of the free parameters (coeffs) belong to which spline object sol_bak = sol.copy() subs = dict() # iterate over the OrderedDict {'x1': [cx1_..., ...], 'u1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spline(self):\n self.rho = np.linspace(0,1,self.nrho)\n self.te = self._spline(self.rho_in, self.te_in, self.rho)\n self.ne = self._spline(self.rho_in, self.ne_in, self.rho)\n self.ti = self._spline(self.rho_in, self.ti_in, self.rho)\n for i in range(self.nion):\n ...
[ "0.64004993", "0.62710917", "0.6152649", "0.6054342", "0.6014449", "0.58256006", "0.58093613", "0.5761664", "0.57538545", "0.5709607", "0.57025075", "0.5696033", "0.56923354", "0.5628855", "0.56229633", "0.56144243", "0.56101274", "0.56101274", "0.55588293", "0.55523896", "0....
0.75014144
0
Sort a list of app,modellist pairs into a single list of models. The single list of models is sorted so that any model with a natural key is serialized before a normal model, and any model with a natural key dependency has it's dependencies serialized first.
def sort_dependencies(app_list): from django.db.models import get_model, get_models # Process the list of models, and get the list of dependencies model_dependencies = [] models = set() for app, model_list in app_list: if model_list is None: model_list = get_models(app) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort(self):\n self.model_list.sort()\n for model in self.model_list:\n model.sort()", "def sort_models(data_dir, list_models):\n list_new_models = [] # Only left fields in CSV file.\n\n try:\n os.chdir(data_dir)\n except OSError, err:\n sys.stderr.write(\"Erro...
[ "0.7140047", "0.70637834", "0.6867462", "0.677511", "0.6625849", "0.6170446", "0.6126853", "0.6093717", "0.60831183", "0.6028849", "0.59897244", "0.5664581", "0.56470007", "0.56270397", "0.5605686", "0.55841184", "0.54990226", "0.54917353", "0.5478782", "0.5476888", "0.532848...
0.8072792
0
create an OpticsDescription and make sure it fails if units are missing
def test_construct_optics(): OpticsDescription( name="test", num_mirrors=1, num_mirror_tiles=100, mirror_area=u.Quantity(550, u.m ** 2), equivalent_focal_length=u.Quantity(10, u.m), ) with pytest.raises(TypeError): OpticsDescription( name="test", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_construct_optics():\n OpticsDescription(\n name=\"test\",\n size_type=SizeType.LST,\n reflector_shape=ReflectorShape.PARABOLIC,\n n_mirrors=1,\n n_mirror_tiles=100,\n mirror_area=u.Quantity(550, u.m**2),\n equivalent_focal_length=u.Quantity(10, u.m),\n ...
[ "0.78008306", "0.56905293", "0.55807394", "0.5456513", "0.5392586", "0.538737", "0.53750855", "0.5374919", "0.5374841", "0.53741705", "0.5371181", "0.5356631", "0.5356039", "0.5303193", "0.5301167", "0.52871114", "0.5274415", "0.52718306", "0.5246364", "0.52147675", "0.519935...
0.7196217
1
Checks that the endpoint is ready to receive incoming messages.
def _is_ready(self): current_wait_time = 0 start_time = time.time() while current_wait_time < self.max_wait_time_ready: try: response = requests.get(os.path.join(self.url, "ready"), timeout=1) if response.status_code == 200: break ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_ready(self):\n current_wait_time = 0\n start_time = time.time()\n while current_wait_time < self.max_wait_time_ready:\n try:\n response = requests.get(os.path.join(self.url, \"ready\"))\n if response.status_code == 200:\n brea...
[ "0.69959426", "0.65242666", "0.6468929", "0.6468929", "0.6450049", "0.637877", "0.635823", "0.63148576", "0.6309489", "0.6287994", "0.62630296", "0.6251497", "0.62316585", "0.6223134", "0.6218407", "0.6216059", "0.6203177", "0.6190777", "0.6145414", "0.61205196", "0.6097501",...
0.69550943
1
Detects a barbell's position in a frame
def detect_barbell_pos(self, classifier): self._check_vid_open() retval, frame = self.video.read() if not retval: raise IOError('Could not read frame from video') barbell_pos = classifier.detectMultiScale(frame, 1.1, 25) if not barbell_pos.any(): raise Ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buff_region(self, x, y):\n if x>120 and x<220 and y>275 and y<375:\n return 1\n elif x>580 and x<680 and y>125 and y<225:\n return 2\n return 0", "def track(self, frame):\n mask = self.get_arrow_mask(frame)\n label = skimage.measure.label(mask)\n ...
[ "0.60581046", "0.59345615", "0.57604194", "0.5743953", "0.5729966", "0.571696", "0.570723", "0.5651073", "0.5620212", "0.5571446", "0.55702275", "0.5536488", "0.5536488", "0.5512448", "0.54974544", "0.54932207", "0.5444628", "0.5442565", "0.5442322", "0.5441738", "0.5436839",...
0.71624565
0
Converts pixels in a barbell's diameter to centimeters
def _get_cm_per_pixel(self, diameter): CM_PER_INCH = 2.54 pixels_per_inch = 2 / diameter cm_per_pixel = CM_PER_INCH * pixels_per_inch return cm_per_pixel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __conv_inch(length_mm):\n return length_mm / 25.4", "def get_diameter(self) -> float:\r\n \r\n return (self.box[3] - self.box[1] + self.box[2] - self.box[0]) / 2", "def bin_edges_to_centres(edges):\r\n if edges.ndim == 1:\r\n steps = (edges[1:] - edges[:-1]) / 2\r\n retur...
[ "0.5748787", "0.57177395", "0.5671113", "0.5644989", "0.5644989", "0.5644989", "0.56154454", "0.5552707", "0.54947394", "0.5494285", "0.5480687", "0.5467712", "0.5456314", "0.54467314", "0.5419826", "0.5408947", "0.5400958", "0.5398737", "0.53467226", "0.53363895", "0.5334988...
0.6118975
0
Loads a video. Returns 1 on success
def load_video(self, vid_path): self.video = cv2.VideoCapture(vid_path) self._check_vid_open() logging.info('Loaded video at: {}'.format(vid_path)) return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __loadVideo(self):\n # Check if movie file exists ...\n #\n if not(os.path.isfile(self.fNameVideo)):\n return stm.StimErrC.videoFileNotFound\n\n try: \n # Load video\n #\n self.video = mpe.VideoFileClip(self.fNameVideo)\n \n except IOError: \n return stm.StimErrC.i...
[ "0.7726525", "0.70660406", "0.69042337", "0.68983585", "0.6861589", "0.6831531", "0.67470115", "0.6746388", "0.65393686", "0.64091796", "0.6401286", "0.6394237", "0.634081", "0.62345356", "0.621533", "0.6213619", "0.6195335", "0.6193793", "0.6168615", "0.6168126", "0.61294425...
0.7348447
1
Raises an error if a video is not opened. Else return 1
def _check_vid_open(self): if not self.video.isOpened(): raise IOError('Video is not open') return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def videostart_failed(self):\n # type: () -> bool\n return self._videostart_failed", "def check(self):\n #\n # *****************\n # *****************\n # TODO: Check really if video is valid\n # *****************\n # *****************\n return True", "def openVideo(self):\n ...
[ "0.6829495", "0.6795602", "0.67080617", "0.6603272", "0.6496463", "0.64905244", "0.6287083", "0.62592316", "0.62456816", "0.612378", "0.61099005", "0.6035323", "0.6004216", "0.6001032", "0.5871629", "0.5861267", "0.582632", "0.57916695", "0.5785687", "0.5746918", "0.5741277",...
0.8533003
0
Identify if given doc_no is a supported document type. Retrieve the candidate list of materials that will be returned.
def return_candidates(cls, doc_no): # Retrieve documents based on what it is given if isinstance(doc_no, Doc): doc = doc_no else: doc = Docs.of_doc_no(doc_no) # Case StoreAuxTask if isinstance(doc, prod_doc.StoreAuxTask): if doc.status <= prod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def return_materials(cls, user, doc_no, mode, return_list):\n\n # Retrieve documents based on what it is given\n doc = Docs.of_doc_no(doc_no)\n\n # Validate input,\n # Extract source to compare\n current_list = []\n ref_doc = None\n from_ref_doc = None\n if m...
[ "0.55780417", "0.514967", "0.49377292", "0.4870183", "0.47371918", "0.47266638", "0.47241977", "0.46641853", "0.4619189", "0.46141052", "0.45978752", "0.45675355", "0.4562565", "0.45569354", "0.45257613", "0.45226312", "0.45016974", "0.45015574", "0.44937566", "0.44864237", "...
0.5849427
0
Convert a normal path to template and the convert it back to a normal path with given path type.
def convert_path(path: str, path_type: PathType = PathType.AUTO) -> str: path_template = get_template_from_path(path) path = get_path_from_template(path_template, path_type) return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_path_from_template(path_template: str, path_type: PathType = PathType.AUTO) -> str:\r\n # automatically select path type depending on running OS\r\n if path_type == PathType.AUTO:\r\n if platform.system() == \"Windows\":\r\n path_type = PathType.WINDOWS\r\n elif platform.syst...
[ "0.64579725", "0.5781432", "0.5625563", "0.54816496", "0.5473164", "0.5293687", "0.51608443", "0.50819355", "0.4978549", "0.4844417", "0.47959632", "0.47708523", "0.4746237", "0.4732008", "0.47292966", "0.47214973", "0.4701345", "0.46961728", "0.46805945", "0.4661857", "0.466...
0.7523337
0
Set the global username override value.
def set_user_name_override(name: str) -> None: global _user_name_override _user_name_override = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_username(self, value):\n self.username = value", "def change_username(self, name):\n self.username = name", "def set_username(self, value):\n raise NotImplementedError('set_username')", "def set_uname(self, username):\n Server.t_usernames[threading.get_ident()] = username\...
[ "0.7747169", "0.7630484", "0.75716734", "0.7008054", "0.6820638", "0.6784135", "0.6745073", "0.6725287", "0.6669901", "0.6605668", "0.6576479", "0.6576479", "0.6576479", "0.6576479", "0.6576479", "0.6576479", "0.6576479", "0.6576479", "0.6576479", "0.6568546", "0.6558229", ...
0.825879
0
Reads all directory names in a given directory (nonrecursive) and returns the next (increasing) run id. Assumes IDs are numbers at the start of the directory names.
def _get_next_run_id_local(run_dir_root: str) -> int: dir_names = [d for d in os.listdir(run_dir_root) if os.path.isdir(os.path.join(run_dir_root, d))] r = re.compile("^\\d+") # match one or more digits at the start of the string run_id = 0 for dir_name in dir_names: m = r.match(dir_name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_id_dir(id_dir: Path) -> (int, Path):\n\n lockfile_path = id_dir/'.lockfile'\n with lockfile.LockFile(lockfile_path, timeout=1):\n next_fn = id_dir/PKEY_FN\n\n next_valid = True\n\n if next_fn.exists():\n try:\n with next_fn.open() as next_file:\n ...
[ "0.6369533", "0.6025362", "0.5927364", "0.57674915", "0.57419837", "0.5673672", "0.5648966", "0.55251485", "0.5444188", "0.54296756", "0.5414394", "0.54062897", "0.5385693", "0.5360778", "0.53512573", "0.53074497", "0.5295442", "0.5287889", "0.52728975", "0.52728975", "0.5272...
0.74510384
0
Takes in a list of tuples of (src, dst) paths and copies files. Will create all necessary directories.
def copy_files_and_create_dirs(files) -> None: for file in files: target_dir_name = os.path.dirname(file[1]) # will create all intermediate-level directories if not os.path.exists(target_dir_name): os.makedirs(target_dir_name) shutil.copyfile(file[0], file[1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _copy_files(src_paths,dst_dir,class_numbers):\n\n class_dirs=[os.path.join(dst_dir,class_name+\"/\")for class_name in self.class_names]\n\n for dir in class_dirs:\n if not os.path.exists(dir):\n os.makedirs(dir)\n\n for src,cls in zip(src_paths...
[ "0.77486277", "0.75265586", "0.73959345", "0.7387594", "0.7377672", "0.7329959", "0.72826844", "0.7268612", "0.72428185", "0.7232209", "0.72291964", "0.711112", "0.70853853", "0.70581484", "0.6992751", "0.6919675", "0.69122905", "0.68667597", "0.67933685", "0.6778472", "0.670...
0.7675131
1
Returns the manifold that this GraphEmbedder embeds nodes into. Defaults to Euclidean if this method is not overwritten
def get_manifold(self) -> RiemannianManifold: return ManifoldConfig().get_manifold_instance()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_kernel_norms(self):\n return self.adjacency", "def shared_element_norm(self):\n elements = self.shared_elements\n v1 = self.nodes[elements[:, 1], :] - self.nodes[elements[:, 0], :]\n v2 = self.nodes[elements[:, 2], :] - self.nodes[elements[:, 0], :]\n return np.cross(v1...
[ "0.57701725", "0.57140815", "0.565746", "0.558986", "0.5530351", "0.55212075", "0.54947764", "0.53900594", "0.5290139", "0.5283337", "0.52715415", "0.51860607", "0.51778406", "0.5176604", "0.5165664", "0.51596206", "0.51595855", "0.51545715", "0.51545715", "0.51331407", "0.51...
0.64672875
0