query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Return a data point and its metadata information.
def __getitem__(self, index): A_path = self.A_paths[index] A_img = np.array(Image.open(A_path).convert('RGB')) A_img = self.stack(A_img) A_img = resize(A_img,(256, 256)) A_img = np.einsum('abc->cab', A_img) # A_img = hsi_loader(A_path) # print(np.max(A_img)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def point(self):\n return self.x, self.y, self.z", "def to_data(self):\n point = {\n 'point': [self.pt[0], self.pt[1], self.pt[2]],\n 'layer_height': self.layer_height,\n\n 'mesh_normal': self.mesh_normal.to_data(),\n 'up_vector': self.up_vector.to_data()...
[ "0.66095746", "0.6598914", "0.65769345", "0.6538956", "0.65237606", "0.6339937", "0.62947094", "0.62947094", "0.61600286", "0.61509", "0.6141212", "0.6137378", "0.6118088", "0.6068833", "0.605036", "0.60272974", "0.59920406", "0.5991923", "0.59914654", "0.59783316", "0.596601...
0.0
-1
Return the total number of images in the dataset.
def __len__(self): return len(self.A_paths)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_of_images(self):", "def getNumberOfImages(self):\n\t\treturn self.numberOfImages", "def getDataSetCount(self):\n\t\treturn int(self.numberOfImages / self.slicesPerTimepoint)", "def num_of_images(self):\n return len(self.data['image_infos'])", "def get_image_count(self):\n return s...
[ "0.82737345", "0.81175524", "0.7999686", "0.79701054", "0.79361874", "0.7762907", "0.766983", "0.7524982", "0.7517643", "0.7517643", "0.7517643", "0.7517643", "0.7517643", "0.7477773", "0.7451018", "0.73769426", "0.73769027", "0.7314028", "0.71550864", "0.7140171", "0.7115165...
0.0
-1
Set up the SHC switch platform.
async def async_setup_entry( hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: AddEntitiesCallback, ) -> None: entities: list[NumberEntity] = [] session: SHCSession = hass.data[DOMAIN][config_entry.entry_id][DATA_SESSION] for number in ( session.device_helper.thermosta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_platform(hass, config, add_devices_callback, discovery_info=None):\n add_devices_callback([\n HE853Switch('OviSwitch', STATE_ON),\n HE853Switch('AC', STATE_OFF)\n ])", "def setup_platform(hass, config, add_devices, discovery_info=None) -> None:\n friendly_name = config.get(CONF_F...
[ "0.61745834", "0.6164841", "0.6163982", "0.60993034", "0.6015168", "0.5961966", "0.5939102", "0.59182364", "0.59003484", "0.58913684", "0.58688366", "0.58645135", "0.5812807", "0.5794662", "0.5756036", "0.57241225", "0.57174337", "0.5713566", "0.570899", "0.57045996", "0.5627...
0.0
-1
Initialize a SHC number.
def __init__( self, device: SHCDevice, parent_id: str, entry_id: str, attr_name: str | None = None, ) -> None: super().__init__(device, parent_id, entry_id) self._attr_name = ( f"{device.name}" if attr_name is None else f"{device.name} {attr_name}"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_hex_str(value):\n \n return SHex(value)", "def __init__(self, *args):\n _snap.TStrIntSH_swiginit(self, _snap.new_TStrIntSH(*args))", "def __init__(self, *args):\n this = _ida_hexrays.new_cnumber_t(*args)\n try: self.this.append(this)\n except: self.this = this", "de...
[ "0.5653801", "0.55701524", "0.55095994", "0.5451962", "0.5409322", "0.5390917", "0.5353926", "0.53247625", "0.5211058", "0.5170437", "0.51681376", "0.5165097", "0.5136337", "0.51200897", "0.5113493", "0.51005596", "0.5099268", "0.5097797", "0.50901145", "0.50761837", "0.50750...
0.0
-1
Update the current value.
def set_native_value(self, value: float) -> None: self._device.offset = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateValue(self):\n self.value = self.var.get()", "def update(self, val):\n self.current_val = val\n self.redraw()", "async def updated(self, value):\n pass", "def update(self):\n self.value = self.sensor.update()", "def value(self, value):\n self._update_valu...
[ "0.80516917", "0.8023897", "0.7922197", "0.7634436", "0.7568084", "0.7530883", "0.7463531", "0.73235893", "0.73007935", "0.72947305", "0.72197104", "0.72197104", "0.7211766", "0.7185519", "0.711843", "0.7090071", "0.70864594", "0.70864594", "0.7069182", "0.70634", "0.7053123"...
0.0
-1
Return the value of the number.
def native_value(self) -> float: return self._device.offset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNumber():", "def number_value(self) -> typing.Optional[jsii.Number]:\n return self._values.get('number_value')", "def getNumber(self):\n return self.number", "def get_number(self):\n return self.__number", "def number(self):\n return self._num", "def getNumber(self):\n ...
[ "0.7854039", "0.750523", "0.73744917", "0.73732847", "0.73537433", "0.7302086", "0.7273926", "0.72530407", "0.72530407", "0.72048277", "0.71437126", "0.71321", "0.71275204", "0.7098608", "0.7093455", "0.70763844", "0.7041058", "0.6980676", "0.69784814", "0.6971804", "0.695911...
0.0
-1
Return the step of the number.
def native_step(self) -> float: return self._device.step_size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_step(self) -> int:\n return self.step", "def step(self) -> int:\n return self._step", "def step(self) -> float:\n step = DEFAULT_STEP\n value_range = abs(self.max_value - self.min_value)\n if value_range != 0:\n while value_range <= step:\n s...
[ "0.8003057", "0.77602637", "0.7494545", "0.7301309", "0.72224903", "0.7211852", "0.7211852", "0.7135624", "0.7135624", "0.70930195", "0.70930195", "0.70930195", "0.70930195", "0.70783025", "0.7060501", "0.7009056", "0.69800514", "0.6976799", "0.6710798", "0.6657582", "0.66559...
0.61539525
36
Return the min value of the number.
def native_min_value(self) -> float: return self._device.min_offset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minimum(self):\n return min(self.numbers)", "def minimum_number(self):\n return self._minimum_number", "def min(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"min\")", "def min(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"min\")", "def min(self):\n ...
[ "0.8187885", "0.8120689", "0.7916179", "0.7916179", "0.78326535", "0.7700931", "0.7700931", "0.7643324", "0.76173663", "0.76173663", "0.76063895", "0.75760686", "0.7549816", "0.7485435", "0.7461791", "0.7427969", "0.7427969", "0.74131995", "0.73779243", "0.7353689", "0.732778...
0.68672127
52
Return the max value of the number.
def native_max_value(self) -> float: return self._device.max_offset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maximum_number(self):\n return self._maximum_number", "def maximum(self):\n return max(self.numbers)", "def max_value(self) -> int:\n return self.__max_value", "def max():\n return KeeperOfMinOrMax(int.__lt__)", "def get_max(self):\n return self._max", "def max(self...
[ "0.82954454", "0.81974316", "0.7996817", "0.797404", "0.78951424", "0.7878407", "0.7878407", "0.7877468", "0.78691196", "0.7838583", "0.7678307", "0.7661671", "0.7661671", "0.765726", "0.764877", "0.76332706", "0.7630812", "0.76256377", "0.76256377", "0.76157844", "0.7575633"...
0.0
-1
Return poisson standard deviations for a series of counts => sqrt(count).
def poisson_sd(data: DataSeries) -> DataSeries: return data.pow(0.5)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simpson(counts):\n return 1 - dominance(counts)", "def standard_deviation( values, sample=False ):\n return ma.sqrt( variance( values, sample ) )", "def sampleStandardDeviation(numlist):\n\tv = sampleVariance(numlist)\n\t#print v\n\treturn math.sqrt(v)", "def calc_standard_deviation(data: list) -> ...
[ "0.67654955", "0.6592472", "0.6389939", "0.6386978", "0.6347877", "0.6347877", "0.6317405", "0.6290753", "0.62828505", "0.6280624", "0.6271539", "0.6244763", "0.61702657", "0.616199", "0.6077561", "0.6076158", "0.6060597", "0.6051322", "0.60506374", "0.6049991", "0.60432696",...
0.7089623
0
Aggregate standard deviations of two independent var => sqrt(sd1^2 + sd2^2).
def combine_sd_ratios(data1: DataSeries, data2: DataSeries) -> DataSeries: return (data1.pow(2) + data2.pow(2)).pow(0.5)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def standard_deviation( values, sample=False ):\n return ma.sqrt( variance( values, sample ) )", "def standard_deviation(data):\n\n return np.sqrt(variance(data))", "def standard_deviation(data):\n\n return np.sqrt(variance(data))", "def standard_deviation(xs: List[float]) -> float:\n return math...
[ "0.74803764", "0.7347811", "0.7347811", "0.7310347", "0.7310347", "0.72294706", "0.7142489", "0.71371955", "0.70903856", "0.705318", "0.69752705", "0.6966709", "0.6956561", "0.6909036", "0.68810153", "0.68303746", "0.6817877", "0.681063", "0.6780972", "0.6778679", "0.677482",...
0.0
-1
Overriden to take care of the password hashing.
def create(self, validated_data): username = validated_data.get('username') email = validated_data.get('email') password = validated_data.get('password') first_name = validated_data.get('first_name', '') last_name = validated_data.get('last_name', '') return User.objects....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash_password(self):\n self.__password = self.str_to_hash(self.__password)", "def password(self, password):\n self.password_hash = generate_password_hash(password)", "def hash_password(self, password):\n self.password = pwd_context.encrypt(password)", "def hash_password(self, password):\...
[ "0.7774024", "0.7681036", "0.738924", "0.73867005", "0.73863477", "0.715053", "0.715053", "0.715053", "0.715053", "0.7084934", "0.7043762", "0.7021125", "0.69785094", "0.6971123", "0.6949527", "0.6932085", "0.69224435", "0.6888295", "0.6843389", "0.68132836", "0.67045635", ...
0.0
-1
Takes command argparse arguments and push them in the config with syntax args.
def inject_args_in_config(args, config): log = logging.getLogger(__name__) for t_opt in list(args._options.values()): n = t_opt.name first_ = n.find('_') if first_ > 0: s, o = n[:first_], n[first_ + 1:] v = t_opt.value() log.info('inject argument {} =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _configure_args(self, parser: ArgumentParser) -> ArgumentParser:\n pass", "def add_args(self, parser):", "def parse_args():\n\n parser = argparse.ArgumentParser(description='CLI to store Actisense-NGT Gateway values to InfluxDB and publish via MQTT')\n parser.add_argument('--config', '-c', typ...
[ "0.6566261", "0.65298736", "0.64381665", "0.641381", "0.6323339", "0.6299603", "0.6270504", "0.6175168", "0.6129637", "0.60077024", "0.5994302", "0.5994058", "0.5948121", "0.5947703", "0.5935954", "0.5910463", "0.59049886", "0.5904204", "0.58908075", "0.5878283", "0.5866294",...
0.5884526
19
We want to normalize if there are Numbers as well as non numbers
def test(types, _): return 'Date' in types and 'Postal Code' in types
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize(self):\n total = float(self.totalCount())\n if total != 0:\n self.divideAll(total)", "def normalize(self, factor):", "def normalize(self):\n if self.normed:\n return\n self._normalize()", "def _normalize(self, inp):\n \n return inp...
[ "0.67711663", "0.65292776", "0.64035", "0.6389826", "0.6340699", "0.6336167", "0.6326443", "0.6315299", "0.6158485", "0.61584735", "0.61411077", "0.60895723", "0.6047613", "0.6030965", "0.60051346", "0.5986902", "0.5964781", "0.59633493", "0.59619254", "0.59619254", "0.595393...
0.0
-1
If we don't just have numbers, we cut our confidence in half.
def normalize(results): postal_code = None date = None for result in \ [r for r in results if r.type in ['Date', 'Postal Code']]: if result.type == 'Date': date = result elif result.type == 'Postal Code': postal_code = res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_error_at_confidence(self, threshold):\r\n\r\n nominator = numpy.sum(numpy.logical_and(self.test_errors, self.test_confidences >= threshold))\r\n denominator = numpy.sum(self.test_confidences >= threshold)\r\n if denominator > 0:\r\n return nominator / float(denominator)\r\n...
[ "0.6201923", "0.6023993", "0.60135293", "0.60015327", "0.5982844", "0.5912286", "0.58943784", "0.589245", "0.58252966", "0.5757721", "0.5753321", "0.5750421", "0.5706621", "0.5698662", "0.5662419", "0.5658838", "0.5640861", "0.56258726", "0.5623685", "0.56233543", "0.56138235...
0.0
-1
Returns a + b
def add_integer(a, b=98): if type(a) is not int and type(a) is not float: raise TypeError('a must be an integer') if type(b) is not int and type(b) is not float: raise TypeError('b must be an integer') res = a + b if res < 0: res = -res if res == float('inf'): raise V...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, a, b):\n return a + b", "def addition(a, b):\r\n\r\n result = a + b\r\n return result", "def addition(a, b):\n return a + b", "def plus(self, a, b):\n return a + b", "def add( a, b ):\n return a + b", "def add(a, b):\n return a + b", "def add(a, b):\n return a + ...
[ "0.90207714", "0.8935913", "0.8687306", "0.86244667", "0.86037934", "0.8499308", "0.8499308", "0.8499308", "0.8499308", "0.8499308", "0.8499308", "0.84941006", "0.84598297", "0.84537196", "0.84234774", "0.8385539", "0.83786505", "0.8373787", "0.8373787", "0.83662784", "0.8359...
0.0
-1
Ensure that we verify SSL by default.
def test_ssl_default(self): assert security.security_settings.ssl_verify()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_ssl(self):\n self.ssl_context = ssl.SSLContext()\n # if self.config.get('ca_file', None):\n # self.ssl_context.load_verify_locations(ca_file=self.config['ca_file'])\n\n # TODO : Remove this\n\n verify_ssl = self.config[\"AUTH\"][\"verify_ssl\"]\n if isins...
[ "0.7664821", "0.75893015", "0.7575917", "0.7255344", "0.71744585", "0.69131243", "0.6908525", "0.6856045", "0.68336725", "0.6823391", "0.6813892", "0.677433", "0.6762706", "0.6683818", "0.6665227", "0.6665193", "0.66511506", "0.6603701", "0.66006225", "0.6559028", "0.6538089"...
0.85075116
0
Ensure that we verify SSL by default.
def test_ssl_default(self): e = ErrataConnector() assert e.ssl_verify
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ssl_default(self):\n assert security.security_settings.ssl_verify()", "def initialize_ssl(self):\n self.ssl_context = ssl.SSLContext()\n # if self.config.get('ca_file', None):\n # self.ssl_context.load_verify_locations(ca_file=self.config['ca_file'])\n\n # TODO : Re...
[ "0.8508023", "0.7664771", "0.75758237", "0.72551364", "0.7174544", "0.6913616", "0.6908566", "0.68556964", "0.6832757", "0.68229824", "0.68136877", "0.67751247", "0.67623496", "0.66840416", "0.66653126", "0.6665054", "0.6652056", "0.660391", "0.66015786", "0.655874", "0.65392...
0.7590866
2
Transform a two dimmentional numpy array to a myqlm Matrix.
def array_to_matrix(array): assert len(array.shape) == 2, "The array must be two dimmentional" data = [] for arr in array: for elem in arr: data.append(ComplexNumber(np.real(elem), np.imag(elem))) matri = Matrix(array.shape[0], array.shape[1], data) return matri
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_matrix(self) -> types.Matrix:", "def to_matrix(array):\n return Matrix(array.tolist())", "def _to_matrix(self, y):\n if hasattr(y, \"shape\"):\n if len(y.shape) == 1:\n if isinstance(y, (pd.Series, pd.DataFrame)):\n y = y.to_numpy()\n ...
[ "0.68257034", "0.66232854", "0.63458335", "0.61276364", "0.61276364", "0.60878366", "0.60764503", "0.59793574", "0.59339464", "0.5888079", "0.5884792", "0.584454", "0.57784957", "0.57733315", "0.5763111", "0.5759501", "0.5737964", "0.57346207", "0.57008547", "0.5669869", "0.5...
0.608287
6
Create a myqlm representation of quantum channel from a qiskit representation of a quantum channel.
def qiskit_to_qchannel(representation): qchannel = None qiskit_data = representation.data # Find what representation it is. # Then create the corresponding matrix (kraus_ops|basis|matrix)from the data # of the representation. # Finally, create the QuantumChannel with the RepresentationType, the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qchannel_to_qiskit(representation):\n\n rep = representation.representation\n # Find what representation it is.\n # Then create the corresponding matrix and shape it like qiskit is expecting it.\n # Finally, create the qiskit representation from that matrix.\n if rep in (RepresentationType.PTM, ...
[ "0.7162368", "0.63052386", "0.62322587", "0.6150985", "0.54366237", "0.5430608", "0.5400934", "0.5215017", "0.51926947", "0.5181921", "0.512755", "0.4988747", "0.49690673", "0.4939683", "0.49243224", "0.49112472", "0.48836026", "0.48823464", "0.48380566", "0.48145837", "0.479...
0.7086064
1
Create a qiskit representation of quantum channel from a myqlm representation of a quantum channel.
def qchannel_to_qiskit(representation): rep = representation.representation # Find what representation it is. # Then create the corresponding matrix and shape it like qiskit is expecting it. # Finally, create the qiskit representation from that matrix. if rep in (RepresentationType.PTM, Representat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qiskit_to_qchannel(representation):\n\n qchannel = None\n qiskit_data = representation.data\n # Find what representation it is.\n # Then create the corresponding matrix (kraus_ops|basis|matrix)from the data\n # of the representation.\n # Finally, create the QuantumChannel with the Representat...
[ "0.68651897", "0.6369858", "0.6249039", "0.6095439", "0.5532425", "0.5279432", "0.5224014", "0.5138072", "0.5133675", "0.5082203", "0.5018223", "0.49832156", "0.49755138", "0.49718896", "0.48944896", "0.48510703", "0.48189393", "0.48128456", "0.47943678", "0.478117", "0.47810...
0.6979349
0
This method reurns centence with style of furniture. >>> furniture1 = Furniture("empire", "bedroom") >>> assert(str(furniture1) == "")
def __str__(self): return "<furniture style is " + str(self.style) + ">"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_furniture():", "def __str__(self):\n return \"<This armchair furniture style is \" + str(self.style) + \">\"", "def new_fountain():\n fountain = Composite()\n set_dungeon_feature_components(fountain)\n fountain.set_child(Description(\"Fountain\",\n (\"A...
[ "0.5750459", "0.5182642", "0.49739367", "0.48258784", "0.4760474", "0.47537947", "0.47426933", "0.47203162", "0.46918836", "0.46697134", "0.46030477", "0.45801994", "0.45153394", "0.45117316", "0.44764778", "0.4470842", "0.44334066", "0.44276795", "0.44269252", "0.44269252", ...
0.59496
0
This method reurns centence with whole information given about the chair. >>> chair1 = Chair("empire", "bedroom", "armchair") >>> assert(str(chair1) == "")
def __str__(self): return "<This armchair furniture style is " + str(self.style) + ">"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_chairs(self):\n self.chairs = self.p_constants[\"NPHILOSOPHERS\"] * [0]\n for i in xrange(self.p_constants[\"NPHILOSOPHERS\"]):\n x, y, angle = self._get_chair_coord(i, 5.0)\n self.chairs[i] = self._load_model(\n \"chair1\", scale=[7, 7, 7], pos=[x, y - ...
[ "0.50800323", "0.49419627", "0.48987815", "0.48388648", "0.46962285", "0.46602952", "0.4589004", "0.45846203", "0.45836064", "0.45684838", "0.45631933", "0.45429364", "0.45290777", "0.45177618", "0.45131966", "0.4502921", "0.45016715", "0.44828025", "0.4480651", "0.4474967", ...
0.0
-1
This mehod returnschair`s assign. >>> chair1 = Chair("empire", "bedroom", "armchair") >>> assert(chair1.get_assign() == "bedroom")
def get_assign(self): return self.assign
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_assign_identity(self) -> Union[str, None]:\n\n return self._get_assign_identity(enable_validation=True)", "def __getitem__(self, name: str) -> Set[BaseAssignment]:\n ...", "def perform_exercise_assign(args):\n FBDPCommon.callSelectionHook(args, 'trades', 'exercise_assign_selection')\n ...
[ "0.567902", "0.5271101", "0.5108276", "0.5069352", "0.50534844", "0.50037473", "0.4950295", "0.49384058", "0.4930697", "0.49107504", "0.4898811", "0.48804885", "0.48743683", "0.48659533", "0.4856359", "0.4852952", "0.48237786", "0.48076132", "0.47997218", "0.47993913", "0.478...
0.7331236
0
Called whenever an item is yielded by the spider
def process_item(self, item, spider): # strip non ascii chars item['raw_content'] = filter(lambda x : ord(x) < 128, item['raw_content']) #item['raw_content'] = ''.join(c for c in item['raw_content'] if ord(c) < 128) # hash the filename to prevent storing too-long file names has...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_item(self, response):\n NewhouseSpider.crawled_urls.append(response.url)\n item = FocusedScrapyCrawlerItem()\n item['url'] = response.url\n item['link_text'] = response.meta.get('link_text', '') if response.meta else ''\n soup = BeautifulSoup(response.body, 'html.parser...
[ "0.70246166", "0.6571699", "0.65183365", "0.6512757", "0.6512757", "0.646952", "0.63494533", "0.6298831", "0.61873883", "0.6149486", "0.6139941", "0.6128781", "0.6128781", "0.6095686", "0.60349035", "0.5999732", "0.59780586", "0.5950867", "0.59086984", "0.58660156", "0.586033...
0.5859573
21
Executed on spider completion
def close_spider(self, spider): # Update batch finish time, keep this last spider.batch.finish_time = spider.get_now_time() spider.batch.save()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _finished(self) -> None:", "def done(self):", "def done(self):", "def finished(self):", "def onfinish( request ):", "def onfinish( request ):", "def finished(self):\n pass", "def onDone(self):\n pass", "def after_parsing(self):", "def finish(self):", "def finish(self):", "def ...
[ "0.66993535", "0.66545945", "0.66545945", "0.6630113", "0.64786404", "0.64786404", "0.6470851", "0.64693534", "0.6428068", "0.6403498", "0.6403498", "0.63767177", "0.63756603", "0.63177204", "0.6315278", "0.6261107", "0.6261107", "0.62559295", "0.6248004", "0.62337804", "0.62...
0.6006156
47
Executed on spider launch
def open_spider(self, spider): now = spider.get_now_time() # Create initial batch spider.batch = model.Batch.objects.create( kickoff_time=now, finish_time=now) spider.batch.save() # save initial site list file_content = ContentFile('\n'.join(spider.start_url...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_spider(self, spider):\n pass", "def boot():\n\t\tcreate_project_url_dir(Spider.project_name)\n\t\tcreate_url_data(Spider.project_name, Spider.base_url)\n\t\tSpider.queue = file_to_set(Spider.queue_file)\n\t\tSpider.crawled = file_to_set(Spider.crawled_file)", "def post_start(self):", "def ope...
[ "0.7322433", "0.70774", "0.68925005", "0.68527085", "0.67921203", "0.66922694", "0.65391195", "0.6513823", "0.6487005", "0.6476667", "0.6425333", "0.64246696", "0.64244527", "0.64244527", "0.64244527", "0.64244527", "0.64244527", "0.64244527", "0.64244527", "0.64244527", "0.6...
0.5739939
77
Placeholder for selftest function. An example use would be to test package api connectivity. Suggested return values are be unimplemented, success, or failure.
def selftest_function(opts): threatminer = ThreatMiner(opts.get("resilient", {}), opts.get(PACKAGE, {})) data, msg = threatminer.get(TEST_URI) state = "success" if data else "failure" return {"state": state}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testApi(self):", "def test_dummy():", "def test_something():", "def unitary_test():", "def test(self):\n raise NotImplementedError", "def test_func():\n pass", "def test_dummy_test():\n pass", "def test_integration(self):\n self.assertTrue(return_true())", "def test_for_clie...
[ "0.701643", "0.6862365", "0.6859328", "0.68279654", "0.6786072", "0.6753484", "0.6739912", "0.67003626", "0.66963637", "0.6691693", "0.6675198", "0.66256887", "0.66032374", "0.6586758", "0.6558276", "0.64686215", "0.64683706", "0.64683706", "0.64683706", "0.64683706", "0.6468...
0.6658282
11
Set up the Clementine platform.
def setup_platform( hass: HomeAssistant, config: ConfigType, add_entities: AddEntitiesCallback, discovery_info: DiscoveryInfoType | None = None, ) -> None: host = config[CONF_HOST] port = config[CONF_PORT] token = config.get(CONF_ACCESS_TOKEN) client = ClementineRemote(host, port, toke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure(self):\n\n self.platform.configure()", "def setup(self):\n # Create your sprites and sprite lists here\n self.game: Game = Game(SCREEN_WIDTH, SCREEN_HEIGHT, TILE_SIZE, 1, grid_layers = 4)\n self.game.game_message = \"Lead the Rabbit home\"\n\n # show the menu so t...
[ "0.68824685", "0.64926875", "0.64503926", "0.6356767", "0.6356767", "0.6356767", "0.6356767", "0.6356767", "0.6356767", "0.6356767", "0.6356767", "0.6356767", "0.6356767", "0.6356767", "0.6356767", "0.62709063", "0.62343746", "0.62263495", "0.6225092", "0.6217122", "0.6190478...
0.6602621
1
Initialize the Clementine device.
def __init__(self, client, name): self._client = client self._attr_name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def doInitializeDevice(self):\n super().doInitializeDevice()", "def initialise(self):\n self.device.initialise()\n return \"OK\"", "def initialize(self,*args,**kwargs):\n self.__instrumentID = c_uint32(0) \n self.__numInstruments = c_uint32()\n self.__nbrOfChannels = c_uint32()\...
[ "0.65377396", "0.65024364", "0.638117", "0.63599783", "0.63138694", "0.62079704", "0.61737376", "0.61604065", "0.61414874", "0.6086899", "0.6078774", "0.607841", "0.6074798", "0.6074586", "0.60706323", "0.6059677", "0.605526", "0.6050378", "0.6042103", "0.60385203", "0.603793...
0.0
-1
Retrieve the latest data from the Clementine Player.
def update(self) -> None: try: client = self._client if client.state == "Playing": self._attr_state = MediaPlayerState.PLAYING elif client.state == "Paused": self._attr_state = MediaPlayerState.PAUSED elif client.state == "Disconne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def player_data(self):\n return self._player", "def latest_data(self):\n if self._data:\n return self._data\n return None", "def NowPlaying(self):\n self.logger.debug(\"Fetching currently playing information\")\n try:\n xbmc = Server(self.url('/jsonrpc',...
[ "0.6848046", "0.6371471", "0.63664883", "0.6316709", "0.6299198", "0.61774623", "0.61145097", "0.6105679", "0.6088084", "0.60660213", "0.6014737", "0.5998504", "0.5996155", "0.59247184", "0.5897208", "0.5877519", "0.58722764", "0.5852134", "0.5835476", "0.5832391", "0.5816574...
0.0
-1
Fetch media image of current playing image.
async def async_get_media_image(self) -> tuple[bytes | None, str | None]: if self._client.current_track: image = bytes(self._client.current_track["art"]) return (image, "image/png") return None, None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def media_image_url(self):\n return self._current_item[\"image\"]", "def media_image_url(self):\n return self.coordinator.data.nowplaying[self.zone.SourceID].CurrSong.ArtworkURI", "def media_image_url(self):\n if 'artwork_url' in self._status:\n return self._status['artwork_url'...
[ "0.74042034", "0.731227", "0.71006846", "0.7026222", "0.7026222", "0.7007176", "0.6959414", "0.69316447", "0.67641294", "0.67636913", "0.6708021", "0.6683734", "0.66400856", "0.6608873", "0.6608873", "0.6608873", "0.6600421", "0.6589409", "0.6476685", "0.63501203", "0.6333794...
0.7164615
2
Volume up the media player.
def volume_up(self) -> None: newvolume = min(self._client.volume + 4, 100) self._client.set_volume(newvolume)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def volume_up(self) -> None:\n self._state = self._player.volume_up()", "def volume_up(self):\n self._volume += settings.get(\"vlc\", \"volume\", \"step\")\n self._update_volume()\n # self.stdin_queue.put(\"volup\")", "def volume_up(self):\n self._remote.volume(int(self._volu...
[ "0.83150697", "0.8157221", "0.79739726", "0.79416966", "0.7691732", "0.7642095", "0.7590928", "0.7454616", "0.74177897", "0.74177897", "0.7358487", "0.7341644", "0.7250314", "0.72229487", "0.7213308", "0.7209929", "0.71201", "0.70324516", "0.7030003", "0.7005662", "0.6947025"...
0.7521488
7
Volume down media player.
def volume_down(self) -> None: newvolume = max(self._client.volume - 4, 0) self._client.set_volume(newvolume)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def volume_down(self):\n self._volume -= settings.get(\"vlc\", \"volume\", \"step\")\n self._update_volume()\n # self.stdin_queue.put(\"voldown\")", "def volume_down(self) -> None:\n self._state = self._player.volume_down()", "def volume_down(self):\n self._remote.volume(int(...
[ "0.8112854", "0.804127", "0.79031795", "0.7766054", "0.7751566", "0.7663452", "0.76481754", "0.76481754", "0.7636538", "0.7614832", "0.7582992", "0.745221", "0.7447365", "0.7420914", "0.72983295", "0.68772507", "0.68442637", "0.6788666", "0.67060065", "0.6633467", "0.66051424...
0.7441462
13
Simulate play pause media player.
def media_play_pause(self) -> None: if self.state == MediaPlayerState.PLAYING: self.media_pause() else: self.media_play()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_media_play_pause(player) -> None:\n assert player.state == STATE_OFF\n await player.async_media_play_pause()\n assert player.state == STATE_PLAYING\n await player.async_media_play_pause()\n assert player.state == STATE_PAUSED", "def _control_pause(self):\n self.player.pause()...
[ "0.8116942", "0.80330086", "0.8000475", "0.7805966", "0.7696691", "0.76267785", "0.7618228", "0.7533583", "0.7516676", "0.7498765", "0.74963427", "0.74963427", "0.7420536", "0.7380519", "0.736805", "0.73425657", "0.73408324", "0.72820014", "0.7275913", "0.7251658", "0.7247109...
0.8151165
0
Send media pause command to media player.
def media_pause(self) -> None: self._attr_state = MediaPlayerState.PAUSED self._client.pause()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_media_pause(self) -> None:\n await self._projector.send_command(PAUSE)", "def pause(self):\n self.sendCommand(\"pause\")", "def media_play_pause(self) -> None:\n if self.state == MediaPlayerState.PLAYING:\n self.media_pause()\n else:\n self.medi...
[ "0.809023", "0.759442", "0.7524616", "0.75083613", "0.7491196", "0.7491196", "0.7414291", "0.7250745", "0.724168", "0.72367144", "0.71571475", "0.71521604", "0.71426934", "0.71061397", "0.70989716", "0.7085035", "0.70630133", "0.6954041", "0.6925387", "0.68717307", "0.6850086...
0.77531683
1
Send next track command.
def media_next_track(self) -> None: self._client.next()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def media_next_track(self):\n self.handleCommand(27)", "async def async_media_next_track(self):\n await self.local_meural.send_key_right()", "async def async_media_next_track(self):\n if not self._slave_mode:\n if not self._playing_mass:\n value = await self.async...
[ "0.7637263", "0.7182071", "0.7067623", "0.693913", "0.6791026", "0.669103", "0.65849733", "0.6515745", "0.65091896", "0.6454078", "0.64358157", "0.64263296", "0.64238304", "0.6292885", "0.6282449", "0.61358553", "0.6131442", "0.6077058", "0.6062422", "0.59923947", "0.59777033...
0.70252526
3
Send the previous track command.
def media_previous_track(self) -> None: self._client.previous()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def media_previous_track(self):\n self.handleCommand(28)", "async def async_media_previous_track(self):\n await self.local_meural.send_key_left()", "async def async_media_previous_track(self):\n if not self._slave_mode:\n if not self._playing_mass:\n value = await...
[ "0.8249551", "0.76196414", "0.75633925", "0.7422574", "0.7405951", "0.73070335", "0.72534436", "0.7235791", "0.7137344", "0.7100116", "0.70965886", "0.70518535", "0.70392615", "0.69184697", "0.681314", "0.6702323", "0.66659826", "0.6575856", "0.65132546", "0.6510637", "0.6474...
0.76491725
1
Box with Lid. See xml for more info.
def __init__(self, env, initial_lid_pos, name, resource='objects/box_with_lid.xml'): self._env = env self._initial_lid_pos = initial_lid_pos self._name = name self._resource = resource
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_box_location(self):\n self.contents['Box_ID'] = np.ones(self.numatom) * self.num_box", "def add_box(self, l, w, h, x, y, z, comment=\"\"):\n self.data['shape']['compound'].append({'box': {'#': comment, 'pose': {'x': x, 'y': y, 'z': z},\n ...
[ "0.646756", "0.641661", "0.58954304", "0.58318424", "0.58084816", "0.5737751", "0.57088435", "0.5644141", "0.56273854", "0.5592895", "0.55899185", "0.5582731", "0.55821747", "0.55549514", "0.5553726", "0.5544039", "0.5518349", "0.551408", "0.5510807", "0.5510807", "0.54989916...
0.5329588
28
Block attached to peg. See xml for more info.
def __init__(self, env, initial_pos, random_delta_range, name, resource='objects/block_peg.xml'): self._env = env self._initial_pos = np.asarray(initial_pos) self._random_delta_range = np.asarray(random_delta_ra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onBlock(self, data) :\n pass", "def penblock(self, block):\n self.block = block", "def add_block(self, env):\n block_size = (0.04, 0.04, 0.04)\n block_pose = self.random_pose(env, block_size)\n block_urdf = 'assets/stacking/block.urdf'\n block_id = env.add_object(b...
[ "0.6299285", "0.62494606", "0.5948382", "0.5869707", "0.5861398", "0.57957786", "0.5764005", "0.57609606", "0.5754582", "0.57317865", "0.56770635", "0.56770635", "0.56311584", "0.55958897", "0.55761683", "0.5558237", "0.5510801", "0.55058366", "0.54752433", "0.54671407", "0.5...
0.0
-1
World containing a box with a lid, and a peg to open it.
def __init__(self, env, xml_config, box_lid_pos=0., peg_pos=[0.75, 0.1, 0.1], peg_delta_range=[0., 0.]): self._env = env self._xml_config = xml_config self._box_lid_pos = box_lid_pos self._peg_pos = peg_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def room_with_box():\n\troom_material = pra.Material(energy_absorption=0.6, scattering=None)\n\troom_faces = make_polygon(\n\t\tcentre=[0,0,2.5],\n\t\tradius=10,\n\t\theight=5,\n\t\tN=4,\n\t\trpy=[0,0,np.pi/4]\n\t)\n\n\t# define obstacle\n\tobstacle_faces = make_polygon(\n\t\tcentre=[2.5,0,2.5],\n\t\tradius=1.8,\n...
[ "0.6026777", "0.5739972", "0.57147884", "0.5655483", "0.56292", "0.55451924", "0.552503", "0.5509055", "0.5503862", "0.5486842", "0.54634327", "0.5458408", "0.54434514", "0.54172194", "0.5397755", "0.5392325", "0.5368659", "0.5365851", "0.5354393", "0.5353537", "0.5352438", ...
0.0
-1
Update the requirements.txt file and reformat the Pipfile.
def main(requirements_file, skip_requirements_file, pipfile, skip_pipfile): # type: (str, bool, str, bool) -> None pipfile_path = path.Path(pipfile) pf = load_pipfile(pipfile_path) if not skip_requirements_file: requirements_file_path = path.Path(requirements_file) update_requirements(r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def update(self, ctx):\n # read original contents of pipfile\n with open('Pipfile') as f:\n original_pipfile = f.read()\n\n # run git pull. If nothing new is pulled, exit here.\n pull_output = await ctx.invoke(ctx.bot.get_command('pull'))\n\n if 'updating' not i...
[ "0.7084875", "0.70844316", "0.69630224", "0.69021636", "0.6898123", "0.6449469", "0.6324992", "0.62681717", "0.6202624", "0.6088608", "0.6079661", "0.6035315", "0.6010844", "0.6007739", "0.5954219", "0.5889616", "0.58804846", "0.58313686", "0.58312327", "0.5784639", "0.576265...
0.68897945
5
Calc 2d spline course with interpolation
def calc_2d_spline_interpolation(x, y, num=100): sp = Spline2D(x, y) s = np.linspace(0, sp.s[-1], num+1)[:-1] r_x, r_y, r_yaw, r_k = [], [], [], [] for i_s in s: ix, iy = sp.calc_position(i_s) r_x.append(ix) r_y.append(iy) r_yaw.append(sp.calc_yaw(i_s)) r_k.appen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interpolateSpline(x, y) :\n n = len(x)\n\n dim = 4 * (n - 1)\n b = np.zeros((dim, 1))\n A = np.zeros((dim, dim))\n\n for i in range(n-1):\n x1 = x[i]\n x2 = x[i+1]\n y1 = y[i]\n y2 = y[i+1]\n b[i*4:(i+1)*4, 0] = [y1, y2, 0, 0]\n\n A[i*4, i*4:(i+1)*4] = [...
[ "0.75392544", "0.73000425", "0.7247718", "0.70745677", "0.70485204", "0.6896351", "0.67513216", "0.65251607", "0.6505519", "0.64778066", "0.645612", "0.6421897", "0.62957704", "0.62941617", "0.62836426", "0.62663037", "0.62661314", "0.62505496", "0.6230855", "0.6228699", "0.6...
0.68838024
6
The set of arguments for constructing a Invocation resource.
def __init__(__self__, *, function_name: pulumi.Input[str], input: pulumi.Input[str], qualifier: Optional[pulumi.Input[str]] = None, triggers: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None): pulumi.set(__self__, "function_name"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, namespace, listOfArgumentNames):\n self.namespace = namespace\n self.listOfArgumentNames = listOfArgumentNames", "def CreateArgs(run_task_request, args):\n if getattr(args, \"ARGS\", None):\n args_ref = dataplex_api.FetchExecutionSpecArgs(args.ARGS)\n if len(args_ref) > 0:...
[ "0.6244963", "0.6064142", "0.6025504", "0.5993122", "0.59805226", "0.59673625", "0.59494746", "0.5927861", "0.59101176", "0.5889685", "0.58754504", "0.5861338", "0.5853028", "0.5831971", "0.5760043", "0.5757983", "0.5754587", "0.5748414", "0.5736711", "0.5730506", "0.5728922"...
0.0
-1
Name of the lambda function.
def function_name(self) -> pulumi.Input[str]: return pulumi.get(self, "function_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n\t\treturn self._func_name", "def function_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"function_name\")", "def function_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"function_name\")", "def function_name(self) -> Optional[pulumi.Input[str]]:\n ...
[ "0.75944763", "0.7466118", "0.7466118", "0.7391393", "0.73342067", "0.7193053", "0.71084285", "0.7066119", "0.6840698", "0.6837291", "0.6763094", "0.65932614", "0.6569362", "0.6566482", "0.6476233", "0.64046985", "0.6297647", "0.6272834", "0.62716764", "0.626815", "0.6246849"...
0.77050376
1
JSON payload to the lambda function.
def input(self) -> pulumi.Input[str]: return pulumi.get(self, "input")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_lambda_payload(self, date: str, symbol: str) -> bytes:\n self._lambda_event['s3_bucket'] = self._config['s3_bucket']\n self._lambda_event['s3_key_quotes'] = (\n self._config['s3_key_input_prefix'] + date + '/' + symbol + '/' +\n self._config['s3_key_quotes_suffix'])\n ...
[ "0.6537401", "0.6435479", "0.6433545", "0.6389464", "0.63662946", "0.63558084", "0.6291786", "0.6266016", "0.6230665", "0.6211438", "0.62085325", "0.62069964", "0.6166684", "0.6158678", "0.61519873", "0.61504626", "0.61504626", "0.61433136", "0.61325645", "0.6110487", "0.6093...
0.0
-1
Qualifier (i.e., version) of the lambda function. Defaults to `$LATEST`.
def qualifier(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "qualifier")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def function_version(self) -> str:\n return pulumi.get(self, \"function_version\")", "def get_lambda_latest_version_num(fn_arn: str, region: str) -> int:\n\n client = boto3.client('lambda', region_name=region)\n response = client.list_versions_by_function(FunctionName=fn_arn)\n\n for v in respons...
[ "0.66411906", "0.63990325", "0.5234373", "0.51821023", "0.5175053", "0.51695466", "0.51431835", "0.50511765", "0.50181675", "0.5002993", "0.49775565", "0.49529707", "0.4950628", "0.4907003", "0.490198", "0.490198", "0.490198", "0.490198", "0.490198", "0.490198", "0.490198", ...
0.48600695
34
Map of arbitrary keys and values that, when changed, will trigger a reinvocation.
def triggers(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: return pulumi.get(self, "triggers")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_dict(new,old):", "def test_dictionary_inplace_update(self):\r\n vm = Dictionary.value_manager(None, None, {1:2, 3:4})\r\n assert not vm.changed\r\n vm.value[4] = 5\r\n assert vm.changed", "def test_dict(self):\n event_cache = []\n\n class A(HasTraits):\n ...
[ "0.645274", "0.6258521", "0.616605", "0.6099212", "0.60495317", "0.59831303", "0.5854459", "0.585022", "0.5841429", "0.57649016", "0.57519615", "0.5711017", "0.55702174", "0.5550343", "0.5543891", "0.5535223", "0.54757035", "0.54222584", "0.54219085", "0.54190826", "0.5399805...
0.0
-1
Input properties used for looking up and filtering Invocation resources.
def __init__(__self__, *, function_name: Optional[pulumi.Input[str]] = None, input: Optional[pulumi.Input[str]] = None, qualifier: Optional[pulumi.Input[str]] = None, result: Optional[pulumi.Input[str]] = None, triggers: Optional[pulum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, operation_inputs):\n\n full_operation_name = ctx.operation.name\n self.operation_name = full_operation_name.split('.').pop()\n\n # These should not make their way into the Operation inputs.\n os.environ['_PAGINATION_OFFSET'] = \\\n text_type(operation_input...
[ "0.5469962", "0.54293776", "0.5392672", "0.53824884", "0.5275353", "0.5259073", "0.5255024", "0.5255024", "0.5255024", "0.5230854", "0.51913863", "0.51881474", "0.51731974", "0.51597875", "0.5158078", "0.5158078", "0.5121914", "0.5116958", "0.51032776", "0.510278", "0.5102727...
0.0
-1
Name of the lambda function.
def function_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "function_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def function_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"function_name\")", "def function_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"function_name\")", "def name(self):\n\t\treturn self._func_name", "def function_name(self) -> pulumi.Output[str]:\n retu...
[ "0.77034545", "0.77034545", "0.7593706", "0.7464853", "0.7464853", "0.73329914", "0.7193673", "0.7108169", "0.70655984", "0.6839772", "0.68352073", "0.67619866", "0.6591472", "0.65683824", "0.6567803", "0.6475904", "0.6402211", "0.6297765", "0.6272437", "0.62723136", "0.62687...
0.73899704
5
JSON payload to the lambda function.
def input(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "input")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_lambda_payload(self, date: str, symbol: str) -> bytes:\n self._lambda_event['s3_bucket'] = self._config['s3_bucket']\n self._lambda_event['s3_key_quotes'] = (\n self._config['s3_key_input_prefix'] + date + '/' + symbol + '/' +\n self._config['s3_key_quotes_suffix'])\n ...
[ "0.6537401", "0.6435479", "0.6433545", "0.6389464", "0.63662946", "0.63558084", "0.6291786", "0.6266016", "0.6230665", "0.6211438", "0.62085325", "0.62069964", "0.6166684", "0.6158678", "0.61519873", "0.61504626", "0.61504626", "0.61433136", "0.61325645", "0.6110487", "0.6093...
0.0
-1
Qualifier (i.e., version) of the lambda function. Defaults to `$LATEST`.
def qualifier(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "qualifier")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def function_version(self) -> str:\n return pulumi.get(self, \"function_version\")", "def get_lambda_latest_version_num(fn_arn: str, region: str) -> int:\n\n client = boto3.client('lambda', region_name=region)\n response = client.list_versions_by_function(FunctionName=fn_arn)\n\n for v in respons...
[ "0.6641541", "0.63990086", "0.52345157", "0.5183876", "0.51753867", "0.5168743", "0.51431197", "0.50533974", "0.5019931", "0.50056404", "0.49792406", "0.49541116", "0.4951745", "0.490851", "0.49036467", "0.49036467", "0.49036467", "0.49036467", "0.49036467", "0.49036467", "0....
0.4862319
35
String result of the lambda function invocation.
def result(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "result")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lambda_handler(event, context):\n name: str = event['name']\n return f'Hi {name}!'", "def function_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"function_name\")", "def function_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"function_name\")", "def lambd...
[ "0.6376477", "0.62443215", "0.62443215", "0.6056641", "0.6049122", "0.6044755", "0.5996724", "0.59543884", "0.59541714", "0.5934549", "0.5891712", "0.58881766", "0.57815313", "0.5733773", "0.5635553", "0.56257564", "0.5584697", "0.55613136", "0.55607224", "0.5553068", "0.5549...
0.0
-1
Map of arbitrary keys and values that, when changed, will trigger a reinvocation.
def triggers(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: return pulumi.get(self, "triggers")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_dict(new,old):", "def test_dictionary_inplace_update(self):\r\n vm = Dictionary.value_manager(None, None, {1:2, 3:4})\r\n assert not vm.changed\r\n vm.value[4] = 5\r\n assert vm.changed", "def test_dict(self):\n event_cache = []\n\n class A(HasTraits):\n ...
[ "0.6451828", "0.6257158", "0.6163793", "0.60974216", "0.60500365", "0.5982999", "0.58533454", "0.5849826", "0.58412707", "0.57633644", "0.5753699", "0.571072", "0.55697256", "0.5549071", "0.5544989", "0.5534039", "0.54753613", "0.5421922", "0.5420793", "0.54177576", "0.539898...
0.0
-1
Get an existing Invocation resource's state with the given name, id, and optional extra properties used to qualify the lookup.
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, function_name: Optional[pulumi.Input[str]] = None, input: Optional[pulumi.Input[str]] = None, qualifier: Optional[pulumi.Input[str]] = None, result: O...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n activation_key: Optional[pulumi.Input[str]] = None,\n arn: Optional[pulumi.Input[str]] = None,\n ip_address: Optional[pulumi.Input[str]] = None,\n ...
[ "0.58092475", "0.56211823", "0.5562653", "0.5514351", "0.5514051", "0.5457251", "0.54326993", "0.542786", "0.5396179", "0.5394465", "0.5353406", "0.5345885", "0.5341295", "0.5336269", "0.5336196", "0.5327796", "0.5297418", "0.5287107", "0.5264695", "0.5260708", "0.5249568", ...
0.659338
0
Name of the lambda function.
def function_name(self) -> pulumi.Output[str]: return pulumi.get(self, "function_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def function_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"function_name\")", "def function_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"function_name\")", "def name(self):\n\t\treturn self._func_name", "def function_name(self) -> Optional[pulumi.Input[str]]:\n ...
[ "0.77034545", "0.77034545", "0.7593706", "0.73899704", "0.73329914", "0.7193673", "0.7108169", "0.70655984", "0.6839772", "0.68352073", "0.67619866", "0.6591472", "0.65683824", "0.6567803", "0.6475904", "0.6402211", "0.6297765", "0.6272437", "0.62723136", "0.6268716", "0.6246...
0.7464853
4
JSON payload to the lambda function.
def input(self) -> pulumi.Output[str]: return pulumi.get(self, "input")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_lambda_payload(self, date: str, symbol: str) -> bytes:\n self._lambda_event['s3_bucket'] = self._config['s3_bucket']\n self._lambda_event['s3_key_quotes'] = (\n self._config['s3_key_input_prefix'] + date + '/' + symbol + '/' +\n self._config['s3_key_quotes_suffix'])\n ...
[ "0.6538712", "0.64331055", "0.64326906", "0.6389101", "0.6364047", "0.63546777", "0.62912625", "0.62705666", "0.6229331", "0.6210945", "0.6210182", "0.6204859", "0.6172121", "0.6156562", "0.6149879", "0.6147023", "0.6147023", "0.6141123", "0.6130984", "0.6108313", "0.6090652"...
0.0
-1
Qualifier (i.e., version) of the lambda function. Defaults to `$LATEST`.
def qualifier(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "qualifier")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def function_version(self) -> str:\n return pulumi.get(self, \"function_version\")", "def get_lambda_latest_version_num(fn_arn: str, region: str) -> int:\n\n client = boto3.client('lambda', region_name=region)\n response = client.list_versions_by_function(FunctionName=fn_arn)\n\n for v in respons...
[ "0.66423076", "0.64009196", "0.52357906", "0.5183368", "0.51745695", "0.51704615", "0.514472", "0.50531745", "0.50192595", "0.5005698", "0.49799076", "0.49550298", "0.49529997", "0.4908176", "0.49046764", "0.4904551", "0.4904551", "0.4904551", "0.4904551", "0.4904551", "0.490...
0.47418374
70
String result of the lambda function invocation.
def result(self) -> pulumi.Output[str]: return pulumi.get(self, "result")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lambda_handler(event, context):\n name: str = event['name']\n return f'Hi {name}!'", "def function_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"function_name\")", "def function_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"function_name\")", "def lambd...
[ "0.63775957", "0.6243465", "0.6243465", "0.6057504", "0.6049874", "0.604393", "0.59944534", "0.59546214", "0.5952952", "0.59346074", "0.5891595", "0.5888873", "0.5779383", "0.5732003", "0.563572", "0.56272775", "0.5584745", "0.55607206", "0.5560158", "0.55510116", "0.5549994"...
0.5227699
67
Map of arbitrary keys and values that, when changed, will trigger a reinvocation.
def triggers(self) -> pulumi.Output[Optional[Mapping[str, str]]]: return pulumi.get(self, "triggers")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_dict(new,old):", "def test_dictionary_inplace_update(self):\r\n vm = Dictionary.value_manager(None, None, {1:2, 3:4})\r\n assert not vm.changed\r\n vm.value[4] = 5\r\n assert vm.changed", "def test_dict(self):\n event_cache = []\n\n class A(HasTraits):\n ...
[ "0.645274", "0.6258521", "0.616605", "0.6099212", "0.60495317", "0.59831303", "0.5854459", "0.585022", "0.5841429", "0.57649016", "0.57519615", "0.5711017", "0.55702174", "0.5550343", "0.5543891", "0.5535223", "0.54757035", "0.54222584", "0.54219085", "0.54190826", "0.5399805...
0.0
-1
Returns a sorted list of query ids
def getQueries(self): return sorted( self.qryDocs.keys() )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_ids(self):\n for object_query in self.query:\n objects = self._get_objects(object_query)\n objects = self._apply_order_by_and_limit(\n objects,\n order_by=object_query.get(\"order_by\"),\n limit=object_query.get(\"limit\"),\n )\n object_query[\"ids\"] = [o....
[ "0.69242555", "0.6751612", "0.6483866", "0.6429385", "0.6352032", "0.62008715", "0.6198006", "0.6170076", "0.6170076", "0.61510664", "0.6146125", "0.6133298", "0.611966", "0.6042621", "0.603371", "0.5974146", "0.59307647", "0.5919666", "0.590026", "0.58894217", "0.5859048", ...
0.658589
2
Returns a list of the retrieved documents for the query
def getDocs(self, qryid, counter = None): if (counter is None) or (counter>=len(self.qryDocs[qryid])): return self.qryDocs[qryid] else: return self.qryDocs[qryid][:counter]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_documents(self) -> Iterable[dict]:\n\n return self._db[\"documents\"]", "def query(self):\n query_url = self.get_query_url()\n logging.info('Querying: ' + query_url)\n json_data = request.urlopen(query_url).read().decode()\n logging.debug('Retrieved the following ' + j...
[ "0.77354777", "0.7667796", "0.76610154", "0.7576085", "0.7447628", "0.74134624", "0.71889716", "0.7155771", "0.71408826", "0.69945997", "0.6970507", "0.6968448", "0.6950308", "0.69352466", "0.6923409", "0.69165117", "0.6892293", "0.6890513", "0.68716574", "0.68527853", "0.685...
0.64337456
55
Returns a list of the retrieved documents' scores
def getScores(self, qryid, counter = None): if counter is None: return self.qryScores[qryid] else: return self.qryScores[qryid][:counter]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_scores(self):\n return self.score", "def score(self):\n return self.client.call('GET', self.name + 'score')", "def scores_(self):\n return self.predictor.scores_", "def scores(self) -> List[float]:\n if not self.prediction:\n return []\n return [sentence....
[ "0.724398", "0.70670176", "0.69395506", "0.69351584", "0.6927607", "0.6664462", "0.6543519", "0.6535992", "0.6532264", "0.6494205", "0.64925236", "0.64834094", "0.64812046", "0.6451317", "0.644733", "0.64114875", "0.6407428", "0.6324462", "0.6300784", "0.6266783", "0.6252493"...
0.5750148
68
Return document retrieval score. If docid doesn't exist in the list, then method returns 0 score.
def getDocScore(self, qryid, docid): retrievedDocs = self.getDocs(qryid) for pos in range(len(retrievedDocs)): if docid == retrievedDocs[pos]: return self.qryScores[qryid][pos] return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def score(self, index, query, doc_id):\n return 1", "def score(self, index, query, doc_id):\n query_vec = self._get_query_representation(query, index)\n doc_vec = self._get_document_representation(doc_id, index)\n return self._similarity(query_vec, doc_vec)", "def tf_idf_score():\n\...
[ "0.74571574", "0.6616278", "0.6386327", "0.6302467", "0.62684375", "0.6095989", "0.60721517", "0.60592145", "0.60592145", "0.60391366", "0.6036707", "0.60315067", "0.59710914", "0.5947047", "0.59403086", "0.59256047", "0.5889441", "0.58889556", "0.58793545", "0.58497417", "0....
0.7950941
0
Sends a message to the nick.
def send(self, message): self.client.send('PRIVMSG', self, message, force=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_as_nick(self, command, msg):\n self._write(f':{self.ident.nick} {command} {msg}')", "def sendnick(self):\n self._send(\"NICK %s\" % (CONFIG[\"nick\"]))", "def sendChatMessage(self, msg):\n self.transport.write(msg)", "def send(self, msg):\n self.message('Me', msg)", "def se...
[ "0.78963923", "0.7348465", "0.72309643", "0.71757305", "0.71429473", "0.71214193", "0.71134937", "0.7102403", "0.7016644", "0.7010554", "0.7000045", "0.697002", "0.6954962", "0.68770975", "0.6831442", "0.6811696", "0.68012816", "0.6797111", "0.6793605", "0.6779309", "0.676968...
0.65759915
33
Returns all the Channels that both the nick and the client has joined.
def channels(self): return [channel for channel in self.client.channels if channel.has_nick(self)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_channels_for(self, server, nick):\n channels = []\n for channel in self.serverchans[server.lower()].values():\n if irc.strings.lower(nick) in channel.users:\n channels.append(channel)\n return channels", "def get_channels():\n r = slack.channels.list().bo...
[ "0.7689199", "0.69669604", "0.66077626", "0.64817184", "0.6466343", "0.63576937", "0.6349284", "0.63328314", "0.63226914", "0.6310823", "0.62999576", "0.6298013", "0.628262", "0.62560254", "0.61833847", "0.6165296", "0.61439246", "0.6142929", "0.61309534", "0.6128517", "0.612...
0.77265155
0
Cost function using binary crossentropy
def cost(self, Y, A): m = Y.shape[1] C = (-1 / m) * np.sum(Y * np.log(A) + (1 - Y) * (np.log(1.0000001 - A))) return C
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binary_crossentropy(output, target):\r\n return -(target * tensor.log(output) + (1.0 - target) * tensor.log(1.0 - output))", "def binary_crossentropy(predictions, targets):\n return theano.tensor.nnet.binary_crossentropy(predictions, targets)", "def compute_cost(Z6, Y):\n\n cost = tf.reduce_mean(t...
[ "0.77854806", "0.7722801", "0.734179", "0.7316423", "0.7314664", "0.7280549", "0.7246427", "0.72080016", "0.72075146", "0.71928245", "0.71274495", "0.7125283", "0.71109074", "0.710973", "0.7100907", "0.70664674", "0.7050997", "0.7037364", "0.70035136", "0.6952975", "0.6936544...
0.0
-1
Calculates the amount of ORE required for a given amount of fuel
def ore_required(recipes, fuel_required=1): stock_required = {'FUEL': fuel_required} is_finished = False while not is_finished: sku, sku_quantity_required = next((sku, sku_quantity_required) for sku, sku_quantity_required in stock_required.items() if sku_q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _calculate_fuel_simple(self):\n self._fuel_simple = (self.mass // 3) - 2", "def calc_fuel_given_ore(ore, recipes):\n\n upper_bound = None\n lower_bound = 469536 # assume ore needed for 1 fuel is good lower bound\n\n\n while lower_bound + 1 != upper_bound:\n if upper_bound is None:\n ...
[ "0.71351874", "0.6992234", "0.6928581", "0.6891486", "0.6802863", "0.67839015", "0.670754", "0.6705683", "0.66584235", "0.6638039", "0.663743", "0.6634727", "0.6633174", "0.65847164", "0.65335196", "0.6518364", "0.64671177", "0.644818", "0.644271", "0.6359727", "0.6337555", ...
0.64869946
16
Ask user for an upper bound and returns a list containing an upper and lower bound
def get_bounds(): lower_bound = 0 upper_bound = input("Please enter a whole number: ") domain = [lower_bound, upper_bound] return domain
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bounds():\n return [0.00], [1.00]", "def AskForNumberRange():\n\n\twhile True:\n\t\t# This OUTER loop will loop forever until the user enters correct integers for\n\t\t# lower and upper bound, such that lobound < hibound.\n\n\t\twhile True:\n\t\t\t# This INNER loop will loop forever until the ...
[ "0.682871", "0.6680871", "0.6663449", "0.6461233", "0.6457602", "0.6383037", "0.6375019", "0.63575613", "0.6352746", "0.6348871", "0.6233797", "0.6187964", "0.6147755", "0.613873", "0.61301994", "0.6121017", "0.6093464", "0.6086115", "0.6073772", "0.6073625", "0.6072353", "...
0.8307625
0
Test that noun_chunks raises Value Error for 'fi' language if Doc is not parsed. To check this test, we're constructing a Doc with a new Vocab here and forcing is_parsed to 'False' to make sure the noun chunks don't run.
def test_noun_chunks_is_parsed(fi_tokenizer): doc = fi_tokenizer("Tämä on testi") with pytest.raises(ValueError): list(doc.noun_chunks)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_noun_chunks_is_parsed_fr(fr_tokenizer):\n doc = fr_tokenizer(\"trouver des travaux antérieurs\")\n with pytest.raises(ValueError):\n list(doc.noun_chunks)", "def test_parse_simple_nonmember(self):\n lexed = [\n Token(\n value=\"qet\",\n token_...
[ "0.7741058", "0.5441808", "0.51667565", "0.5122168", "0.5025865", "0.49811262", "0.49760607", "0.4974837", "0.4910542", "0.48398942", "0.48027694", "0.4799192", "0.47787705", "0.4753563", "0.474306", "0.47351125", "0.47177085", "0.47013432", "0.4684846", "0.46820647", "0.4678...
0.80459315
0
{ Carrionette|VRGR} { Gibbering mouther} { chapter 5|VRGR|5|Priests of Osybus} { Keepers of the Feather|VRGR|3|Keepers of the Feather} { Monster Manual|MM} { MM|MM} { chapter 5|VRGR|5} { Curse of Strahd|CoS} { Vine Blight||vine blights} { Domain of Alien Memories} itallics { modify memory} { star spawn emissary} bolded...
def fix_links(): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_item_formatting(possible_matches):\n for i in range(len(possible_matches)):\n if i == 0:\n continue\n words = possible_matches[i].split()\n\n #If previous term has same ending (\"Dinner\") as current term, remove it\n if possible_matches[i].split()[-1] == possible...
[ "0.54976827", "0.54719514", "0.5322297", "0.52816135", "0.52341515", "0.5196226", "0.51849", "0.51808786", "0.51729864", "0.5135752", "0.51132756", "0.50834715", "0.50587803", "0.502308", "0.5018544", "0.5004243", "0.49756864", "0.49671763", "0.4965958", "0.49378312", "0.4929...
0.0
-1
Rerun CLI command inside a tobecreated conda environment.
def _rerun_in_conda(conda_env_path): conda_env_name = _get_or_create_conda_env(conda_env_path) activate_path = _get_conda_bin_executable("activate") commands = [] commands.append("source {} {}".format(activate_path, conda_env_name)) safe_argv = [shlex_quote(arg) for arg in sys.argv] commands.app...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepConda(commands_list, envName = envName):\n commands_list.append('module load conda2')\n commands_list.append('source deactivate') # Removes any pre-existing conda environments\n commands_list.append('source activate {eName}'.format(eName = envName))", "def time_conda_run():\n from conda.testi...
[ "0.6140316", "0.5963909", "0.57024294", "0.56684333", "0.5625119", "0.56162804", "0.5252688", "0.5224873", "0.5202257", "0.51971525", "0.51945513", "0.5131335", "0.5123417", "0.51196927", "0.5108993", "0.50988483", "0.5078373", "0.50722355", "0.50060016", "0.49738103", "0.496...
0.71491045
0
Serve Python models locally. To serve a model associated with a run on a tracking server, set the MLFLOW_TRACKING_URI environment variable to the URL of the desired server.
def commands(): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serve(model_path, run_id, port, host, no_conda):\n if run_id:\n model_path = _get_model_log_dir(model_path, run_id)\n\n model_env_file = _load_model_env(model_path)\n if not no_conda and model_env_file is not None:\n conda_env_path = os.path.join(model_path, model_env_file)\n retu...
[ "0.6560286", "0.64194596", "0.6404588", "0.587721", "0.5865771", "0.58165324", "0.5640516", "0.5599409", "0.5582179", "0.5575687", "0.55372185", "0.54902416", "0.5471806", "0.54470295", "0.5435611", "0.543411", "0.543088", "0.5413148", "0.54089355", "0.53982294", "0.53869677"...
0.0
-1
Serve a PythonFunction model saved with MLflow. If a ``run_id`` is specified, ``modelpath`` is treated as an artifact path within that run; otherwise it is treated as a local path.
def serve(model_path, run_id, port, host, no_conda): if run_id: model_path = _get_model_log_dir(model_path, run_id) model_env_file = _load_model_env(model_path) if not no_conda and model_env_file is not None: conda_env_path = os.path.join(model_path, model_env_file) return _rerun_in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_fn(fn_args: TrainerFnArgs):\n\n # Training set size\n TRAIN_SIZE = get_dataset_size(fn_args.train_files)\n NUM_STEPS = TRAIN_SIZE / BATCH_SIZE # number of steps per epoch for which to train model\n \n tf_transform_output = tft.TFTransformOutput(fn_args.transform_output)\n \n train_data...
[ "0.58916014", "0.5890586", "0.57216805", "0.5697928", "0.5560071", "0.5538942", "0.55345696", "0.54726624", "0.5426289", "0.5396827", "0.5383806", "0.5382573", "0.5378443", "0.5323406", "0.5306347", "0.5273451", "0.5273443", "0.52704054", "0.52411795", "0.5230054", "0.5208484...
0.6641278
0
Load a pandas DataFrame and runs a python_function model saved with MLflow against it. Return the prediction results as a CSVformatted pandas DataFrame. If a ``runid`` is specified, ``modelpath`` is treated as an artifact path within that run; otherwise it is treated as a local path.
def predict(model_path, run_id, input_path, output_path, no_conda): if run_id: model_path = _get_model_log_dir(model_path, run_id) model_env_file = _load_model_env(model_path) if not no_conda and model_env_file is not None: conda_env_path = os.path.join(model_path, model_env_file) r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate(\n config, feature_table, label_table,\n model_paths, model_summaries,\n save_preds_to_db=False, save_prefix='',\n discard_columns=[], log_dir='./results/'):\n\n # Create log directory if not exists\n if not os.path.exists(log_dir):\n os.makedirs(log_dir)\n\n # Get feature ...
[ "0.62471294", "0.591763", "0.589063", "0.5767314", "0.55636126", "0.5445633", "0.54294544", "0.53925204", "0.53252816", "0.5324131", "0.5243129", "0.5235573", "0.5235118", "0.5224704", "0.5215015", "0.5210782", "0.5205274", "0.5199694", "0.5183146", "0.51796335", "0.517105", ...
0.68641376
0
Returns an array for the inheritance at a nuclear locus with n alleles.
def nuclear_inheritance_at_single_locus(n): ary = np.zeros((n,n,n)) for female in range(n): for male in range(n): for offspring in range(n): if female==male==offspring: ary[female,male,offspring]=1. if female!=male: if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nuclear_inheritance_at_y_locus(n):\n ary = np.zeros((n,n,n)) # female, male, offspring\n for male in range(1,n):\n ary[0,male,0] = ary[0,male,male] = 1 # one daughter, one son\n return ary", "def basisVar(bases):\n \n var = [] # The ordered list of active coordinates ...
[ "0.68091816", "0.56342465", "0.54614604", "0.5391642", "0.5375723", "0.53475916", "0.53350717", "0.531773", "0.52842516", "0.52697146", "0.5118117", "0.50960046", "0.50157857", "0.4984859", "0.49818936", "0.4934643", "0.4923983", "0.48903525", "0.48903525", "0.48512107", "0.4...
0.68057257
1
Returns an array for the inheritance at a ychromosome locus with n alleles (where the first allele means "no ychromosome", i.e. female).
def nuclear_inheritance_at_y_locus(n): ary = np.zeros((n,n,n)) # female, male, offspring for male in range(1,n): ary[0,male,0] = ary[0,male,male] = 1 # one daughter, one son return ary
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nuclear_inheritance_at_single_locus(n):\n ary = np.zeros((n,n,n))\n for female in range(n):\n for male in range(n):\n for offspring in range(n):\n if female==male==offspring:\n ary[female,male,offspring]=1.\n if female!=male:\n ...
[ "0.68316793", "0.52946764", "0.52098745", "0.50238895", "0.50112236", "0.499121", "0.4984106", "0.4927073", "0.49246916", "0.487069", "0.48361552", "0.48348838", "0.4824314", "0.48227447", "0.48155507", "0.4785766", "0.47687185", "0.47678024", "0.47588527", "0.4755671", "0.47...
0.7611592
0
Compatible index groups 0/1 (A1,A2,B1,B2) and 2/3 (A3,A4,B3,B4) To determine the appropriate marker state, we will count the number of alleles (during the diploid phase) belonging to index group 1. Gr. 1 Steril. count marker Explanation 0 or 4 S0 no allele involved in incompatibilities, fully fertile (1) 2 S1 all 4 all...
def offspring_fertility(n1=4,n2=4): ary = np.zeros( (n1,n2, n1,n2, 3), float ) for i in range(n1): for j in range(n2): for k in range(n1): for l in range(n2): # set group counter to zero (one counter is sufficient) gc1 = 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def giniIndex(self, groups):\n n = sum([len(g) for g in groups])\n gini = 0.0\n for g in groups:\n if len(g) == 0: continue\n score = 0\n for c in self.classes:\n p = [r[-1] for r in g].count(c) / len(g)\n score += p * p\n ...
[ "0.5661988", "0.5445959", "0.5352282", "0.52611715", "0.52502793", "0.5246728", "0.52346057", "0.52059287", "0.5193185", "0.5147294", "0.5127264", "0.5097809", "0.5094135", "0.5081257", "0.50290185", "0.49999043", "0.49905908", "0.49850026", "0.49826434", "0.49777365", "0.496...
0.49147612
32
Returns a nested element label list.
def element_labels(hosts, *loci): num_loci = int(len(loci) / 2) # number of loci elements = [] for i in hosts: for j in range(num_loci): locus_abbrev, allele_range = loci[j*2:(j+1)*2] elements.append( ["%s%s%d" % (i,locus_abbrev,k) for k in allele_range] ) return e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_labels(self, depth=None):\n labels = libCopy.deepcopy(self.labels)\n if depth is None or depth > 0:\n for element in self.elements:\n if isinstance(element, CellReference):\n labels.extend(\n element.get_labels(None if depth ...
[ "0.69724953", "0.66440785", "0.6584364", "0.65755326", "0.6563327", "0.64899945", "0.64018184", "0.63992316", "0.6393283", "0.63765824", "0.6373589", "0.6325616", "0.63025737", "0.6302564", "0.62481004", "0.6218792", "0.62084216", "0.61802614", "0.6172223", "0.6171989", "0.61...
0.6261045
14
This method is called after assignment to a populationp.
def _init_after_assignment(self): self.labels = { 'axes': [self.locus], \ 'elements': [self.pop._get_axis_elements(self.locus)] } self._init_labels(self.labels)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_population(self):\n pass", "def update(self):\n self.chromosome_list = self.next_population\n self.reset_mating_pool()\n self.reset_next_population()", "def on_assign(self):", "def init_pop(self):\n genes = np.random.randn( self.population_size * self.individual.ge...
[ "0.6783058", "0.6499103", "0.64520025", "0.63784206", "0.6292192", "0.6238812", "0.6130736", "0.6072983", "0.60598457", "0.6027957", "0.5980297", "0.5886131", "0.5880756", "0.58642906", "0.5846734", "0.5805156", "0.57963616", "0.57949483", "0.5778682", "0.57561123", "0.572671...
0.52223545
64
This method is called after assignment to a populationp.
def _init_after_assignment(self): self.labels = { 'axes': [self.locus1, self.locus2], \ 'elements': [self.pop._get_axis_elements(self.locus1), self.pop._get_axis_elements(self.locus2)] } self._init_labels(self.labels)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_population(self):\n pass", "def update(self):\n self.chromosome_list = self.next_population\n self.reset_mating_pool()\n self.reset_next_population()", "def on_assign(self):", "def init_pop(self):\n genes = np.random.randn( self.population_size * self.individual.ge...
[ "0.6781482", "0.64989024", "0.6452162", "0.6377374", "0.6291111", "0.6236171", "0.61310154", "0.6073461", "0.6057978", "0.6027081", "0.59793514", "0.5884385", "0.5880151", "0.58638716", "0.58442855", "0.58037657", "0.5794639", "0.57940483", "0.5777354", "0.5754382", "0.572609...
0.52738607
58
This method is called after assignment to a populationp.
def _init_after_assignment(self): self.labels = { 'axes': [self.locus1, self.locus2, self.locus3], \ 'elements': [self.pop._get_axis_elements(self.locus1), self.pop._get_axis_elements(self.locus2), self.pop._get_axis_elements(self.locus3)] } self._init_labels(self.labels)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_population(self):\n pass", "def update(self):\n self.chromosome_list = self.next_population\n self.reset_mating_pool()\n self.reset_next_population()", "def on_assign(self):", "def init_pop(self):\n genes = np.random.randn( self.population_size * self.individual.ge...
[ "0.6781537", "0.649858", "0.6452947", "0.6377448", "0.6291218", "0.62366885", "0.6131744", "0.60734284", "0.6058311", "0.6027393", "0.59784764", "0.5884509", "0.58802176", "0.58639985", "0.5845675", "0.58053315", "0.57949525", "0.57939976", "0.57769996", "0.5754858", "0.57259...
0.5329292
46
Build weight for the inheritance of nuclear background (a.k.a species). male | A B H + A | A H A/2,H/2 female B | H B B/2,H/2 H | A/2,H/2 B/2,H/2 A/4,B/4,H/2
def _build(self): ary = np.zeros( (3,3,3), float ) ary[0,0,0] = ary[1,1,1] = ary[0,1,2] = ary[1,0,2] = 1. ary[0,2,0] = ary[0,2,2] = ary[2,0,0] = ary[2,0,2] = 0.5 ary[1,2,1] = ary[1,2,2] = ary[2,1,1] = ary[2,1,2] = 0.5 ary[2,2,0] = ary[2,2,1] = 0.25 ary[2,2,2] = 0.5 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weight(self):", "def _init_inherit_physical_attributes(self):\n config = self.person.cosmos.config\n mother, father = self.person.biological_mother, self.person.biological_father\n parents = (mother.body, father.body)\n # Handedness\n if random.random() < config.heritabilit...
[ "0.5955473", "0.5910066", "0.57713836", "0.57571644", "0.55510604", "0.5496855", "0.54449487", "0.5443018", "0.54126084", "0.5388004", "0.53517497", "0.532497", "0.53154194", "0.53051525", "0.5290943", "0.52838373", "0.52517015", "0.52406114", "0.5222552", "0.52106667", "0.52...
0.0
-1
return list images of ebook perpage
def get_files(self): return self.ebook_file.get_files()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_images(self, page_number):", "def _getAllPageImages(context, size=(320, 452)):\n pdf = context.get_review_pdf()\n # import pdb; pdb.set_trace()\n if pdf:\n pdf_data = pdf[\"blob\"].open().read()\n if not pdf or not pdf_data:\n return \"%s has no pdf\" % (context.absolute_url(...
[ "0.76301074", "0.61921346", "0.61705476", "0.61475706", "0.60838944", "0.60602915", "0.60530084", "0.6047631", "0.6000588", "0.5965341", "0.59554744", "0.5820679", "0.5802052", "0.5781331", "0.5779564", "0.5755933", "0.5743276", "0.57430536", "0.57286274", "0.5711702", "0.566...
0.0
-1
White balance for every channel independently
def white_balance(image, perc): new_channel = [] for channel in cv2.split(image): mi, ma = (np.percentile(channel, perc), np.percentile(channel, 100.0 - perc)) channel = np.uint8(np.clip((channel - mi) * 255.0 / (ma - mi), 0, 255)) new_channel.append(channel) imWB = np.dstack(ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calibrate_white_balance(self, channel: LC):\n\n d_print(\"Warming up camera sensor...\", 1)\n\n # turn on channel light\n self.light_control(channel, 1)\n\n if channel == LC.WHITE:\n with picamera.PiCamera() as sensor:\n # set up the sensor with all its set...
[ "0.61220783", "0.5972675", "0.5931839", "0.56922317", "0.5463826", "0.54332715", "0.5367581", "0.528816", "0.5269515", "0.523269", "0.5217211", "0.520652", "0.5205482", "0.52013135", "0.5168077", "0.5151404", "0.5151039", "0.51505965", "0.51420283", "0.51318866", "0.5123756",...
0.66862494
0
Open an audio file. write_type is "wav" or "mp3", if writing. Automatically determines the file format if reading.
def open(cls, filename, write_type = None): from wavfile import WavFile from mp3file import MP3File if (write_type == None): file_object = open(filename, "rb") try: layer = MP3(filename).info.layer except: layer = -1 if (layer == 3): return MP3File(filena...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_wave_file(self):\n is_wave_open = False\n try:\n wv = wave.open(self.audio_file_name, mode='wb')\n is_wave_open = True\n wv.setparams((1, # 1 channel (mono)\n 2, # 2 bytes per sample * 1 channel\n self.sa...
[ "0.600975", "0.59122187", "0.5795555", "0.5784565", "0.57556313", "0.5655955", "0.5629821", "0.562926", "0.5615369", "0.553294", "0.5507199", "0.54114854", "0.536809", "0.53627324", "0.53616863", "0.53572196", "0.53521544", "0.53502065", "0.5343416", "0.53366435", "0.53349227...
0.80431217
0
Read the file by sector, as determined by sector_size (in frames). A sector is an array of channels, each of which is an array of magnitudes. Returns a tuple containing a generator for the sectors and the number of frames not covered by the generator.
def read_sectors(self, sector_size): in_n_sectors, in_n_extra_frames = divmod(self.get_n_frames(), sector_size) return (self.__read_sectors_generator(sector_size, in_n_sectors), in_n_extra_frames)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sectors_for_bytes(self,count):\n return (count+self.sectorsize-1)//self.sectorsize", "def read_chunks(\n file_object: \"IO\", chunk_size: int = None\n) -> \"Generator[Union[str, bytes], None, None]\":\n chunk_size = chunk_size if chunk_size and isinstance(chunk_size, int) else 2**24\n while T...
[ "0.5300185", "0.52004045", "0.5030646", "0.50120246", "0.500339", "0.49684152", "0.4958921", "0.49562106", "0.492392", "0.48962128", "0.4890391", "0.4856208", "0.48293597", "0.4815566", "0.47790107", "0.4773855", "0.47645763", "0.47498384", "0.47443956", "0.47405732", "0.4736...
0.798024
0
Generates DiffieHellman global parameters p and q.
def generate_dh_params(bits): # Domain parameters # Choose a prime q so that p=2q+1 is also prime acc1 = mr.estimate_accuracy(bits-1) acc2 = mr.estimate_accuracy(bits) # TODO: THis is not correct, must use discrete logarithm approach to # actually find it. See example_dh_params.py generato...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __setup_parameters__(self):\r\n self.M=self.N+1\r\n self.u=1+self.pu\r\n self.d=1-self.pd\r\n self.qu=(math.exp((self.r-self.div)*self.dt)-self.d)/(self.u-self.d)\r\n self.qd=1-self.qu", "def def_paramt():\n Zeff = 1.0\n amu = 2.0\n mf = mp*amu\n ret...
[ "0.6224027", "0.6129461", "0.61040443", "0.60493153", "0.5921859", "0.5847553", "0.58098495", "0.5763295", "0.5746084", "0.5744892", "0.57363373", "0.56992453", "0.5693567", "0.562936", "0.55725604", "0.5562822", "0.5549936", "0.55414885", "0.5523866", "0.5520235", "0.5515761...
0.5730508
11
Returns the number of bits requires to represent n.
def numbits(n): return int(math.ceil(math.log(n, 2)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_bits_for_int(n: int):\n n = abs(int(n))\n bits = 0\n while n > 0:\n n >>= 1\n bits += 1\n return bits", "def count_bits(n):\n return sum(1 for x in bin(n) if x == \"1\")", "def bits(n):\n\n # Create a list of the first 1,000 binary numbers\n binary_list = reverse_bina...
[ "0.81563795", "0.8084728", "0.7868972", "0.7752117", "0.75737745", "0.7487806", "0.74711466", "0.73270065", "0.72633255", "0.7196523", "0.7144834", "0.71082604", "0.7071569", "0.70644087", "0.7052807", "0.7040102", "0.7017897", "0.6989122", "0.68654424", "0.68466884", "0.6821...
0.79052716
2
A dictionary to map required slots to an extracted entity
def slot_mappings(self): # type: () -> Dict[Text: Union[Dict, List[Dict]]] return {"use_case": self.from_text(intent="inform")}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:\n\n return {\n \"product\": [\n self.from_entity(entity=\"product\", intent=[\"inform\"]),\n ],\n \"applicant_name\": [\n self.from_entity(entity=\"applicant_name\", intent=[\"infor...
[ "0.6995648", "0.6862953", "0.6558813", "0.64900076", "0.6489124", "0.64611995", "0.64086974", "0.63684666", "0.63684666", "0.6338538", "0.62612367", "0.6197755", "0.6197755", "0.5999761", "0.59434724", "0.59309", "0.588155", "0.58714616", "0.5779117", "0.5742074", "0.5714348"...
0.62104833
11
This function check weather a year is leap year or not.
def is_leap_year(year_): if year_ % 4 == 0: if year_ % 100 == 0: if year_ % 400 == 0: return True else: return False else: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_leap_year():", "def leapyear(year):\n\n # Return the answer\n return bool(calendar.isleap(year))", "def leapyear(year):\n\n\n if not year % 4 == 0:\n return False\n elif not year % 100 == 0:\n return False\n elif not year % 400 == 0:\n return F...
[ "0.9214601", "0.8924297", "0.8878337", "0.8866551", "0.8856028", "0.8848545", "0.88234866", "0.88232195", "0.88118976", "0.88081586", "0.8797112", "0.87938344", "0.8793488", "0.8789037", "0.878295", "0.87800264", "0.8750441", "0.87445366", "0.87398547", "0.8735187", "0.873105...
0.8835978
6
Make RPC call to 'Envoy Controller' to add target URLs to envoy datapath.
def activate_he_urls_for_ue( ip: IPAddress, rule_id: str, urls: List[str], imsi: str, msisdn: str, ) -> bool: try: chan = ServiceRegistry.get_rpc_channel( SERVICE_NAME, ServiceRegistry.LOCAL, ) except grpc.RpcError: logging.error('Cant get RPC channel to %...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_url(path, controller_ip=DNAC):\n print(\"3\")\n return \"https://%s:%s/api/v1/%s\" % (controller_ip, DNAC_PORT, path)", "def register():\n\n print(\"Request: \", request)\n print(\"foo: \", request.app.ep_mapping)\n print(json.load(request.body))\n endpoint_details = json.load(reques...
[ "0.49094117", "0.48981446", "0.4891663", "0.4882995", "0.48656306", "0.48633826", "0.4838656", "0.48215118", "0.48095515", "0.4799887", "0.47985315", "0.47854328", "0.47777006", "0.47676295", "0.47660863", "0.47645792", "0.47565734", "0.47402588", "0.4731982", "0.47042406", "...
0.0
-1
Make RPC call to 'Envoy Controller' to remove the proxy rule for the UE.
def deactivate_he_urls_for_ue(ip: IPAddress, rule_id: str) -> bool: try: chan = ServiceRegistry.get_rpc_channel( SERVICE_NAME, ServiceRegistry.LOCAL, ) except grpc.RpcError: logging.error('Cant get RPC channel to %s', SERVICE_NAME) return False client...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_proxy(proxy):\n r = requests.get(\"http://127.0.0.1:5010/delete/?proxy={}\".format(proxy))", "def client(api_client, proxy):\n\n proxy.deploy()\n\n assert api_client().get(\"/echo/anything\").status_code == 200\n\n proxy.mapping_rules.delete(proxy.mapping_rules.list()[0][\"id\"])\n prox...
[ "0.5732244", "0.57202536", "0.5547828", "0.5529435", "0.5497504", "0.54183865", "0.53863347", "0.5307268", "0.5297264", "0.52534926", "0.5240638", "0.5222272", "0.52119", "0.52097315", "0.5205946", "0.5182716", "0.5167885", "0.5167784", "0.5166036", "0.51652503", "0.516177", ...
0.48373026
63
Update the data structures to recognize a new process was created
def alloc_proc(self, process, delta_t): self._process_list.append(process)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_process(self):\r\n\r\n proc_dict = dict()\r\n total_count = len(self.newest_connections['pid'].unique())\r\n count = 0\r\n for proc in self.newest_connections['pid'].unique():\r\n count += 1\r\n percent = round((count / total_count * 100))\r\n pr...
[ "0.66696364", "0.6552674", "0.6385766", "0.6369811", "0.6323591", "0.6322", "0.6125703", "0.61249787", "0.6073016", "0.60558206", "0.6030704", "0.59983146", "0.59608686", "0.59429777", "0.58886784", "0.58749086", "0.58633256", "0.5861184", "0.58448863", "0.58353436", "0.58220...
0.61501944
6
Return the next process to run in the cpu. out_process_pid the pid of the process that just left the cpu, or None in case there was no process running. The engine is responsible for updating the usage time.
def schedule(self, pid, delta_t): size = len(self._process_list) if size == 0: return None process = self._process_list[self._last_index % size] self._last_index += 1 return process
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process(self) -> Union['psutil.Process', None]:\n psutil = attempt_import('psutil')\n pid = self.pid\n if pid is None:\n return None\n if not '_process' in self.__dict__ or self._process.pid != int(pid):\n try:\n self._process = psutil.Process(in...
[ "0.59412354", "0.565315", "0.5516685", "0.54894006", "0.5331213", "0.51628983", "0.5010885", "0.5000854", "0.4969542", "0.49433258", "0.49325776", "0.49271032", "0.49117905", "0.49015146", "0.48910594", "0.48898846", "0.48877802", "0.48800886", "0.4823743", "0.4817428", "0.48...
0.49695387
9
Return the next process to run in the cpu. out_process_pid the pid of the process that just left the cpu, or None in case there was no process running. The engine is responsible for updating the usage time.
def schedule(self, pid, delta_t): if len(self._process_list) == 0: return None if self._last_index >= len(self._process_list): self._last_index = 0 while True: priority = sort_priority() # print "SCHEDULING PRIORITY ", priority, "\n" actual_index = self._last_index + 1 while True: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process(self) -> Union['psutil.Process', None]:\n psutil = attempt_import('psutil')\n pid = self.pid\n if pid is None:\n return None\n if not '_process' in self.__dict__ or self._process.pid != int(pid):\n try:\n self._process = psutil.Process(in...
[ "0.5940735", "0.56525385", "0.55158997", "0.5488523", "0.5330522", "0.5164322", "0.5010265", "0.50001043", "0.4968517", "0.49675882", "0.49425843", "0.49308014", "0.49262333", "0.4910881", "0.4902073", "0.4888884", "0.48885095", "0.4887398", "0.4878581", "0.4822437", "0.48161...
0.46316713
36
Return the next process to run in the cpu. out_process_pid the pid of the process that just left the cpu, or None in case there was no process running. The engine is responsible for updating the usage time.
def schedule(self, pid, delta_t): if len(self._process_list) == 0: return None if self._last_index >= len(self._process_list): self._last_index = 0 while True: priority = sort_priority() # print "SCHEDULING PRIORITY ", priority, "\n" actual_index = self._last_index + 1 while True: # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process(self) -> Union['psutil.Process', None]:\n psutil = attempt_import('psutil')\n pid = self.pid\n if pid is None:\n return None\n if not '_process' in self.__dict__ or self._process.pid != int(pid):\n try:\n self._process = psutil.Process(in...
[ "0.5942478", "0.56531554", "0.55160487", "0.5489709", "0.5332322", "0.51632214", "0.5010553", "0.49991703", "0.4969401", "0.4968952", "0.49439943", "0.49326235", "0.49264264", "0.4911699", "0.49015945", "0.48903045", "0.4889358", "0.48885792", "0.48797858", "0.4823984", "0.48...
0.470696
28
Makes TexMobject resiliant to unmatched { at start
def remove_stray_braces(self, tex): num_lefts, num_rights = [ tex.count(char) for char in "{}" ] if num_rights > num_lefts: backwards = tex[::-1].replace("}", "", num_rights - num_lefts) tex = backwards[::-1] elif num_lefts > num_rights: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generateCurrentLineText(self, obj, **args ):\n result = self._generateSubstring(obj, **args)\n if result:\n return result\n\n [text, caretOffset, startOffset] = self._script.getTextLineAtCaret(obj)\n if text and not self._script.EMBEDDED_OBJECT_CHARACTER in text:\n ...
[ "0.5573216", "0.55616885", "0.5541053", "0.53553516", "0.52875495", "0.525706", "0.52527744", "0.52410287", "0.52339643", "0.52307165", "0.5166109", "0.5111728", "0.5094848", "0.5094848", "0.5079243", "0.50386226", "0.5038601", "0.50207543", "0.5015247", "0.5014118", "0.50029...
0.48657212
42
Reorganize existing submojects one layer deeper based on the structure of tex_strings (as a list of tex_strings)
def break_up_by_substrings(self): new_submobjects = [] curr_index = 0 for tex_string in self.tex_strings: sub_tex_mob = SingleStringTexMobject(tex_string, **self.CONFIG) num_submobs = len(sub_tex_mob.submobjects) new_index = curr_index + num_submobs ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detex(tex):\n \n #tex = '\\n'.join(reformat(tex, listed=True)[1:])\n global subs\n \n for old, new in subs.iteritems():\n tex = tex.replace(old, new)\n \n return tex.strip()", "def realize_text_and_extract_scene(scene, template, filter_objs):\n\n default_list = lambda: collection...
[ "0.5540645", "0.5538486", "0.55300415", "0.55045766", "0.54806244", "0.545654", "0.543825", "0.5400212", "0.53588676", "0.53223515", "0.53047854", "0.5286626", "0.52593404", "0.5253145", "0.52510726", "0.5232758", "0.5221223", "0.521921", "0.521023", "0.52065337", "0.5153433"...
0.6977978
0
Converts a dvi, which potentially has multiple slides, into a directory full of enumerated pngs corresponding with these slides. Returns a list of PIL Image objects for these images sorted as they where in the dvi
def dvi_to_svg(dvi_file, regen_if_exists=False): result = dvi_file.replace(".dvi", ".svg") if not os.path.exists(result): commands = [ "dvisvgm", dvi_file, "-n", "-v", "0", "-o", result, ">", get_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_all_dicom_images(self, verbose=True):\n if verbose: print(\"Loading dicom files ... This may take a moment.\")\n\n path = self.get_path_to_dicom_files()\n fnames = [fname for fname in os.listdir(path)\n if fname.endswith('.dcm') and not fname.startswith(\".\...
[ "0.61587155", "0.5961282", "0.58819103", "0.58328515", "0.5788983", "0.5764814", "0.57471657", "0.573866", "0.5700897", "0.56667006", "0.5630598", "0.5601801", "0.5583045", "0.5580133", "0.55675536", "0.5564644", "0.5564586", "0.55578834", "0.5556173", "0.554764", "0.5540422"...
0.0
-1