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
Test removing one of multiple endpoints
def test_basic_remove_one_of_multiple_endpoint(self): args = self.get_args() config = self.create_config_file() self.write_config_file(config, args) execute_tool(args, test_mode=True) time.sleep(2) mac1 = '00:11:22:33:33:34' ip1 = '3.4.3.5' self.add_endpo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_basic_remove_one_of_multiple_endpoint(self):\n args = self.get_args()\n config = self.create_config_file()\n self.write_config_file(config, args)\n execute_tool(args, test_mode=True)\n\n time.sleep(2)\n mac1 = '00:11:22:33:33:34'\n ip1 = '3.4.3.5'\n ...
[ "0.8008313", "0.7877344", "0.7866369", "0.7417763", "0.730739", "0.7234741", "0.72284913", "0.71855706", "0.6890472", "0.68083024", "0.6577715", "0.64682835", "0.6407782", "0.6402834", "0.63137627", "0.6293576", "0.6293576", "0.6227747", "0.6216114", "0.62126344", "0.61935914...
0.78905994
1
Test add multiple endpoints
def test_basic_add_multiple_endpoint(self): mac1, ip1 = self.setup_with_endpoint() mac2 = '00:11:22:33:33:35' ip2 = '3.4.3.6' self.add_endpoint(mac2, ip2, 'intersite-testsuite', 'app', 'epg2') time.sleep(2) self.assertTrue(self.verify_remote_site_has_entry(mac1, ip1, 'in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_basic_add_multiple_endpoint(self):\n args = self.get_args()\n config = self.create_config_file()\n self.write_config_file(config, args)\n execute_tool(args, test_mode=True)\n\n time.sleep(2)\n mac1 = '00:11:22:33:33:34'\n ip1 = '3.4.3.5'\n self.add_e...
[ "0.819418", "0.8146113", "0.807607", "0.7937303", "0.78289056", "0.7344617", "0.7283134", "0.72078437", "0.7148046", "0.7098725", "0.6964544", "0.6963538", "0.68785214", "0.68761677", "0.6833355", "0.6820693", "0.674913", "0.6745721", "0.6718291", "0.6661452", "0.6605117", ...
0.8146241
1
Test removing the endpoint
def test_basic_remove_endpoint(self): mac, ip = self.setup_with_endpoint() time.sleep(2) self.assertTrue(self.verify_remote_site_has_entry(mac, ip, 'intersite-testsuite', 'l3out', 'intersite-testsuite-app-epg1')) self.remove_endp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_basic_remove_endpoint(self):\n args = self.get_args()\n config = self.create_config_file()\n self.write_config_file(config, args)\n execute_tool(args, test_mode=True)\n\n time.sleep(2)\n mac = '00:11:22:33:33:33'\n ip = '3.4.3.4'\n\n self.assertTrue(...
[ "0.79038227", "0.7891487", "0.7878498", "0.7437446", "0.74312633", "0.7418228", "0.7399744", "0.73862046", "0.7338916", "0.72730166", "0.7243828", "0.7072568", "0.7040959", "0.6891243", "0.6849741", "0.68348867", "0.66787845", "0.66787845", "0.6665692", "0.66164476", "0.65543...
0.82686055
0
Create the export policy
def create_export_policy(l3out_name): export_policy = { "export": { "tenant": "intersite-testsuite", "app": "app", "epg": "epg", "remote_epg": "intersite-testsuite-app-epg", "remote_sites": [ { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_export_policy():\n config = {\n \"export\": {\n \"tenant\": \"intersite-testsuite\",\n \"app\": \"app\",\n \"epg\": \"epg\",\n \"remote_epg\": \"intersite-testsuite-app-epg\",\n \"remote_sites\": [\n ...
[ "0.7640657", "0.6972289", "0.67560166", "0.6715468", "0.666488", "0.66225404", "0.6512321", "0.59530276", "0.59368205", "0.58883494", "0.5840365", "0.5751171", "0.57272696", "0.5679028", "0.56665695", "0.56465685", "0.56410825", "0.56036294", "0.56035244", "0.5578853", "0.548...
0.7591464
1
Test adding endpoint with multiple OutsideL3 interfaces
def test_basic_add_endpoint_multiple_l3out(self): args = self.get_args() config = self.create_config_file('l3out1') for policy in config['config']: if 'export' in policy: for site_policy in policy['export']['remote_sites']: interface_policy = {"l3o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_basic_add_multiple_endpoint(self):\n args = self.get_args()\n config = self.create_config_file('l3out1')\n self.write_config_file(config, args)\n collector = execute_tool(args, test_mode=True)\n\n time.sleep(2)\n mac1 = '00:11:22:33:33:34'\n ip1 = '3.4.3.5'...
[ "0.752601", "0.74311906", "0.7405142", "0.7386233", "0.7247234", "0.7153217", "0.68397325", "0.66645247", "0.65729594", "0.6566412", "0.65465134", "0.65389645", "0.6447476", "0.6221744", "0.60095763", "0.5988503", "0.5970938", "0.5970165", "0.596281", "0.5948011", "0.59288543...
0.7518203
1
Add a remote entry
def add_remote_duplicate_entry(self, ip): site2 = Session(SITE2_URL, SITE2_LOGIN, SITE2_PASSWORD) resp = site2.login() self.assertTrue(resp.ok) tenant = Tenant('intersite-testsuite-remote') l3out = OutsideL3('l3out', tenant) other_epg = OutsideEPG('other', l3out) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def RemoteAddOrUpdateEntry(self, destAddress, key, value):\r\n if(destAddress == self.selfNodeAddress):\r\n self.LocalAddOrUpdateEntry(key, value)\r\n argDict = {}\r\n argDict[RPC_ARG_REQUEST_TYPE] = LOCAL_ADD_OR_UPDATE_ENTRY_REQUEST\r\n argDict[RPC_ARG_KEY] = key\r\n ...
[ "0.72839314", "0.6974402", "0.65335816", "0.6423625", "0.62849396", "0.62447464", "0.6187626", "0.5985342", "0.5978812", "0.5932168", "0.5919282", "0.58885175", "0.586969", "0.5860761", "0.58531964", "0.584771", "0.5823928", "0.58130145", "0.58059114", "0.58025616", "0.578891...
0.6998807
1
Test a basic duplicate entry scenario. An existing entry exists on the remote site but on a different OutsideEPG on the same OutsideL3.
def test_basic_duplicate(self): args = self.get_args() config = self.create_config_file() self.write_config_file(config, args) execute_tool(args, test_mode=True) mac = '00:11:22:33:33:33' ip = '3.4.3.4' self.assertFalse(self.verify_remote_site_has_entry(mac, ip, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_basic_duplicate(self):\n args = self.get_args()\n config = self.create_config_file()\n self.write_config_file(config, args)\n execute_tool(args, test_mode=True)\n\n mac = '00:11:22:33:33:33'\n ip = '3.4.3.4'\n self.assertFalse(self.verify_remote_site_has_en...
[ "0.7515397", "0.7463155", "0.73845965", "0.731102", "0.6890059", "0.68339676", "0.66176593", "0.6586417", "0.6583353", "0.65135413", "0.64887846", "0.64866686", "0.6478017", "0.64299655", "0.6370263", "0.629545", "0.6286984", "0.62659526", "0.62468266", "0.6233878", "0.622297...
0.76767504
0
Test a basic multiple duplicate entry scenario.
def test_basic_multiple_duplicate(self): args = self.get_args() config = self.create_config_file() self.write_config_file(config, args) execute_tool(args, test_mode=True) for i in range(0, 5): mac = '00:11:22:33:33:3' + str(i) ip = '3.4.3.' + str(i) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_duplicate_entries(self):", "def test_basic_multiple_duplicate(self):\n args = self.get_args()\n config = self.create_config_file()\n self.write_config_file(config, args)\n execute_tool(args, test_mode=True)\n\n for i in range(0, 5):\n mac = '00:11:22:33:33:3...
[ "0.83558935", "0.73466593", "0.7206347", "0.7151951", "0.70196646", "0.70045143", "0.6955986", "0.6820774", "0.67148554", "0.665979", "0.664946", "0.66298586", "0.6610924", "0.6604714", "0.6572532", "0.6559806", "0.65595186", "0.6538617", "0.6528165", "0.6522492", "0.6511365"...
0.74561197
1
Test a basic duplicate entry scenario. An existing entry exists on the remote site but on a different OutsideEPG on the same OutsideL3.
def test_basic_duplicate(self): args = self.get_args() config = self.create_config_file() self.write_config_file(config, args) execute_tool(args, test_mode=True) mac = '00:11:22:33:33:33' ip = '3.4.3.4' self.assertFalse(self.verify_remote_site_has_entry(mac, ip, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_basic_duplicate(self):\n args = self.get_args()\n config = self.create_config_file()\n self.write_config_file(config, args)\n execute_tool(args, test_mode=True)\n\n mac = '00:11:22:33:33:33'\n ip = '3.4.3.4'\n self.assertFalse(self.verify_remote_site_has_en...
[ "0.76752955", "0.7463295", "0.73835135", "0.73099995", "0.68893784", "0.68333185", "0.6618113", "0.65855473", "0.65838003", "0.65136343", "0.6488949", "0.6487147", "0.6476275", "0.6428686", "0.6368202", "0.6293363", "0.6284434", "0.62659323", "0.62462276", "0.6233306", "0.622...
0.75141424
1
Test basic deletion of a stale entry on tool startup
def test_basic_deletion(self): args = self.get_args() config_filename = 'testsuite_cfg.json' args.config = config_filename config = self.create_config_file() config_file = open(config_filename, 'w') config_file.write(str(json.dumps(config))) config_file.close() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_unload_entry(hass: HomeAssistant) -> None:\n entry = MockConfigEntry(\n domain=DOMAIN,\n unique_id=\"0123456789\",\n data=DEFAULT_CONFIG,\n options=DEFAULT_OPTIONS,\n )\n entry.add_to_hass(hass)\n\n await hass.config_entries.async_setup(entry.entry_id)\n aw...
[ "0.68060774", "0.67843074", "0.67190665", "0.66240215", "0.65407753", "0.65362644", "0.64298743", "0.6424744", "0.6365532", "0.63239765", "0.62894094", "0.6277588", "0.62544465", "0.6218567", "0.61768913", "0.6132425", "0.6126508", "0.6117997", "0.6111096", "0.60746247", "0.6...
0.7147791
0
Generates start and end points for a transect
def get_start_end_points(path, transect): transect_array = np.genfromtxt(path + 'tran_sim_pts.csv', delimiter=",") start_point = transect_array[2 * transect, :] end_point = transect_array[2 * transect + 1, :] # force start points to be west of end points if start_point[0] > end_point[0]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mainTransect():\n\n\n # Start = (3260, 2672 ) new transect data start/end points\n #\n # End = (2731, 12280)\n #\n imageName = 'TransectStitch2.jpg'\n End = (594, 1046)\n Start = (1718, 460)\n \n Start = (3581, 1582)\n End = (3227, 7596)\n#\n# Start = (1035,588)\n# End = (456,17...
[ "0.6708153", "0.5982423", "0.5940937", "0.5771183", "0.574051", "0.5378845", "0.529832", "0.52517027", "0.5250177", "0.5225547", "0.5137306", "0.51122737", "0.5095168", "0.50951284", "0.50672185", "0.50348926", "0.50121546", "0.5003633", "0.4998103", "0.4997584", "0.497686", ...
0.69886744
0
Hack for overwriting the TLD on all user and expr records to server_name THIS WILL BREAK things when we support multiple domains
def update_domain(): for e in Expr.search() + User.search(): e.set_tld(config.server_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_domain(user):\n if \"@\" not in user:\n user = user + \"@linaro.org\"\n return user", "def server_domain(self):\n url = self.api.address\n domain_start = url.find('://') + 3 if url.find('://') >= 0 else 0\n domain_end = url.find(':', domain_start) if url.find(':', domain...
[ "0.63014543", "0.5997695", "0.59514576", "0.5840985", "0.58376896", "0.56607497", "0.56390893", "0.56125504", "0.55637777", "0.55522305", "0.55105335", "0.549391", "0.54873264", "0.54577917", "0.5415016", "0.540286", "0.539424", "0.538367", "0.53730166", "0.53694344", "0.5364...
0.78853387
0
Test adding refpix around an array
def test_add_refpix(): data = np.ones((10, 10)) refpix = (2, 3, 4, 5) new_array = bpd.add_refpix(data, refpix) yd, xd = new_array.shape print, xd, yd assert yd == 19 assert xd == 15 assert np.all(new_array[0:5, 5] == np.array([0, 0, 0, 0, 1])) assert np.all(new_array[13:, 5] == np....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_refpix(data, counts=0):\n # Get dimensions\n dims = data.shape\n new_data = copy(data)\n\n # Convert to 3D\n if data.ndim == 4:\n new_data.shape = dims[0] * dims[1], dims[2], dims[3]\n elif data.ndim == 2:\n new_data.shape = (1, dims[0], dims[1])\n\n # Left, right (all su...
[ "0.63573045", "0.62996286", "0.5910863", "0.5778651", "0.5759954", "0.56817675", "0.56443983", "0.5589028", "0.55103415", "0.5508506", "0.54951394", "0.5480704", "0.5432781", "0.5422046", "0.5402449", "0.5336373", "0.5330425", "0.53269136", "0.5322928", "0.53175277", "0.53020...
0.81802064
0
Test the translation of a bad pixel list into flags
def test_apply_flags(): true_value = dqflags.pixel['HOT'] + dqflags.pixel['DO_NOT_USE'] print(true_value) badmap = np.zeros((10, 10), dtype=np.int) true_map = np.zeros((10, 10), dtype=np.uint32) for i in range(10): badmap[i, i] = 1 true_map[i, i] = true_value print(true_map)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bad_pixel_mask(self):\n from mkidpipeline.pipeline import PROBLEM_FLAGS # This must be here to prevent a circular import!\n return self.flagged(PROBLEM_FLAGS)", "def test_change_color_of_the_device__false():", "def valid_pixel_coordinates(u, v, IMAGE_HEIGHT, IMAGE_WIDTH):\n return (u >= 0...
[ "0.65559226", "0.5735253", "0.5721095", "0.56911737", "0.56661826", "0.56363875", "0.5626868", "0.5582854", "0.5493712", "0.5492685", "0.5464843", "0.54537475", "0.54053575", "0.53936505", "0.53879094", "0.5384739", "0.5378772", "0.5371758", "0.5329915", "0.53188866", "0.5315...
0.7003664
0
Test the combination of bad pixel maps. Simply bitwise_or combination of input maps
def test_combine_bad_pixel_types(): satval = dqflags.pixel['SATURATED'] sat_map = np.zeros((5, 5), dtype=np.uint32) sat_map[0, 0] = satval rcval = dqflags.pixel['RC'] rc_map = np.zeros((5, 5), dtype=np.uint32) rc_map[0, 0] = rcval rc_map[1, 1] = rcval lowqeval = dqflags.pixel['LOW_QE']...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_apply_flags():\n true_value = dqflags.pixel['HOT'] + dqflags.pixel['DO_NOT_USE']\n\n print(true_value)\n\n badmap = np.zeros((10, 10), dtype=np.int)\n true_map = np.zeros((10, 10), dtype=np.uint32)\n for i in range(10):\n badmap[i, i] = 1\n true_map[i, i] = true_value\n\n\n ...
[ "0.6731447", "0.6551233", "0.62930256", "0.6177818", "0.60849243", "0.601193", "0.5987133", "0.59620667", "0.5799583", "0.5773531", "0.57644165", "0.57350224", "0.5670399", "0.56483763", "0.56310725", "0.5598182", "0.5591325", "0.5589217", "0.55426866", "0.55351067", "0.55225...
0.7225349
0
Prompts user to select output file
def select_output(self): filename, _filter = QFileDialog.getSaveFileName( self, filter="OpenSCENARIO (*.xosc)") # Update text field only if user press 'OK' if filename: if filename[-4:] != "xosc": filename += ".xosc" self.select_pat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_output_file(self):\n output_file = QFileDialog.getSaveFileName(self.dlg, \"Select output file \", \"\", '*.csv')\n self.dlg.leOutCsv.setText(output_file)", "def askOutputFile():\n while True:\n print(\"Save the final file\")\n # Try until the final file is saved.\n ...
[ "0.7068207", "0.7058703", "0.70160836", "0.6744526", "0.6700359", "0.6696756", "0.6608492", "0.65348375", "0.6495182", "0.648009", "0.64119184", "0.6399241", "0.63890177", "0.63827217", "0.63827217", "0.63827217", "0.63827217", "0.6332324", "0.630193", "0.62996227", "0.628017...
0.7326104
0
Enables/Disables text field for user defined maps
def user_defined_map(self): if self.map_selection.currentText() == "User Defined": self.map_selection_user_defined.setEnabled(True) else: self.map_selection_user_defined.setDisabled(True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __enableControls(self):\n for key in self._keyMap.keys():\n self.__acceptKeyDown(key)\n self.__acceptKeyUp(key)", "def dummy():\n\t\t\tself.edit = True", "def is_map_editable(self):\n return self.is_editable", "def _enable_entry(self):\n self.insert_entry.config...
[ "0.5818489", "0.5786922", "0.56904685", "0.56761014", "0.5612584", "0.5549688", "0.55070794", "0.54855746", "0.53914595", "0.53908044", "0.5368546", "0.5335708", "0.53322655", "0.532611", "0.5302547", "0.5290096", "0.52684754", "0.5251911", "0.52484715", "0.5241275", "0.52394...
0.6971268
0
Auto populates road network if available
def load_road_network(self): if QgsProject.instance().mapLayersByName("Metadata"): metadata_layer = QgsProject.instance().mapLayersByName("Metadata")[0] road_network = "" for feature in metadata_layer.getFeatures(): road_network = feature["Road Network"] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_network(roads):\n #roads=(\n #(\"LB\", \"leuven\", \"brussel\", 27.0, 120),\n #(\"BL\", \"brussel\", \"leuven\", 30.0, 120),\n #(\"LA\", \"leuven\", \"antwerpen\", 61.0, 120),\n #(\"AL\", \"antwerpen\", \"leuven\", 63.0, 120),\n #(\"BO\", \"brussel\", \"oostende\", 110.0, 120)...
[ "0.6873924", "0.6355785", "0.6186261", "0.60576785", "0.5968253", "0.5953786", "0.58583206", "0.5848818", "0.5779726", "0.57745624", "0.5676741", "0.5633069", "0.5620373", "0.553958", "0.5530303", "0.5527387", "0.55251014", "0.5524265", "0.55203605", "0.54892105", "0.5466597"...
0.6903322
0
Checks value if it can be converted to float.
def is_float(self, value): try: float(value) return True except ValueError: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isFloat(value): \n try:\n float(value)\n return True\n except ValueError:\n return False", "def is_floatable(value):\n\n try:\n float(value)\n return True\n except:\n return False", "def isfloat(value):\r\n try:\r\n float(value)\r\n ...
[ "0.83472323", "0.82688713", "0.82183945", "0.820454", "0.8170699", "0.81345236", "0.81149787", "0.8113428", "0.8093648", "0.79338914", "0.77590185", "0.76844215", "0.7499681", "0.7369233", "0.7368318", "0.7339717", "0.72681695", "0.7242559", "0.71787393", "0.7138268", "0.7085...
0.8372439
0
Main function for generating OpenSCENARIO files.
def main(self): root = etree.Element("OpenSCENARIO") self.get_header(root) self.get_parameter_declarations(root) etree.SubElement(root, "CatalogLocations") self.get_road_network(root) self.get_entities(root) storyboard = etree.SubElement(root, "Storyboard") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n parser = argparse.ArgumentParser()\n parser.add_argument('-i', '--input-ontology',\n default=config_test.config[\"msh_test_onto\"])\n parser.add_argument('-s', '--signature')\n parser.add_argument('-f', '--format-name', default=None)\n parser.add_argument('-o', '...
[ "0.6324023", "0.62678474", "0.62176293", "0.6212757", "0.61373323", "0.611049", "0.6089846", "0.60481006", "0.60354424", "0.60211504", "0.6018257", "0.59591275", "0.5936373", "0.59305364", "0.5907448", "0.5903805", "0.5898929", "0.58893204", "0.5885739", "0.58747596", "0.5866...
0.784385
0
Gets entity list from layers and export into OpenSCENARIO file.
def get_entities(self, root): entity = etree.SubElement(root, "Entities") # Ego Vehicles if QgsProject.instance().mapLayersByName("Vehicles - Ego"): vehicle_ego_layer = QgsProject.instance().mapLayersByName("Vehicles - Ego")[0] for feature in vehicle_ego_layer.getFeatures...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addEntitiesToScenario(entityList,entities):\n for entity in entityList:\n entity_bounding_box = xosc.BoundingBox(2,5,1.6,2,0,0.9)\n if len(entity.has_bounding_box) != 0:\n entity_bounding_box = checkBoundingBox(entity.has_bounding_box[0])\n entity_name = getNameFromIRI(entity...
[ "0.5972137", "0.55147815", "0.5363058", "0.52819157", "0.5258222", "0.5221666", "0.5170315", "0.516444", "0.5162506", "0.5155408", "0.5138333", "0.5128941", "0.51273674", "0.5126611", "0.5081951", "0.50605065", "0.50603014", "0.50006664", "0.4986406", "0.4974175", "0.49715582...
0.5715273
1
Generate vehicle properties. Properties are ignored by CARLA simulator, hence generic numbers are used. (as of CARLA 0.9.10)
def get_generic_vehicle_properties(self, vehicle, is_ego=False): etree.SubElement(vehicle, "ParameterDeclarations") performance = etree.SubElement(vehicle, "Performance") performance.set("maxSpeed", "69.444") performance.set("maxAcceleration", "200") performance.set("maxDecelerat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model_with_properties():\n \n m = ConcreteModel()\n\n # ------------------------------------------------------------------\n # Data\n # ------------------------------------------------------------------\n\n m.np = 25 # Number of possible tays...
[ "0.64989644", "0.62557536", "0.59823334", "0.5972292", "0.591737", "0.5914009", "0.5770668", "0.574584", "0.5713929", "0.56845945", "0.5674325", "0.56410986", "0.5629532", "0.5618112", "0.55885524", "0.55365086", "0.5527548", "0.5527548", "0.5527548", "0.5514647", "0.55136675...
0.70288575
0
Writes OpenSCENARIO tags for entity teleport action
def entity_teleport_action(self, entity, orientation, pos_x, pos_y, pos_z): private_act = etree.SubElement(entity, "PrivateAction") teleport_action = etree.SubElement(private_act, "TeleportAction") teleport_pos = etree.SubElement(teleport_action, "Position") teleport_worldpos = etree.Sub...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(self):\n root = etree.Element(\"OpenSCENARIO\")\n self.get_header(root)\n self.get_parameter_declarations(root)\n etree.SubElement(root, \"CatalogLocations\")\n self.get_road_network(root)\n self.get_entities(root)\n storyboard = etree.SubElement(root, \"St...
[ "0.56694156", "0.51991284", "0.5077575", "0.5070032", "0.4774747", "0.4760719", "0.47036716", "0.4689822", "0.46897346", "0.46823934", "0.46659404", "0.4661086", "0.461355", "0.45751822", "0.45733896", "0.45665416", "0.45658082", "0.45336148", "0.45260248", "0.45180786", "0.4...
0.53729606
1
Writes ControllerAction OpenSCENARIO tags for vehicles
def vehicle_controller(self, entity, veh_id, agent, agent_camera, is_ego): if is_ego: controller_id = f"HeroAgent_{veh_id}" else: controller_id = f"VehicleAgent_{veh_id}" private_act = etree.SubElement(entity, "PrivateAction") controller_act = etree.SubElement(pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(self):\n root = etree.Element(\"OpenSCENARIO\")\n self.get_header(root)\n self.get_parameter_declarations(root)\n etree.SubElement(root, \"CatalogLocations\")\n self.get_road_network(root)\n self.get_entities(root)\n storyboard = etree.SubElement(root, \"St...
[ "0.5599495", "0.52245736", "0.4921878", "0.4897484", "0.4786558", "0.47608638", "0.47546574", "0.46173018", "0.45948136", "0.4574714", "0.45703846", "0.45488727", "0.4521188", "0.45129177", "0.44886887", "0.44817406", "0.44458812", "0.44056672", "0.4399677", "0.43948743", "0....
0.57097715
0
Gets maneuvers from QGIS layer. If no maneuvers are detected, create a minimal XML structure.
def get_maneuvers(self, act): if QgsProject.instance().mapLayersByName("Maneuvers"): layer = QgsProject.instance().mapLayersByName("Maneuvers")[0] if layer.featureCount() == 0: self.generate_minimal_maneuver(act) error_message = "No maneuvers set... Genera...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_layers(self, content_retriever):\n pass", "def get_layers(self, content_retriever):\n pass", "def get_lateral_maneuvers(self, maneuver_id, event):\n action = etree.SubElement(event, \"Action\")\n action_name = f\"Action for Manuever ID {maneuver_id}\"\n action.set(\"n...
[ "0.55319065", "0.55319065", "0.5455864", "0.5432696", "0.5095347", "0.5061958", "0.50468576", "0.50415236", "0.4938627", "0.48965883", "0.4878986", "0.48774123", "0.4862083", "0.47591782", "0.47430587", "0.4717034", "0.46975282", "0.4693766", "0.46762243", "0.46762243", "0.46...
0.68309426
0
Creates a minimal XML structure to meet OpenSCENARIO specifications when no maneuvers are set. Entity reference will take any one vehicle spawned (prioritizing ego). Creates a speed action at position +100 meters, to prevent scenario from exiting immediately after being run.
def generate_minimal_maneuver(self, act): entity = "" pos_x = 0 pos_y = 0 if QgsProject.instance().mapLayersByName("Vehicles - Ego"): layer = QgsProject.instance().mapLayersByName("Vehicles - Ego")[0] if layer.featureCount() != 0: for feature in la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(self):\n root = etree.Element(\"OpenSCENARIO\")\n self.get_header(root)\n self.get_parameter_declarations(root)\n etree.SubElement(root, \"CatalogLocations\")\n self.get_road_network(root)\n self.get_entities(root)\n storyboard = etree.SubElement(root, \"St...
[ "0.6111996", "0.5595419", "0.54671556", "0.5455094", "0.5293809", "0.5278717", "0.52555376", "0.52479005", "0.5233112", "0.5215577", "0.52016526", "0.5167296", "0.5149943", "0.5148378", "0.51224333", "0.5114571", "0.5103006", "0.50995696", "0.5060447", "0.5060395", "0.5043614...
0.62497556
0
Writes stop triggers for maneuvers if enabled.
def get_maneuver_stop_trigger(self, feature, event): stop_trigger = etree.SubElement(event, "StopTrigger") cond_group = etree.SubElement(stop_trigger, "ConditionGroup") cond = etree.SubElement(cond_group, "Condition") cond_name = f'Condition for Maneuver ID {str(feature["id"])}' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emitters_off(self):\n self.wp.digitalWrite(self.LEDON_PIN, self.wp.LOW)\n self.wp.delayMicroseconds(20)", "def trigger_stop(self):\n self.terminate = True\n self.stop_event.set()", "def send_stopping(self):\n self.stopped = True", "def trigger_stopping(self) -> None:\n ...
[ "0.552223", "0.5512789", "0.54915786", "0.5419523", "0.5384461", "0.533157", "0.5314299", "0.52759546", "0.5271822", "0.52332145", "0.51064694", "0.5072956", "0.5070521", "0.5058097", "0.5044566", "0.50130695", "0.49654517", "0.4949829", "0.4936153", "0.49351", "0.4913465", ...
0.5526739
0
Writes story start triggers.
def get_story_start_trigger(self, act): act_start = etree.SubElement(act, "StartTrigger") cond_group = etree.SubElement(act_start, "ConditionGroup") time_cond = etree.SubElement(cond_group, "Condition") time_cond.set("name", "StartTime") time_cond.set("delay", "0") time_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_triggers(self):\n triggers = self.get_source_triggers()\n if not triggers:\n self.create_insert_trigger()\n self.create_update_trigger()\n self.create_delete_trigger()\n self.commit()", "def generate_triggers(args):\n trigger_filename = args...
[ "0.62102854", "0.54065365", "0.53244364", "0.52856135", "0.51792234", "0.5041057", "0.50108904", "0.4893508", "0.48611125", "0.4836738", "0.4812092", "0.4793974", "0.47910708", "0.47105026", "0.46582097", "0.46540487", "0.46540487", "0.4640783", "0.46284238", "0.46256265", "0...
0.5879036
1
Writes story stop triggers.
def get_story_stop_trigger(self, act): stop = etree.SubElement(act, "StopTrigger") cond_group = etree.SubElement(stop, "ConditionGroup") cond = etree.SubElement(cond_group, "Condition") cond.set("name", "EndCondition") cond.set("delay", "0") cond.set("conditionEdge", "ris...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_triggers_to_file(triggerfile, functionfile,\n generators, entityname, table, path, select,\n indextable, index):\n for generator in generators:\n gen = generator(entityname, table, path, select, indextable, index)\n functionfile.write(g...
[ "0.51933837", "0.5167893", "0.5145675", "0.51413375", "0.5140378", "0.5136364", "0.5030493", "0.4966922", "0.49468398", "0.49232253", "0.4908608", "0.48887694", "0.48008174", "0.46933144", "0.4643256", "0.46097505", "0.45972237", "0.45960528", "0.45944497", "0.4577642", "0.45...
0.6462435
0
Save and export pretty printed XOSC file.
def write_xosc(self, generated_xml): reparsed_xml = minidom.parseString(generated_xml).toprettyxml(indent=" ") xosc_file = open(self._filepath, "w") xosc_file.write(reparsed_xml) xosc_file.close() msg = QMessageBox() if self._warning_message: msg.setIcon(Q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, x):\n self.print_handler_f(x, x.get_full_path())", "def saving_file(xml):\r\n\r\n xml_string = etree.tostring(xml)\r\n parsed = minidom.parseString(xml_string)\r\n with open(self.app_path + \"\\\\temp_\\\\\" + file_name + \".xml\", \"w\") as file:\r\n ...
[ "0.60712326", "0.6012107", "0.5958106", "0.5956413", "0.59376615", "0.5913409", "0.5911035", "0.5865678", "0.5859579", "0.583567", "0.57567245", "0.570169", "0.5654635", "0.55816865", "0.55700666", "0.5562388", "0.5543579", "0.552546", "0.5520077", "0.54999053", "0.54814917",...
0.6430248
0
Retrieve news articles containing keywords.
def get_news(keywords, news='all'): if news is 'all': return news_client.get_everything(q=keywords) elif news is 'top': return news_client.get_top_headlines(q=keywords) else: raise AttributeError("Optional argument news expected 'top' or 'all'")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def searchnews(self,\n keywords=None,\n dateStart=None,\n dateEnd=None,\n sortBy=None,\n domains=None,\n page=20,\n sources='abc-news',\n language=None,\n ...
[ "0.6998365", "0.6901926", "0.67391527", "0.6665369", "0.6616665", "0.6603087", "0.6414304", "0.63376963", "0.63274", "0.6312733", "0.6226078", "0.6199704", "0.61841", "0.6171829", "0.61681545", "0.61209166", "0.61102", "0.60889107", "0.6035191", "0.60283375", "0.59730995", ...
0.74381673
0
Displays text, search volume, average cpc and categories for idea.
def DisplayIdea(keyword): logger.info('Found Keyword with text [%s]' % keyword['KEYWORD_TEXT']) logger.info(' Keyword Idea search volume: %s' % keyword['SEARCH_VOLUME']) logger.info(' Keyword Idea average CPC: %s' % keyword['AVERAGE_CPC']) logger.info(' Keyword Idea categories: %s' % keyword['CATEGORY_PRODUC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n\n\tst.title(\"Sentiment Analysis Emoji App\")\n\n\tactivities = [\"Sentiment\",\"Text Analysis on URL\",\"About\"]\n\tchoice = st.sidebar.selectbox(\"Choice\",activities)\n\n\tif choice == 'Sentiment':\n\t\tst.subheader(\"Sentiment Analysis\")\n\t\tst.write(emoji.emojize('Everyone :red_heart: Streaml...
[ "0.5711111", "0.57098675", "0.5692497", "0.5670952", "0.54832184", "0.5454355", "0.5440865", "0.5438485", "0.54274315", "0.53912324", "0.5380923", "0.5357815", "0.5345672", "0.5340286", "0.5316308", "0.53136766", "0.53029424", "0.53008884", "0.52863365", "0.5284479", "0.52747...
0.6496614
0
parse datetime range str to pair of datetime objects.
def parse_datetime_range(date_time_range, exception_class=Exception): try: start, end = date_time_range.split(',') except Exception as error: logging.exception(error) raise exception_class( 'there is no `,` in date time range %s' % date_time_range ) if start: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_date_range(\n date_range: str,\n) -> Tuple[Optional[datetime.date], Optional[datetime.date]]:\n date_range = date_range.lstrip(\"\\\\\")\n split = date_range.split(\"-\")\n if len(split) > 2:\n raise ValueError(\n \"Invalid date range, should only specify one dash in date ra...
[ "0.70558614", "0.6897262", "0.63350904", "0.6282477", "0.621597", "0.6176697", "0.6156008", "0.60693157", "0.6067593", "0.60488504", "0.60171074", "0.5958702", "0.5942073", "0.59340096", "0.58776504", "0.586938", "0.5793482", "0.57248247", "0.5699711", "0.56850374", "0.565827...
0.7164441
0
Check instance type is in one of expected types.
def is_instance(instance, expected_types): for expected_type in expected_types: if isinstance(instance, expected_type): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_type(instance, type):\n\tif not isinstance(instance, type):\n\t\traise TypeError('Instance expected type {0}, but got: {1}', type(type), type(instance))", "def __is_type_instance( self, instance_type ):\n for index, instance in enumerate(INSTANCE_TYPES):\n if instance == instance_typ...
[ "0.72732526", "0.7065325", "0.70311666", "0.6813455", "0.6790115", "0.6724509", "0.66077524", "0.65536654", "0.6530031", "0.6525059", "0.6494566", "0.6428977", "0.64019096", "0.6390517", "0.63788044", "0.6357287", "0.6349716", "0.6332506", "0.6327769", "0.63258487", "0.632584...
0.77492213
0
get switch machines from file.
def get_switch_machines_from_file(filename): switches = [] switch_machines = {} with open(filename) as switch_file: for line in switch_file: line = line.strip() if not line: # ignore empty line continue if line.startswith('#'): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_time_machine():\n with open(download('time_machine'), 'r') as f:\n lines = f.readlines()\n return [re.sub('[^A-Za-z]+', ' ', line).strip().lower() for line in lines]", "def load_from_file(fn):\n rv = {}\n ops = {}\n for line in open(fn, encoding='utf-8'):\n wspath = line.str...
[ "0.5648559", "0.5464102", "0.54595304", "0.54304993", "0.53690493", "0.5353579", "0.53468", "0.5312164", "0.52704805", "0.525285", "0.5242493", "0.52420366", "0.52016795", "0.51909846", "0.5119141", "0.5106882", "0.5100907", "0.50711477", "0.5057642", "0.5056354", "0.5053885"...
0.7751767
0
Loads all slurm data in a folder and builds a json file which it stores.
def load_slurm_folder(p): filter_function = lambda f: True if ".out" in f else False slurm_dict = {"runs": []} for f in filter(filter_function, os.listdir(p)): slurm_dict["runs"].append(load_slurm_data(os.path.join(p, f))) exit("Success!")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data():\n print (\"&\")\n res = {}\n\t\n # Load Data\n with open(DATA_PATH_TRAIN, 'rb') as f:\n data = pickle.load(f)\n\t\t\n for d in data:\n for j in range(len(d)):\n if not d[j][\"addinfo\"][\"path\"] in res:\n res[d[j][\"addinfo\"][\"path\"]] = {}\n ...
[ "0.6252054", "0.59761477", "0.59693277", "0.58761185", "0.5825508", "0.58211905", "0.58072215", "0.578439", "0.57059884", "0.5705148", "0.56468225", "0.5599094", "0.55981183", "0.5579356", "0.5570758", "0.5566847", "0.5552736", "0.5511776", "0.54895043", "0.5483078", "0.54814...
0.7349583
0
Parses the XML post data and stores all the information required to fuzz the XML data as attributes.
def parse_xml_data(self, xml_post_data): try: read_handler = parse_xmlrpc(xml_post_data) except: raise ValueError(ERR_MSG % xml_post_data[:50]) else: # Tried to do this with self.update but it was failing :S for k, v in read_handler.get_data_contai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_post_parse_xml(self, *args, **kwargs): # real signature unknown\n pass", "def parse_data(self):\n\n msg = self.xml['dom'].childNodes[0]\n self.data = xml_to_dicts(msg, False)\n\n # Get some metadata together\n self.id = \"%s:%s\" % (self.data['src']['name']['#cdata'], se...
[ "0.6439742", "0.59761095", "0.5938992", "0.57933503", "0.57511455", "0.55264777", "0.546048", "0.5428306", "0.5418183", "0.53848094", "0.53514785", "0.5332804", "0.52745897", "0.5247591", "0.5184011", "0.5168995", "0.5157829", "0.51265", "0.5112889", "0.51009244", "0.5095121"...
0.67865217
0
Create a .h file by surrounding the contents of a yaccgenerated .hpp with a ifndefdefineendif guard.
def create_h_wrapper(target, source, env): t = str(target[1]) fp = open(t, 'w') define = os.path.splitext(os.path.split(t)[1])[0] fp.write('#ifndef %s_h\n' % define) fp.write('#define %s_h\n' % define) fp.write(open(t + 'pp', 'r').read()) fp.write('#endif // %s_h\n' % define)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fix_header_guard(path, header_guard):\n ifndef = re.compile('^#ifndef [^\\s]+_H_$')\n define = re.compile('^#define [^\\s]+_H_$')\n endif = re.compile('^#endif +// *[^\\s]+_H_$')\n fixed_ifndef = False\n fixed_define = False\n fixed_endif = False\n fixed_pragma_once = False\n\n for line...
[ "0.63557416", "0.6132419", "0.58885884", "0.58732647", "0.58144164", "0.56314635", "0.56158525", "0.55182534", "0.55104166", "0.54532367", "0.5435203", "0.54324377", "0.5373944", "0.5363482", "0.53391343", "0.5297956", "0.52791464", "0.5220475", "0.51954436", "0.5174568", "0....
0.7045174
0
returns a list of random bdays of length n
def gen_birthdays(n): list = [] for date in range(n): list.append(random.randint(1, 365)) return list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRandomList(n):\n lyst = list()\n for count in range (n):\n lyst.append(random.randint(1, n))\n return lyst", "def generatoze(b):\r\n l = []\r\n for i in range(b):\r\n k = random.randint(0, 100)\r\n l.append(k)\r\n return l", "def rand_list(n, limit):\n g = []\n ...
[ "0.7262534", "0.7050531", "0.6832691", "0.6665026", "0.66074395", "0.6541333", "0.6350291", "0.63272256", "0.63181716", "0.6227783", "0.6210747", "0.6150272", "0.61294335", "0.6096094", "0.6090649", "0.6087597", "0.6079482", "0.6051585", "0.60453475", "0.6038187", "0.6036254"...
0.7703274
0
generates sample bdays for number of students and returns count of how many had matches
def num_matches(students, samples): count = 0 for i in range(samples): bday_list = gen_birthdays(students) if has_duplicates(bday_list): count += 1 return count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample_count(self):", "def count_sevens( rolls ):\n count = 0\n total = 0\n while count < rolls:\n if random.randint(1, 6) + random.randint(1, 6) == 7:\n count += 1\n total += 1\n if total >= 12 * rolls:\n return total\n\n return total", "def num_stude...
[ "0.6046355", "0.5927535", "0.57463497", "0.5685903", "0.55577457", "0.54592294", "0.5433981", "0.5403827", "0.5362712", "0.53228366", "0.52189565", "0.52135205", "0.5157612", "0.51540315", "0.51540315", "0.5148215", "0.5146626", "0.5126046", "0.5126046", "0.5095364", "0.50850...
0.8029248
0
rospy.Subscriber('YOUR_STRING_HERE', ..., self.navToPose, queue_size=1) handle nav goal events This is a callback function. It should exract data from goal, drive in a striaght line to reach the goal and then spin to match the goal orientation.
def navToPose(self,goal): goalX=(goal.pose.position.x - self._current.position.x) goalY=(goal.pose.position.y - self._current.position.y) goalDistance=((goalX**2)+(goalY**2))**(.5) goalAngle=math.radians(math.atan2(goalY,goalX)) self.rotate(goalAngle) time.sleep(2) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def navToPose(goal):\n #compute angle required to make straight-line move to desired pose\n global xPosition\n global yPosition\n global theta\n #capture desired x and y positions\n desiredY = goal.pose.position.y\n desiredX = goal.pose.position.x\n #capture desired angle\n quat = goal.p...
[ "0.7614442", "0.6917766", "0.67438257", "0.65554756", "0.6536543", "0.648905", "0.6464464", "0.6300213", "0.6289639", "0.62370735", "0.6192258", "0.617503", "0.61525756", "0.6140915", "0.61379313", "0.6072149", "0.6056768", "0.60525644", "0.60445696", "0.60391855", "0.6021669...
0.7052579
1
Find rightmost value less than x in list a
def find_lt(a,x): i = bisect_left(a,x) if i: return a[i-1] raise ValueError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_lt(a, x):\n i = bisect_left(a, x)\n if i:\n return int(i-1)\n print('in find_lt,{}'.format(a))\n raise ValueError", "def find_min(list):\n return find_value_at(list, -1)", "def find_le(a, x):\n i = bisect_right(a, x)\n if i:\n return a[i - 1]\n rai...
[ "0.7524997", "0.7341261", "0.7230953", "0.7151856", "0.696779", "0.6896987", "0.6848993", "0.68417346", "0.682797", "0.6764355", "0.66486675", "0.6609502", "0.6608138", "0.6605526", "0.6580939", "0.6579731", "0.6551487", "0.6512932", "0.64967483", "0.6478752", "0.6472426", ...
0.7733092
0
Find leftmost item greater than or equal to x in list a
def find_ge(a,x): i = bisect_left(a,x) if i != len(a): return a[i] raise ValueError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_gt_index(a, x):\n i = bisect_right(a, x)\n if i < len(a):\n return i\n raise ValueError", "def find_lt(a,x):\n i = bisect_left(a,x)\n if i:\n return a[i-1]\n raise ValueError", "def find_le(a, x):\n i = bisect_right(a, x)\n if i:\n return a[i - ...
[ "0.71268624", "0.7089322", "0.69219244", "0.6876344", "0.67170715", "0.66673696", "0.6594032", "0.6501696", "0.64784956", "0.63835764", "0.63481444", "0.6347171", "0.63421595", "0.63225186", "0.6305548", "0.62983143", "0.6297639", "0.6286322", "0.626374", "0.62588847", "0.625...
0.71337193
0
Make a list of alternate allele frequencies and number of reads
def get_altL(fn): f = open(fn,'r') linesL = [ x.strip().split('\t') for x in f.readlines() ] f.close() if linesL[0][0][0] == '#': linesL = linesL[1:] for i in range(len(linesL)): if linesL[i][4] == '0': # if the number of reads supporting alternate is 0, we'll switch to 1 so avoid nu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allele_freqs(self):\n diploid = self.geno.sum(2) * 0.5\n return np.nanmean(diploid, axis = 0)", "def GenFrequencies(alignment):\n bases = {'A':0,'C':0,'G':0,'T':0,'-':0}\n FreqArray = []\n SeqLen = getLen(alignment)\n for i in range(SeqLen):\n FreqArray.append(bases.copy())\n...
[ "0.6576099", "0.650995", "0.6350264", "0.60870063", "0.6022668", "0.5969855", "0.59429526", "0.5826238", "0.58048", "0.5762575", "0.5746433", "0.572884", "0.56611747", "0.5660225", "0.56323826", "0.5626442", "0.5606676", "0.5606516", "0.55872726", "0.55821407", "0.55477655", ...
0.73817194
0
Creates dict of expected alternate allele frequencies and consistent genotypes
def freq_to_genotype(pL,sL,er): h = sum(pL) # number of different haplotypes L = [ bin(x)[2:] for x in range(1,2**h-1) ] # range from 1 to 2**h-1 because we don't want 0% or 100% allele freq M = [ '0'*(len(L[-1])-len(x))+x for x in L ] p_freqL = [] for i in range(len(pL)): p_freqL += [sL[i]/...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_intrenal_hap_dict(self, alleles, group2):\n\n hap_dict = self.hap_dict_per_group[group2]\n\n internal = {}\n for i, haplotype in enumerate(alleles):\n if type(haplotype[0])==tuple: #Checks if X is a tuple/list of alleles.\n n = len(haplotype)\n ...
[ "0.6449053", "0.6335954", "0.60402036", "0.59015834", "0.5899603", "0.5838886", "0.57841706", "0.57834846", "0.57578355", "0.5652778", "0.563409", "0.55973154", "0.55691093", "0.55647784", "0.5562391", "0.55141944", "0.5497581", "0.5487209", "0.54752886", "0.54535395", "0.544...
0.71242684
0
Reduces a list of genotypes to distinct genotypes given ploidy
def collapse_genotypes(pL,gL): if len(gL) < 2: return gL else: uniqueL = [] # list of unique genotypes relative to ploidy for g in gL: s = '' for i in xrange(len(pL)): s += ''.join(sorted(g[0:pL[i]])) g = g[pL[i]:] if s ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_genotype(ploidy):\n return [\"\".join(comb) for comb in cwr(\"ACGT-\", ploidy)]", "def purify(l):\n return set([item.replace('B-', '').replace('I-', '') for item in l])", "def remove_duplicates(self, propositions):\r\n propositions_copy = list(propositions)\r\n uniques = []\r\n ...
[ "0.6803628", "0.55451757", "0.5401281", "0.53964216", "0.5384058", "0.53527087", "0.5346865", "0.52951", "0.52865404", "0.5263895", "0.5255671", "0.5248324", "0.52449715", "0.523073", "0.5202335", "0.5185486", "0.51750034", "0.5166553", "0.51247567", "0.5120886", "0.5101648",...
0.7633764
0
Maximum likelihood estimator of alt_freq given possibilities in exp_freqL
def estimate_genotype(alt_freq,exp_freqL): try: i = find_lt(exp_freqL,alt_freq) # Find rightmost value less than x except ValueError: i = float("-inf") try: j = find_ge(exp_freqL,alt_freq) # Find leftmost item greater than or equal to x except ValueError: j = float("inf")...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def EGWD_fg(f):\n A = 4.2e-47\n res = np.zeros((len(f)))\n for i,freq in enumerate(f): \n if freq >=3e-3:\n # strain \n res[i] = A * freq**(-7/3) * np.exp(-2*(freq/5e-2)**2) \n else:\n res[i] = np.NaN\n return np.array(res)", "def lam(freq):\n retu...
[ "0.58639437", "0.58031434", "0.5781176", "0.5701864", "0.56158656", "0.5586913", "0.55847263", "0.5532513", "0.55240077", "0.5455719", "0.53893125", "0.53720796", "0.5371352", "0.5369857", "0.5361898", "0.5320009", "0.53069574", "0.5296892", "0.52965856", "0.528414", "0.52720...
0.6873887
0
Get account asset information.
async def get_user_account(self): uri = "/v3/spot/assets" success, error = await self.request("GET", uri, auth=True) return success, error
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_asset_details(self):\n\t\tif self._session:\n\t\t\tresults = self._session.get_asset_details()\n\t\t\tif results.get('success'):\n\t\t\t\treturn results.get('assetDetail', {})\n\n\t\treturn {}", "def getAssetInfo(self):\n return self._AssetInfo", "def asset_info(self, asset_id):\n respons...
[ "0.7429606", "0.7401501", "0.7243802", "0.722088", "0.71087193", "0.7101562", "0.6901645", "0.6899573", "0.68298274", "0.6810045", "0.67111224", "0.6535242", "0.6509664", "0.6497271", "0.6461157", "0.64144397", "0.63877004", "0.638052", "0.63755345", "0.63709587", "0.63575983...
0.7496198
0
Initialize. fetch all open order information.
async def _initialize(self): result, error = await self._rest_api.get_open_orders(self._raw_symbol) if error: e = Error("get open order nos failed: {}".format(error)) logger.error(e, caller=self) SingleTask.run(self._init_success_callback, False, e) return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_orders(self, **kwargs):\n pass", "def __init__(self):\n self.orders = {}", "def get_all_open_orders(self):\n self.__init_client()\n open_orders = retry(lambda: self.client\n .futures_get_open_orders(symbol=self.pair)) \n if len(open_...
[ "0.6911011", "0.6732033", "0.67288405", "0.6698249", "0.6603825", "0.6572912", "0.65568244", "0.65461785", "0.6524522", "0.6492955", "0.649012", "0.6486226", "0.6481543", "0.6471251", "0.64309156", "0.63837665", "0.638131", "0.6358056", "0.6336886", "0.6328778", "0.6328192", ...
0.8316525
0
Get open order id list.
async def get_open_order_nos(self): success, error = await self._rest_api.get_open_orders(self._raw_symbol) if error: return False, error order_nos = [] for order_info in success["data"]: order_nos.append(order_info["order_id"]) return order_nos, None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_open_order_nos(self):\n success, error = await self._rest_api.get_open_orders(self._raw_symbol)\n if error:\n return None, error\n order_nos = []\n for order_info in success:\n order_no = \"{}_{}\".format(order_info[\"orderId\"], order_info[\"clientOr...
[ "0.76245046", "0.7578028", "0.7421624", "0.7277054", "0.7195222", "0.71023816", "0.68694735", "0.67865413", "0.66785836", "0.6594083", "0.65420175", "0.64948434", "0.64834046", "0.6482758", "0.637984", "0.63375515", "0.6328234", "0.6297808", "0.62487334", "0.6226497", "0.6215...
0.7653009
0
Populate the facts for firewall
def populate_facts(self, connection, ansible_facts, data=None): fos = self._fos if self._fos else connection vdom = self._module.params['vdom'] ansible_facts['ansible_network_resources'].pop('system', None) facts = {} if self._uri.startswith(tuple(FACT_SYSTEM_SUBSETS)): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _facts(facts):\n return {'swift_facts': facts}", "def create_firewall(context):\n return [{\n 'type': 'templates/firewall.py',\n 'name': 'fc-firewall',\n 'properties': {\n 'projectId':\n '$(ref.fc-project.projectId)',\n 'network':\n '$(ref.fc-network.selfLink)',\n ...
[ "0.64496034", "0.5654586", "0.5614463", "0.5473757", "0.5451099", "0.54459053", "0.5418272", "0.5292958", "0.5212965", "0.51919067", "0.518023", "0.51642764", "0.5105921", "0.509699", "0.50888866", "0.5079729", "0.50623125", "0.5030542", "0.4960221", "0.4936564", "0.4921845",...
0.61381567
1
Check if user is already followed
def is_user_already_followed(followed_user_id, user_id): result = Follow.objects.filter(followed_user=followed_user_id, user=user_id).exists() return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_already_followed(self):\n self.authorize_user(self.user)\n with self.settings(\n EMAIL_BACKEND='django.core.mail.backends.locmem.EmailBackend'):\n self.register_user(self.user1)\n self.client.post(self.follow_url, format='json')\n response...
[ "0.7639473", "0.75436383", "0.7365296", "0.72989804", "0.72989804", "0.7287046", "0.72676414", "0.72648203", "0.7164662", "0.71278054", "0.70992005", "0.704521", "0.7031978", "0.7002825", "0.694829", "0.6905379", "0.68953675", "0.68869936", "0.68548286", "0.679923", "0.678995...
0.7611498
1
Notifies the user when they are followed
def was_followed(sender, instance, created, **kwargs): sendr = User.objects.get(id=instance.user_id) followed = User.objects.get(id=instance.followed_user_id) if created: notify.send(sender=sendr, recipient=followed, verb='followed', description="{} followed you.".format(sendr.u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def follow(self, follower, followee):\n pass", "def follow_user(cls, user, following):\r\n pass", "def follow_user(cls, user, following):\n pass", "def follow(request, usertofollow):\n to_follow = Member.objects.get(user__username=usertofollow)\n user = Member.objects.get(user=requ...
[ "0.77373224", "0.7435289", "0.73207146", "0.6972937", "0.68635356", "0.6829008", "0.68266904", "0.68142164", "0.6808901", "0.6797445", "0.67546874", "0.6750833", "0.674673", "0.67189676", "0.6615465", "0.65743905", "0.6557167", "0.6508124", "0.64725566", "0.6442561", "0.64397...
0.7462778
1
Get all Jenkins jobs associated with pull requests
def get_pr_jobs(): res = requests.get( uri + "/view/Pull%20Requests/api/json", headers={"accept": "application/json"}, auth=requests.auth.HTTPBasicAuth(user, password), verify=verify, ) if res.status_code != 200: raise RuntimeError("Received non 200 status code from j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_jobs(repo_name, revision):\n return buildapi.query_jobs_schedule(repo_name, revision)", "def get_pull_requests():\n pull_requests = []\n url_base = f\"https://github.com/{GITHUB_OWNER}/{GITHUB_REPO}/pull/\"\n repo = GITHUB.get_user(GITHUB_OWNER).get_repo(GITHUB_REPO)\n pulls = repo.get_p...
[ "0.65573215", "0.63765645", "0.63599795", "0.63543665", "0.63507205", "0.63033533", "0.6302482", "0.62864417", "0.6278114", "0.62583464", "0.6230942", "0.621107", "0.6194467", "0.6187871", "0.6187871", "0.61729586", "0.6151845", "0.60796493", "0.6042416", "0.60202426", "0.601...
0.78549105
0
Determin weather a Jenkins job accepts build parameters
def job_has_params(job_url): name = job_url.rstrip("/").rsplit("/")[-1] if name in ( "pr-docs", "pr-lint", "pr-pre-commit", ): return False else: return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_jenkins_env_vars():\n # TODO find a way to get the socket number of\n os_cpu_socket = 'true'\n\n metadata = {\n 'jenkins': {\n 'jenkins_job_id': os.environ['BUILD_ID'],\n },\n 'github': {\n 'git_branch': os.environ['GIT_BRANCH'],\n 'git_comm...
[ "0.5904651", "0.58801216", "0.58676225", "0.5814894", "0.5733801", "0.57203275", "0.5677463", "0.5605391", "0.5605071", "0.5595419", "0.5580772", "0.5556787", "0.55465394", "0.5505675", "0.54893064", "0.5467971", "0.5446552", "0.54407585", "0.5400286", "0.5399748", "0.5394839...
0.6885774
0
Filter jobs by a keyword. When the keyword is 'all' every job is returned
def filter_jobs(jobs, keyword): for job in jobs: if keyword == "all": yield job elif job["name"].find(keyword) != -1: yield job
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_jobs(self, bill_id: int = 0, limit: int = 0) -> List[Job]:\n pass", "def job_filter(self, job_name, job_location):\r\n\r\n self.job_name = job_name\r\n self.job_location = job_location\r\n self.driver.implicitly_wait(5)\r\n job_icon = driver.find_element_by_link_text...
[ "0.633365", "0.62055653", "0.61803526", "0.5891469", "0.5792528", "0.5759451", "0.5704297", "0.5655571", "0.5650176", "0.56143725", "0.5606874", "0.5528685", "0.54804325", "0.5461866", "0.5387757", "0.53756195", "0.532144", "0.5304519", "0.5302931", "0.5302027", "0.52584493",...
0.861029
0
Request jenkins to build a job
def build_job(job_url, pr_number, run_full, has_params): log.debug( "job_url: %s pr_num: %s run_full: %s has_params: %s", job_url, pr_number, run_full, has_params, ) if has_params: pr_url = "{}/job/PR-{}/buildWithParameters?runFull={}".format( job_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def submitBuildRequest(ss, reason, props=None, now=False):", "def trigger_job(self, job, parameters=None):\n parameters = parameters or {}\n parameter_list = []\n for key in parameters:\n parameter_list.append(\"-p\")\n parameter_list.append(\"%s=%s\" % (key, parameters...
[ "0.6787764", "0.6364581", "0.6225597", "0.6213876", "0.6213663", "0.61761606", "0.6159214", "0.61089903", "0.603577", "0.5999971", "0.5962984", "0.5960463", "0.5924092", "0.590004", "0.58851326", "0.58598584", "0.5765767", "0.5739275", "0.57330847", "0.5693525", "0.56787413",...
0.7102698
0
Constructor for the Solver class. name Name of the SMT solver that this object represents.
def __init__(self, name=""): # Name of the SMT solver that this object represents. self.name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, name):\n name_split = name.split('-')\n self.problem = name_split[0]\n nb = int(name_split[1])\n # param = name_split[2:]\n\n if self.problem == 'IR':\n self.loader = IRSynthesizer(nb)\n elif self.problem == 'CL':\n self.loader = CL...
[ "0.6447435", "0.6441531", "0.6417888", "0.6406241", "0.6392353", "0.63480014", "0.63480014", "0.6342057", "0.63331425", "0.6316565", "0.63014925", "0.62872577", "0.62872577", "0.62872577", "0.62872577", "0.62872577", "0.62872577", "0.62739336", "0.62663686", "0.62451565", "0....
0.88329774
0
Checks and updates the satisfiability of the SMT query represented by the Query object provided. If the SMT query is satisfiable, the Query object is updated with a satisfying model; if the query is unsatisfiable, the Query object is updated with an unsatisfiable core. query Query object that represents an SMT query.
def checkSat(self, query): errMsg = "Method has not yet been implemented." raise NotImplementedError(errMsg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkSat(self, query):\n # Write the SMT query to a temporary file.\n smtQueryFileHandler = NamedTemporaryFile()\n with smtQueryFileHandler:\n smtQueryFileHandler.write(query.queryStr)\n smtQueryFileHandler.seek(0)\n\n command = self._generateBoolectorComma...
[ "0.62313735", "0.5535619", "0.5482047", "0.5473373", "0.5380649", "0.53429544", "0.5322199", "0.5322199", "0.5322199", "0.5287992", "0.51578116", "0.51370686", "0.5128758", "0.51119334", "0.51007235", "0.50871086", "0.50794274", "0.505213", "0.5044605", "0.50412136", "0.50237...
0.603378
1
Test validating ingress session.
async def test_validate_session(api_client: TestClient, coresys: CoreSys): with patch("aiohttp.web_request.BaseRequest.__getitem__", return_value=None): resp = await api_client.post( "/ingress/validate_session", json={"session": "non-existing"}, ) assert resp.status =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_session(self, k8sconfig):\n # Basic.\n config = k8sconfig._replace(token=None)\n sess = k8s.session(config)\n assert \"authorization\" not in sess.headers\n\n # With access token.\n config = k8sconfig._replace(token=\"token\")\n sess = k8s.session(config)\n...
[ "0.62062603", "0.6161203", "0.61001164", "0.6027876", "0.58745044", "0.58090013", "0.57940024", "0.57700145", "0.5735431", "0.57108766", "0.56991327", "0.56807244", "0.5665794", "0.5655053", "0.5639025", "0.56359905", "0.5615939", "0.5610324", "0.5564795", "0.5554678", "0.553...
0.72035307
0
Test validating ingress session with user ID passed.
async def test_validate_session_with_user_id( api_client: TestClient, coresys: CoreSys, ha_ws_client: AsyncMock ): with patch("aiohttp.web_request.BaseRequest.__getitem__", return_value=None): resp = await api_client.post( "/ingress/validate_session", json={"session": "non-existi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_validate_session(api_client: TestClient, coresys: CoreSys):\n with patch(\"aiohttp.web_request.BaseRequest.__getitem__\", return_value=None):\n resp = await api_client.post(\n \"/ingress/validate_session\",\n json={\"session\": \"non-existing\"},\n )\n a...
[ "0.6771428", "0.6248126", "0.6239274", "0.6128381", "0.60962254", "0.6075895", "0.60345584", "0.6012837", "0.6000163", "0.59971935", "0.5994831", "0.5977614", "0.59714454", "0.59547204", "0.5942947", "0.5931179", "0.5929996", "0.5905731", "0.59000045", "0.5898294", "0.5892295...
0.64496136
1
Records a transaction and returns True if this transaction is recorded successfully. A transaction is recorded successfully when this bank account is not locked, has enough balance, and the budget associated with the transaction is not locked.
def record_transaction(self, transaction: Transaction) -> bool: if self._locked: print('Failed to record transaction! Your account has been locked!' ) return False if transaction.amount > self.bank_balance: print('Failed to record transaction! Not e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def record_transaction(self) -> None:\n Menu.prompt_record_transaction()\n tx_data = Transaction.prompt_record_tx()\n new_tx = Transaction.generate_new_tx(tx_data)\n\n # Convert the user budget category int input to the enum\n budget_category_int = new_tx.budget_category\n ...
[ "0.74065685", "0.61995095", "0.59571934", "0.5895427", "0.58516836", "0.58323306", "0.58269304", "0.5821002", "0.5805865", "0.5771165", "0.567371", "0.56615746", "0.5643737", "0.5640873", "0.5632899", "0.5597801", "0.55755913", "0.5570525", "0.5552613", "0.5546733", "0.554611...
0.83585197
0
Prints a list of transactions in the given budget for review.
def print_transactions_for_review(self, budget: Budget) -> None: print(f'Please review the following transactions in the {budget.name} ' f'budget:') transactions = self.get_transactions_by_budget(budget.category) for transaction in transactions: print(transaction)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_transactions(self) -> None:\n user_choice = Menu.prompt_view_transactions()\n if user_choice == 5:\n print(\"Returning to main menu...\")\n return\n\n budget_category = BudgetManager.category_mapping[user_choice]\n print(f\"\\nTransactions in the {budget_c...
[ "0.7030385", "0.7004039", "0.5814647", "0.57192343", "0.55190694", "0.5444758", "0.54354614", "0.54149073", "0.5408581", "0.54000187", "0.53444046", "0.53422123", "0.53352505", "0.53323025", "0.531848", "0.5304199", "0.5294835", "0.5280329", "0.52642375", "0.52329063", "0.522...
0.87271416
0
Issues a warning to the user that they are about to exceed this budget.
def _warn_nearing_exceed_budget(self, budget: Budget, exceeded_percent: int) -> None: print(f'[WARNING] You are about to exceed the {budget.name} budget! ' f'You went over {exceeded_percent}% of the total ' f'${budget.total_amount}.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _notify_exceeded_budget(self, budget: Budget) -> None:\n print(f'[NOTIFICATION] You have exceeded the {budget.name} budget.')", "def _warn_and_lock_if_needed(self, transaction: Transaction) -> None:\n budget = self.budget_manager.get_budget(transaction.budget_category)\n exceeded_ratio =...
[ "0.82930493", "0.6629623", "0.65887743", "0.6412324", "0.6290423", "0.6259408", "0.620603", "0.6156041", "0.6145662", "0.60989755", "0.6067491", "0.60485494", "0.60428154", "0.59878916", "0.598671", "0.5883218", "0.58504766", "0.5844124", "0.5840327", "0.58396876", "0.5837606...
0.8121444
1
Notifies the user that they've just exceeded this budget.
def _notify_exceeded_budget(self, budget: Budget) -> None: print(f'[NOTIFICATION] You have exceeded the {budget.name} budget.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _warn_nearing_exceed_budget(self, budget: Budget,\n exceeded_percent: int) -> None:\n print(f'[WARNING] You are about to exceed the {budget.name} budget! '\n f'You went over {exceeded_percent}% of the total '\n f'${budget.total_amount}.')", ...
[ "0.7410808", "0.6258963", "0.61991805", "0.6147017", "0.603914", "0.6018576", "0.5963936", "0.59551346", "0.5946245", "0.5878284", "0.5873276", "0.5865971", "0.584784", "0.58432275", "0.5769025", "0.5748616", "0.5689736", "0.568398", "0.5662658", "0.56340307", "0.56205475", ...
0.8598685
0
Returns a list of transactions for the given budget category.
def get_transactions_by_budget(self, category: BudgetCategory) -> list: return [transaction for transaction in self.transactions if transaction.budget_category == category]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_transactions_by_category(id, start=None, end=None):\n transactions = None\n \n if start is not None and end is not None:\n transactions = get_db().execute('SELECT * FROM transactions WHERE category_id = ? AND days >= ? AND days <= ? ORDER BY days ASC', (id,start, end)).fetchall()\n elif ...
[ "0.6806576", "0.6658334", "0.65594226", "0.6545171", "0.6276733", "0.6153951", "0.6099856", "0.60981506", "0.6073485", "0.56966245", "0.56923014", "0.56610286", "0.56480473", "0.5619715", "0.56023616", "0.55917746", "0.55726683", "0.54196036", "0.5411472", "0.53702503", "0.53...
0.90207845
0
Returns a list of budgets.
def get_budgets(self) -> list: return self.budget_manager.get_budgets()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_budgets(self) -> list:\n return list(self.budgets.values())", "def view_budgets(self) -> None:\n Menu.prompt_view_budgets()\n for budget in self.user.budget_manager:\n print(f\"{budget}\\n\")", "def get_period_budgets(cls, now):\n limits_dict = {}\n strateg...
[ "0.85214865", "0.7412498", "0.64458525", "0.63256943", "0.62178475", "0.61472815", "0.60853624", "0.6020937", "0.6002316", "0.5954649", "0.59180295", "0.5860765", "0.58439565", "0.57929516", "0.57694215", "0.57481736", "0.5706999", "0.56716955", "0.562081", "0.55899936", "0.5...
0.8720392
0
Issues a warning or locks budget/bank account when these
def _warn_and_lock_if_needed(self, transaction: Transaction) -> None: budget = self.budget_manager.get_budget(transaction.budget_category) exceeded_ratio = budget.exceeded_ratio if exceeded_ratio > 1: self._notify_exceeded_budget(budget) self._lock_budget(budget) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def issue_locked_warning() -> None:\n print(\"\\n[red]Warning:[/red] Your bank account has been completely \"\n \"locked out for exceeding 2 or more categories!\")", "def _warn_and_lock_if_needed(self, transaction: Transaction) -> None:\n budget = self.budget_manager.get_budget(transac...
[ "0.7023338", "0.6777175", "0.6740319", "0.64308864", "0.61320394", "0.6078522", "0.6064413", "0.6030092", "0.6029085", "0.60170025", "0.6004372", "0.5946874", "0.59442586", "0.59333825", "0.5920068", "0.5887212", "0.5878231", "0.5870727", "0.5860451", "0.58590853", "0.5858245...
0.71971434
0
Creates and returns a test bank account.
def load_test_account() -> BankAccount: budget_manager = BudgetCreator.load_test_budget_manager() return TroublemakerBankAccount('123123', 'HSBC', 1000, budget_manager)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def example_bank_account():\n \n return BankAccount(\"Test User\", 1000.0)", "def account():\n\n bank_test = Bank.objects.create(name='R-Bank')\n company_test = Company.objects.create(name='Tre Belarus', country='Belarus')\n account = Account.objects.create(iban_number='TEEdddddddfs', swift_code='...
[ "0.8158701", "0.77940786", "0.7747473", "0.76212186", "0.7560084", "0.7495021", "0.7118138", "0.7009641", "0.6978692", "0.6969263", "0.6830469", "0.67025876", "0.6648418", "0.6598755", "0.6555226", "0.6548302", "0.6513743", "0.6461734", "0.63989663", "0.63898635", "0.6336258"...
0.7865632
1
Prompts the user for bank account details, initializes a Bank Account based on the given user type and returns it.
def create_bank_account(cls, user_type: UserType) -> BankAccount: bank_account_no = input('Enter bank account number: ') bank_name = input('Enter bank name: ') bank_balance = -1 while bank_balance < 0: bank_balance = float(input('Enter bank balance: ')) if bank_ba...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bank_account():\n return BankAccount()", "def example_bank_account():\n \n return BankAccount(\"Test User\", 1000.0)", "def generate_bank_account(user_data: dict) -> BankAccount:\n bank_account = BankAccount(user_data[\"bank_account_number\"],\n user_data[\...
[ "0.6725383", "0.6682501", "0.6465563", "0.6342259", "0.6145165", "0.6049503", "0.6045544", "0.6011097", "0.5917009", "0.5867311", "0.58017236", "0.5797857", "0.57436943", "0.57212454", "0.569688", "0.5659118", "0.56333715", "0.5625593", "0.5569825", "0.5529231", "0.55178225",...
0.81425035
0
Create authorization code in db
async def create_authorization_code( self, *args, **kwargs ) -> OAuth2AuthorizationCode: authorization_code = await super().create_authorization_code( *args, **kwargs ) data = authorization_code._asdict() # TODO: handle None values for optional property f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_access_code(user_data):\n\n try:\n user = User.objects.get(cn=user_data['cn'])\n return user.code\n except User.DoesNotExist:\n user = User(cn=user_data['cn'])\n\n event_id = os.environ.get('EVENTBRITE_EVENTID')\n ticket_id = os.environ.get('EVENTBRITE_TICKETID')\n\n ...
[ "0.62770134", "0.61458534", "0.6110018", "0.6079008", "0.6003322", "0.5946185", "0.59064984", "0.59021664", "0.5872931", "0.58239496", "0.5741577", "0.57246685", "0.57237434", "0.57162374", "0.5681171", "0.56726426", "0.56435186", "0.5626114", "0.56006324", "0.55944014", "0.5...
0.69368434
0
Revokes an existing token. The `revoked` Flag of the Token must be set to True
async def revoke_token(self, request: Request, token: str) -> None: token_record = ... token_record.revoked = True token_record.save()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def revoke_token(token):\n token.delete_instance()", "def revoke_token():\n json_request = request.json\n refresh_token = json_request.get('refresh_token')\n if not refresh_token:\n return msg.errors.bad_request(\n 'You should provide refresh token for this call')\n RefreshToken....
[ "0.78232735", "0.7706282", "0.7325517", "0.73235047", "0.70538867", "0.70538", "0.70465237", "0.7021239", "0.6996534", "0.68295425", "0.6786434", "0.673582", "0.66292584", "0.6539513", "0.6422981", "0.64159083", "0.63827044", "0.635505", "0.6316846", "0.63089657", "0.62669975...
0.78281873
0
Converts fastapi Request instance to OAuth2Request instance
async def _oauth2_request(request: Request): form = await request.form() def get(user, query_params): post = dict(form) method = request.method headers = CaseInsensitiveDict(**request.headers) url = str(request.url) return OAuth2Request( settings=get_aioauth...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def oauth2_token(\n request: Request, oauth2_request=Depends(_oauth2_request)\n):", "def __call__(self, request):\r\n # These checkings are necessary because type inconsisntecy of requests library\r\n # See request Github issue #230 https://github.com/kennethreitz/requests/pull/230\r\n ...
[ "0.6408545", "0.600119", "0.5834655", "0.5695598", "0.56542933", "0.56343395", "0.56162727", "0.5562784", "0.55206776", "0.5520085", "0.5478425", "0.5426116", "0.5400944", "0.538128", "0.5364518", "0.53600776", "0.534362", "0.5316848", "0.5306469", "0.5263673", "0.52629745", ...
0.70331806
0
Converts OAuth2Response instance to fastapi Response instance
def _to_fastapi_response(oauth2_response: OAuth2Response): response_content = ( oauth2_response.content._asdict() if oauth2_response.content is not None else {} ) headers = dict(oauth2_response.headers) status_code = oauth2_response.status_code content = json.dumps(response_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adapt_response(self, response):\n return response", "def adapt_response(self, response):\n return response", "def __call__(self, rv):\n if isinstance(rv, ResponseBase):\n return rv\n data, status, headers = unpack(rv)\n resp = flask.make_response(self._encoder(...
[ "0.6232749", "0.6232749", "0.59615463", "0.5955254", "0.5942351", "0.5832405", "0.58048105", "0.57740873", "0.5758995", "0.57391554", "0.57139206", "0.57086056", "0.57086056", "0.5690629", "0.56586003", "0.56191945", "0.56163085", "0.5609169", "0.56001407", "0.55809003", "0.5...
0.85038453
0
Method used to find a prompt inside an output string This method is used during the first communication with the device. First it find the prompt then caculate the different forms the prompt can take. This will be useful later on while finding prompt in other output stream (read).
def find_prompt(self, text): # Get last line of the data prompt = text.split("\n")[-1] # Remove possible \r in the data # prompt = prompt.replace("\r", "") prompt = text.split("\r")[-1] # Display info message log.info(f"find_prompt: prompt: '{prompt}'") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prompt(self):\r\n prompt_css = \"section.open-ended-child>div.prompt\"\r\n prompts = self.q(css=prompt_css).map(lambda el: el.get_attribute('innerHTML').strip()).results\r\n\r\n if len(prompts) == 0:\r\n self.warning(\"Could not find essay prompt on page.\")\r\n retur...
[ "0.65970707", "0.62668115", "0.61960435", "0.6195898", "0.6177484", "0.6155285", "0.61121786", "0.60055226", "0.60020685", "0.59718215", "0.59385085", "0.59329647", "0.592809", "0.5920193", "0.58948696", "0.58815306", "0.5805916", "0.58022183", "0.5785861", "0.5783012", "0.57...
0.7233047
0
Method used to check if a prompt has one of the expected endings then create a list with all possible prompts for the device
def get_possible_prompts(self, prompt): # By default no prompts are returned list_of_prompts = [] # Get all the ppossible values of the endings of the prompt list_of_possible_ending_prompts = self.list_of_possible_ending_prompts # Temporary variable storing the prompt value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prompt_list(prompt, options):\n while True:\n print(prompt)\n for i in range(0, len(options)):\n print(f\"{i})\\t{options[i]}\")\n response = prompt_base(\"\")\n try:\n response = int(response)\n if 0 <= response < len(options):\n r...
[ "0.66354936", "0.59655124", "0.5958971", "0.59545714", "0.5890365", "0.5859125", "0.58136135", "0.5700153", "0.56822366", "0.56110656", "0.560366", "0.5576209", "0.5566559", "0.55217093", "0.54588485", "0.54130536", "0.5391692", "0.53632605", "0.5341915", "0.5332787", "0.5318...
0.74763083
0
Method removing the command at the beginning of a string After sending commands an "echo" of the command sent is display in the output string. This method removes it.
def remove_command_in_output(self, text, cmd): # Display info message log.info(f"remove_command_in_output: cmd = '{cmd}'") # Display info message log.info(f"remove_command_in_output: cmd (hex) = '{cmd.encode().hex()}'") # Remove the command from the beginning of the output ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strip_command(self, slack_message: str) -> str:\n\n _, message = self.split_message(slack_message)\n return message", "def clean(self):\n\n self.cmd = self.cmd.split(\"//\")[0]\n # self.cmd = ''.join(self.cmd.split())\n self.cmd = self.cmd.strip() # remove outer wh...
[ "0.72182536", "0.71321034", "0.7058594", "0.65988994", "0.65736073", "0.6446726", "0.63454205", "0.63445175", "0.6304814", "0.621036", "0.6208212", "0.6119464", "0.6049343", "0.60468537", "0.60234344", "0.5951681", "0.59483063", "0.59456956", "0.5924454", "0.5912358", "0.5881...
0.7831976
0
Method removing the carriage return at the beginning of a string
def remove_starting_carriage_return_in_output(self, text): # Display info message log.info("remove_starting_carriage_return_in_output") # Remove the carriage return at the beginning of the string output = text.lstrip("\r\n\r") # Display info message log.info(f"remove_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __remove_break_line__(self, string):\n return string.rstrip()", "def stripNewLinesFromStartAndEnd(string):\n return string.lstrip().rstrip()", "def delete_first_line(string):\n lines = string.split('\\n')\n return '\\n'.join(lines[1:])", "def _remove_beginning_newlines(lines):\n first_...
[ "0.7486411", "0.6950394", "0.68557614", "0.67819005", "0.6707326", "0.667824", "0.66449875", "0.6611815", "0.65855545", "0.6536498", "0.6496824", "0.6496554", "0.648357", "0.646332", "0.64597154", "0.63775545", "0.63715637", "0.63505673", "0.63303834", "0.6329141", "0.6285103...
0.782444
0
Async method disabling paging on a device Use the "cmd_disable_paging" attribute
async def disable_paging(self): # Display info message log.info("disable_paging") # Send command to the device to disable paging await self.send_command(self.cmd_disable_paging)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disable_paging(self, *args, **kwargs):\n return \"\"", "def disable_paging_requested(self):\n return self.request.GET.get('disablePaging', 'false') == 'true'", "def stopPaging(self):\n self._stillPaging = 0", "def Disable(self):\n handler = self.get_command_object(\"Disable\")...
[ "0.70767534", "0.6295366", "0.61971354", "0.61932045", "0.6132327", "0.60339713", "0.5988873", "0.5862156", "0.57990867", "0.5790298", "0.5780353", "0.57160085", "0.5710022", "0.5684284", "0.5676448", "0.5631122", "0.56145567", "0.55959105", "0.5574814", "0.553064", "0.549657...
0.86768943
0
Async method used for connecting a device using SSH protocol
async def connectSSH(self): # Display info message log.info("connectSSH") # Parameters of the connection generator = asyncssh.connect( self.ip, username=self.username, password=self.password, known_hosts=None, # encryption_alg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _connect(self):\n self.ssh_conn = paramiko.SSHClient()\n if self.debug:\n self.ssh_conn.log = paramiko.common.logging.basicConfig(\n level=paramiko.common.DEBUG)\n # \"known_hosts\" is ignored, so there's no potential for mismatched keys\n self.ssh_conn.set...
[ "0.7234389", "0.70960003", "0.7086619", "0.70689154", "0.70072854", "0.6989848", "0.6914547", "0.6898207", "0.68332976", "0.6767282", "0.6754546", "0.6746539", "0.6737491", "0.67214125", "0.6694567", "0.6677169", "0.65447456", "0.6519821", "0.64635336", "0.6438321", "0.643668...
0.8311808
0
Async method used for connecting a device using Telnet protocol
async def connectTelnet(self): # Display info message log.info("connectTelnet") try: # Prepare connection with Telnet conn = asyncio.open_connection(self.ip, self.port) except Exception as error: # Preparation to the connection failed ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect(self):\n try:\n if self.telnet:\n return self.telnet\n self.telnet = telnetlib.Telnet(self.host, self.port,\n timeout=TIMEOUT)\n except Exception as err_msgs:\n error_message = \"Connect remote lite ...
[ "0.7392637", "0.7032487", "0.7007854", "0.6985452", "0.6979176", "0.6965435", "0.69242156", "0.6907835", "0.6903449", "0.68957937", "0.6893598", "0.6874942", "0.6769763", "0.6648676", "0.66257244", "0.6612491", "0.66063726", "0.6596453", "0.65770304", "0.6554541", "0.6544319"...
0.82104605
0
Async method used to send command in config mode The commands send can be either a string a list of strings. There are
async def send_config_setTelnet(self, cmds=None, timeout=None): # Display info message log.info("send_config_setTelnet") # Default value of timeout variable if timeout is None: timeout = self.timeout # Clear returned output returned_output = "" # C...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def do_config():\n\n\n async def cfg_add():\n try:\n if config[message.server.id]:\n await bot.send_message(c, 'The channel is already configured.')\n return\n except:\n config[message.server.id] = {\n ...
[ "0.67777413", "0.64350027", "0.636452", "0.63174415", "0.6297002", "0.62357134", "0.62157685", "0.61853", "0.6078101", "0.6032643", "0.59859514", "0.5939144", "0.5923143", "0.59186053", "0.5916464", "0.5910386", "0.58928096", "0.58477277", "0.5836973", "0.58281994", "0.577710...
0.6734918
1
Asyn method used to get the version of the software of the device
async def get_version(self): # Display info message log.info("get_version") # By default empty string version = "" # Run get version on the device output = await self.send_command(self.cmd_get_version) # Seek "Version " and "," to get the version in the return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_version(self):\n\n # Display info message\n log.info(\"get_version\")\n\n # By default empty string\n version = \"\"\n\n # Run get version on the device\n output = await self.send_command(self.cmd_get_version)\n\n # Seek \"Version: \" on each line of t...
[ "0.81532234", "0.72558117", "0.70881027", "0.706785", "0.70254624", "0.70173573", "0.69874835", "0.6973223", "0.69492036", "0.69293386", "0.68947613", "0.6845387", "0.68215674", "0.68143475", "0.6785546", "0.6782117", "0.67789584", "0.67577785", "0.67503726", "0.6731815", "0....
0.82191443
0
Asyn method used to get the model of the device
async def get_model(self): # Display info message log.info("get_model") # Get model output = await self.send_command(self.cmd_get_model) # Display info message log.info(f"get_model: output: '{output}'") # Remove the useless information in the returned string ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model(self):\n return self._device.device_data[self._uuid]['model']", "async def get_device_data(self):\n pass", "def get_model() -> str:\r\n ret = None\r\n try:\r\n with open('/proc/device-tree/model') as file:\r\n for line in file:\r\n ret = line\r\n ...
[ "0.680423", "0.67258275", "0.6638329", "0.66324294", "0.66298383", "0.6538331", "0.6536592", "0.6531646", "0.6480565", "0.6307875", "0.6264421", "0.62616956", "0.62586045", "0.6251553", "0.6210004", "0.6175803", "0.61743456", "0.61627907", "0.61417145", "0.61417145", "0.60891...
0.8059539
0
Asyn method used to get the configuration of the device
async def get_config(self, timeout=None): # Display info message log.info("get_config") # Default value of timeout variable if timeout is None: timeout = self.timeout # Get config output = await self.send_command(self.cmd_get_config, timeout=timeout) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _config_async(self):\n pass", "def get_configuration(self):\n\t\tdevice = DeviceBase(self.name)\n\n\t\tif len(self.master_url) > 0:\n\t\t\tdevice.master_url = self.master_url\n\t\t\tr = requests.get(self.master_url + '/configuration/' + self.name)\n\n\t\t\tif r.status_code == 200:\n\t\t\t\ttry:\...
[ "0.71710473", "0.70335764", "0.70306665", "0.6693363", "0.66830456", "0.66193783", "0.647357", "0.6431842", "0.64174044", "0.64174044", "0.64174044", "0.64174044", "0.64174044", "0.64174044", "0.64174044", "0.64174044", "0.64174044", "0.64174044", "0.64174044", "0.64174044", ...
0.73089707
0
Asyn method used to save the current configuration on the device
async def save_config(self): # Display info message log.info("save_config") # Send command output = await self.send_command(self.cmd_save_config) # Return the commands of the configuration saving process return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_config(self):\n\n return self.perform_action('/mgmtd/db/save')", "def save(self) -> None:\n self._client.save_config()", "def save(self):\n self.__config.sync()\n self.__saved = True\n Logger().debug(\"Configuration saved\")", "def save_conf(self):\r\n self.send...
[ "0.7332388", "0.72265893", "0.7137987", "0.71189207", "0.7021712", "0.68343556", "0.6804866", "0.67873", "0.6754396", "0.6717968", "0.6716818", "0.66642374", "0.6657789", "0.662719", "0.66018707", "0.6575331", "0.65352595", "0.6533009", "0.6532575", "0.64830875", "0.6463163",...
0.76475644
0
run inference on whichever split the dataset is configured for returns a abstract_model.Prediction
def inference(self, dataset, model_dir): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inference(model, data, diagnostics, seed, extra_fitting_args):\n pass", "def infer(self, x, batch_size=None, **kwargs):\n if not batch_size:\n batch_size = self.batch_size\n return self.model.predict(x, batch_size, **kwargs)", "def infer(\n context: mlrun.MLClientCtx,\n mo...
[ "0.6595152", "0.6443458", "0.6350694", "0.6340242", "0.6296832", "0.6251606", "0.6172427", "0.60846233", "0.60603577", "0.6050985", "0.60499847", "0.60397583", "0.6016193", "0.6011826", "0.599841", "0.5987126", "0.5981331", "0.5967991", "0.5966445", "0.595829", "0.5941489", ...
0.6992052
0
Receives the output from 'cat /proc/cpuinfo' and check whether the firmware mode is OPAL or not
def check_fw_mode(self, cat_cpuinfo_out): for line in cat_cpuinfo_out.splitlines(): if "firmware" in line: if "OPAL" in line: return True else: return False return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cpuinfo() -> str:\n\n # Read /proc/cpuinfo\n try:\n with open('/proc/cpuinfo', 'r') as f:\n return f.read()\n except IOError:\n print('Error: Could not read /proc/cpuinfo', file = sys.stderr)\n return ''", "def cpuinfo(self):\n \n command = 'cat /proc/cp...
[ "0.653249", "0.64531535", "0.6348536", "0.62766695", "0.6248632", "0.6234091", "0.6179356", "0.61357576", "0.6102103", "0.6079106", "0.6035243", "0.59854263", "0.59492624", "0.5924493", "0.59198684", "0.5893244", "0.5888943", "0.5877543", "0.57761073", "0.5752693", "0.5746997...
0.8109044
0
Receives the output from 'lsblk' and get the block size for the specified device
def get_block_size(self, cmd_lsblk_out, dev): for line in cmd_lsblk_out.splitlines(): if dev in line: return line.split()[3] return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dev_size(device):\n device_path = \"/sys/block/\"\n num_sectors = open(device_path + device + \"/size\").read().rstrip(\"\\n\")\n sector_size = (\n open(device_path + device + \"/queue/hw_sector_size\")\n .read()\n .rstrip(\"\\n\")\n )\n return int(num_sectors) * int(sector_...
[ "0.75401616", "0.7448681", "0.73527104", "0.68306696", "0.67756987", "0.6714592", "0.6620035", "0.65658784", "0.646005", "0.6285618", "0.62480074", "0.6175134", "0.61039436", "0.6097898", "0.6018018", "0.60090727", "0.59573275", "0.59319687", "0.5876907", "0.58186257", "0.577...
0.8631295
0
Deploy DC Use Marvin to deploy DC
def deploy_dc(self): print("==> Deploying Data Center") # TODO: Replace Marvin mrv = marvin.marvinInit.MarvinInit(self.marvin_config) mrv.init() dc = marvin.deployDataCenter.DeployDataCenters(mrv.getTestClient(), mrv.getParsedConfig()) dc.deploy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deploy():", "def deploy(parameters):\n\n print(\"In deploy module\")", "def deploy():\n build()\n copy()\n install()", "def deploy(ctx):\n click.echo('deploying')\n ctx.deploy()\n click.echo('done')", "def deploy(ctx, domain, dns_option,docker):\n global DOMAIN, USR, CUR_LOC\n ...
[ "0.7563384", "0.66243845", "0.66218656", "0.6548808", "0.6516198", "0.64844817", "0.63782686", "0.63782686", "0.63782686", "0.63312036", "0.63118327", "0.6291901", "0.6211025", "0.6170121", "0.61693263", "0.61499286", "0.6110767", "0.60980916", "0.6080806", "0.6079457", "0.60...
0.8054334
0
Deploy jacoco agent on management server
def configure_tomcat_to_load_jacoco_agent(self): open("/tmp/jacoco.conf", "w").write('JAVA_OPTS="$JAVA_OPTS -javaagent:/tmp/jacoco-agent.jar=destfile=/tmp/jacoco-it.exec"\n') zone = self.config['zones'][0]['name'] for host in self.config['mgtSvr']: connection = {'hostname': host['mgt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure_agent_to_load_jacoco_agent(self):\n zones = parse('zones[*]').find(self.config)\n for zone in zones:\n hosts = parse('pods[*].clusters[*].hosts[*]').find(zone)\n for host in hosts:\n hostname = host.value['url'].split('/')[-1]\n connec...
[ "0.6687652", "0.58956325", "0.5658336", "0.5536683", "0.54856473", "0.5430668", "0.53778017", "0.5344176", "0.53296447", "0.5308048", "0.5297293", "0.527913", "0.5276749", "0.52552104", "0.52517176", "0.52438635", "0.5234616", "0.52330315", "0.5219679", "0.5213746", "0.520040...
0.6499574
1
Deploy jacoco agent on hypervisor
def configure_agent_to_load_jacoco_agent(self): zones = parse('zones[*]').find(self.config) for zone in zones: hosts = parse('pods[*].clusters[*].hosts[*]').find(zone) for host in hosts: hostname = host.value['url'].split('/')[-1] connection = {'ho...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure_tomcat_to_load_jacoco_agent(self):\n open(\"/tmp/jacoco.conf\", \"w\").write('JAVA_OPTS=\"$JAVA_OPTS -javaagent:/tmp/jacoco-agent.jar=destfile=/tmp/jacoco-it.exec\"\\n')\n zone = self.config['zones'][0]['name']\n for host in self.config['mgtSvr']:\n connection = {'host...
[ "0.5958009", "0.5419343", "0.53304183", "0.53301394", "0.5307355", "0.5241856", "0.5180277", "0.51431865", "0.51008135", "0.50706553", "0.5050302", "0.50470775", "0.5041364", "0.5033448", "0.5022625", "0.5010671", "0.49934483", "0.4973317", "0.49592254", "0.48933506", "0.4878...
0.65860814
0
Tell if this function block can be merged with given block.
def isMergableWith(self, op): if not is_glsl_block_function(op): return False if (self.getName() != op.getName()) or (self.getType() != op.getType()): return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mergeCalibBlocks_isMergeable(object1: Any, object2: Any) -> bool:\n if isinstance(object1, list):\n if not isinstance(object2, list):\n return False\n if len(object1) != len(object2):\n return False\n return all(\n _mergeCalibBlocks_isMergeable(elem1, e...
[ "0.63110495", "0.6108312", "0.60609686", "0.59626573", "0.5949892", "0.57662606", "0.5698041", "0.5686426", "0.56685954", "0.5537274", "0.5534217", "0.5523719", "0.5504129", "0.5503347", "0.5502958", "0.5502958", "0.54702574", "0.5416902", "0.5404233", "0.5403915", "0.5384805...
0.68565464
0
Tell if given object is a GLSL function block.
def is_glsl_block_function(op): return isinstance(op, GlslBlockFunction)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_glsl_block_unary(op):\n return isinstance(op, GlslBlockUnary)", "def isfunction(object):\r\n return isinstance(object, types.FunctionType)", "def isMergableWith(self, op):\n if not is_glsl_block_function(op):\n return False\n if (self.getName() != op.getName()) or (self.ge...
[ "0.67513657", "0.59952664", "0.5961789", "0.59614486", "0.5907833", "0.5751456", "0.5690445", "0.5633681", "0.55431646", "0.5473873", "0.5450224", "0.5416937", "0.5388759", "0.53774047", "0.5372913", "0.5360642", "0.5355582", "0.53300965", "0.5309282", "0.52596307", "0.525055...
0.8320793
0
try to load a given matrix for the recommender, if the matrix is not present in the folder raw data then will fit the recommender and save the matrix
def fit_or_load(r, matrix='r-hat'): matrix_type = 'test' if args.test else 'valid' filename = 'raw_data/{}-{}-{}'.format(r.NAME, matrix, matrix_type) if args.loadrhat: try: if matrix == 'r-hat': try: r.load_r_hat(filename + '.npy') except: r.load_r_hat(fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_movielens1m(path):\n if not os.path.isfile(path):\n data_dir = os.path.dirname(path)\n if not os.path.exists(os.path.dirname(path)):\n os.makedirs(data_dir)\n download_dataset(\n 'http://files.grouplens.org/datasets/movielens/ml-1m.zip', path)\n\n zp = zipf...
[ "0.5919209", "0.5891908", "0.5786387", "0.5735989", "0.56494796", "0.55816305", "0.55705184", "0.55697584", "0.5537924", "0.55166525", "0.550462", "0.549243", "0.54678375", "0.5440117", "0.5409371", "0.5359311", "0.53490996", "0.5330973", "0.53226453", "0.53222203", "0.530719...
0.66652924
0
Exports the json to a topic
def exportJson(frameJson, topic): Producer.push_json(topic, frameJson) # Push frame json to specified Kafka topic
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_topics(self):\n\n # format as a list (for json output), then sort descending by textIDCount\n topics = [{'name': topic['name'], 'count': topic['count'],\n 'verbatims': list(topic['verbatims']), 'textIDs': list(topic['textIDs']),\n 'textIDCount': topic['t...
[ "0.624346", "0.6106344", "0.59583545", "0.5850721", "0.5815099", "0.5760816", "0.5752739", "0.5634054", "0.5580142", "0.5551787", "0.55478", "0.54747444", "0.54336447", "0.5418746", "0.5368339", "0.5368339", "0.53301656", "0.53261614", "0.53181714", "0.5234997", "0.52293056",...
0.6844464
0
Smooth the input with scipy ndimage utility
def scipy_smooth(img, sigma=5): return ndimage.gaussian_filter(img, sigma=sigma)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def smooth(image):\n image = convolve(image, gaussian2d(), mode='same')\n return image", "def smooth(img, sigma):\n if sigma < 0:\n raise ValueError('smoothing kernel size is negative')\n elif sigma == 0:\n return img.get_data()\n else:\n sigma_vox = sigma / np.sqrt(np.sum(img...
[ "0.67483276", "0.64349693", "0.63932604", "0.6315227", "0.63144046", "0.63144046", "0.63002956", "0.6236718", "0.62352455", "0.6228975", "0.6141046", "0.6107013", "0.6004542", "0.59422785", "0.59033334", "0.5902689", "0.5875541", "0.5867725", "0.58664036", "0.5855482", "0.584...
0.6796318
0
Build match and apply functions based on given re pattern, search text, and replacement.
def build_match_and_apply_functions(pattern, search, replace): def matches_rule(word): """ Check if word contains pattern. """ return re.search(pattern, word) def apply_rule(word): """ Replace text with replacement in word. """ return re.sub(search, replace, wor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replacement(cls, search_pattern: str, replacement: str) -> PhonTransform:\n sub_func = lambda match: replacement\n return cls(search_pattern, sub_func)", "def replace(text,pattern,replace=\"\"):\n\n thisFunc = inspect.currentframe().f_code.co_name\n result = re.sub(pattern,replace,text)\n...
[ "0.6281005", "0.6170175", "0.6152878", "0.60856426", "0.6070244", "0.6042096", "0.59294266", "0.5895885", "0.58218765", "0.5811305", "0.57750964", "0.57548594", "0.5627089", "0.5623821", "0.56165636", "0.56151664", "0.55997384", "0.5596581", "0.5536634", "0.5532054", "0.55070...
0.8427449
0
Check if word contains pattern.
def matches_rule(word): return re.search(pattern, word)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def word_and_pattern (word,pattern):\r\n for i in range(len(pattern)):\r\n if pattern[i]!= '_' and pattern.count(pattern[i]) != word.count(pattern[i]):\r\n return False\r\n return True", "def check_word(word, string):\n regexStr = re.search(r'(\\b%s\\b)' % word, string)\n if regexSt...
[ "0.79796785", "0.76024896", "0.75414854", "0.7531686", "0.74855614", "0.73434854", "0.7276298", "0.72157294", "0.7138306", "0.71050256", "0.6995027", "0.69426376", "0.68976486", "0.68742484", "0.6856031", "0.6819508", "0.6759039", "0.67256963", "0.6707417", "0.67046005", "0.6...
0.7932989
1
Process a list of folders from a user or collection.
def _process_folders(self, folders, parentId, parentType): current_folders = {f['name']: f for f in self.get('folder', {'parentType': parentType, 'parentId': parentId})} # Add, update or noop listed folders for folder in f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_folder_structure(_user):\n flds = _user.folders\n logging.info(f\"\\nYou have ** {str(len(_user.folders))} ** \"\n f\"folders in your ArcGIS Organization\\n\")\n # listing documents in the user root folder\n root_folder_items = _user.items()\n _n = 0\n logging.info(f\"T...
[ "0.64337933", "0.6331913", "0.61397517", "0.6013888", "0.5952171", "0.59202784", "0.5713054", "0.56344044", "0.5633549", "0.5627562", "0.5614009", "0.55808413", "0.5538068", "0.5524587", "0.5513322", "0.5504454", "0.54962325", "0.5454462", "0.54505265", "0.5440449", "0.541199...
0.6362374
1