query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Converts an image into a networks input.
def get_detect_image_blob(self, im): im_orig = im.astype(np.float32, copy=True) im_orig -= cfg.SIAMSE.PIXEL_MEANS im_shape = im_orig.shape im_size_min = np.min(im_shape[0:2]) im_size_max = np.max(im_shape[0:2]) processed_ims = [] im_scale_factors = [] f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def imagenet_preprocess(image, label):\n i = image\n i = tf.cast(i, tf.float32)\n i = tf.image.resize_with_crop_or_pad(i, 224, 224)\n if model_name == 'ResNet50' or model_name == 'ResNet152':\n i = tf.keras.applications.resnet.preprocess_input(i)\n else:\n i...
[ "0.63952285", "0.63228744", "0.63136196", "0.62095743", "0.62074095", "0.61970663", "0.6180743", "0.6180006", "0.6155081", "0.6112606", "0.6109308", "0.6098736", "0.604532", "0.603232", "0.6016995", "0.6010818", "0.6000536", "0.59828776", "0.59793276", "0.5928676", "0.5842607...
0.0
-1
Convert a list of images into a networks input. Assumes images are already prepared (means subtracted, BGR order, ...).
def im_list_to_blob(self, ims): max_shape = np.array([im.shape for im in ims]).max(axis=0) num_images = len(ims) blob = np.zeros((num_images, max_shape[0], max_shape[1], 3), dtype=np.float32) for i in range(num_images): im = ims[i] blob[i, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def class_imgs(list_img):\n numberimg = len(list_img)\n resize(net, numberimg, cursize)\n i = 0\n for img in list_img:\n image = caffe.io.load_image(img)\n transformed_image = transformer.preprocess('data', image)\n net.blobs['data'].data[i] = transformed_image\n i = i + 1\n...
[ "0.6794266", "0.65664166", "0.6506291", "0.6428332", "0.64100635", "0.6392384", "0.6322385", "0.63118637", "0.62800974", "0.6256072", "0.6243301", "0.6233787", "0.62281585", "0.6213896", "0.61919415", "0.6191805", "0.61836946", "0.61509347", "0.6144131", "0.6138562", "0.61356...
0.0
-1
Generates a csv file with the resulting assignment while it updates the status of the process using Celery
def calculate_result(self, reviewer_data, article_data, people_data, coi_data, min_rev_art, max_rev_art, min_art_rev, max_art_rev): cur_progress = 0 max_progress = 100 article_data = pd.DataFrame(article_data) people_data = pd.DataFrame...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_to(short_name):\r\n (app, owner, n_tasks, n_task_runs,\r\n overall_progress, last_activity) = app_by_shortname(short_name)\r\n title = app_title(app, gettext(\"Export\"))\r\n loading_text = gettext(\"Exporting data..., this may take a while\")\r\n\r\n try:\r\n require.app.read(app...
[ "0.6271365", "0.606226", "0.6017278", "0.5945065", "0.5934954", "0.58989936", "0.5891281", "0.5823478", "0.581835", "0.58153915", "0.5762086", "0.5739158", "0.5739158", "0.5732645", "0.57053995", "0.5689611", "0.56734747", "0.5639372", "0.56097394", "0.56026286", "0.5598239",...
0.0
-1
Test case for delete_opening_balance_journals_key
def test_delete_opening_balance_journals_key(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_opening_balance_journals_key(self):\n pass", "def test_get_opening_balance_journals(self):\n pass", "def test_post_opening_balance_journals(self):\n pass", "def test_client_risk_assessment_delete(self):\n pass", "def test_deleteItinerary(self):\n event = dict...
[ "0.7443269", "0.6647047", "0.6586451", "0.6173807", "0.59971863", "0.5906599", "0.5883001", "0.58747035", "0.58452064", "0.5810683", "0.5803397", "0.5792871", "0.57869107", "0.57812667", "0.5751271", "0.5725391", "0.5719262", "0.57173496", "0.56513774", "0.5649916", "0.564739...
0.954454
0
Test case for get_opening_balance_journals
def test_get_opening_balance_journals(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_opening_balance_journals_key(self):\n pass", "def test_post_opening_balance_journals(self):\n pass", "def test_delete_opening_balance_journals_key(self):\n pass", "def test_open_ru_ballance(self, ):\n if self.report_type == 'open.ru':\n (mid, aid) = self.ma...
[ "0.7997928", "0.7800163", "0.6249587", "0.5947075", "0.5603603", "0.5390032", "0.53497434", "0.5313137", "0.52879274", "0.52468204", "0.52310777", "0.5218465", "0.5213669", "0.5169804", "0.5147557", "0.5146794", "0.5145016", "0.5138725", "0.51375633", "0.50891036", "0.5077854...
0.93086916
0
Test case for get_opening_balance_journals_key
def test_get_opening_balance_journals_key(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_opening_balance_journals(self):\n pass", "def test_delete_opening_balance_journals_key(self):\n pass", "def test_post_opening_balance_journals(self):\n pass", "def test_journals_paged_fields(self, api_client):\n rv = api_client.get(\"/journals-paged\")\n json_d...
[ "0.814138", "0.7337289", "0.66358453", "0.5097487", "0.5004364", "0.49763408", "0.49549302", "0.49017188", "0.48923275", "0.48898348", "0.48454645", "0.4810751", "0.47996962", "0.47848547", "0.47577968", "0.4739", "0.47346452", "0.47301468", "0.4718948", "0.471765", "0.470826...
0.9500056
0
Test case for post_opening_balance_journals
def test_post_opening_balance_journals(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_opening_balance_journals(self):\n pass", "def test_get_opening_balance_journals_key(self):\n pass", "def test_delete_opening_balance_journals_key(self):\n pass", "def test_finalize_and_open_period(self):\n employee_payments_qty = EmployeePayment.objects.filter(employe...
[ "0.84121585", "0.69012296", "0.649312", "0.6370543", "0.5991055", "0.5923325", "0.5892853", "0.5802448", "0.5717177", "0.56970596", "0.5671049", "0.56420887", "0.5641799", "0.56363505", "0.5616931", "0.56020135", "0.5594999", "0.55920017", "0.55864936", "0.5533124", "0.551042...
0.9369089
0
Go to the page 'url', find the next link to got, then extract the JSON query result, find the wanted train, and display the results.
def main(url, MY_OUTWARD_TIME_MINI, MY_OUTWARD_TIME_MAXI="23:59"): MY_OUTWARD_TIME_MINI = MY_OUTWARD_TIME_MINI.replace("h", ":") MY_OUTWARD_TIME_MAXI = MY_OUTWARD_TIME_MAXI.replace("h", ":") # Create the web browser object b = RB(history=True, allow_redirects=True) # Open the page b.open(url) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_details_json(self, url):\n response = self.get_response(url)\n if response:\n html_soup = BeautifulSoup(response.text, 'html.parser')\n listings_json = html_soup.find('script', id='__NEXT_DATA__')\n if listings_json:\n listings_json = str(listi...
[ "0.640374", "0.6311036", "0.6293636", "0.62394124", "0.61887467", "0.6168092", "0.6126903", "0.60940063", "0.60837823", "0.6080943", "0.60407084", "0.60225344", "0.60035765", "0.5994992", "0.5961852", "0.5961246", "0.59560084", "0.5912258", "0.59046686", "0.5901058", "0.58722...
0.7052188
0
generate the hashes for the passwords
def gen_hash(self, data): password_gen = crypt.encrypt(data) return password_gen
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_password(args):\n for password in args:\n heashed=hash_password(password)\n print(heashed)\n # checked=check_password(heashed)", "def generate_hash(password, salt):\n # encode the password/salt in utf-8\n bytes_string = password.encode(encoding='utf-8')\n salt = salt.enco...
[ "0.69298804", "0.68461454", "0.6780465", "0.67700803", "0.6745123", "0.6678128", "0.66269416", "0.6591104", "0.65296036", "0.6519999", "0.65092117", "0.65037704", "0.6464029", "0.646137", "0.6457473", "0.6453947", "0.64536256", "0.64312357", "0.64078385", "0.63722223", "0.636...
0.6938553
0
Given two dicts, merge them into a new dict as a shallow copy.
def merge_two_dicts(self, x, y): z = x.copy() z.update(y) return z
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mergedict(x, y):\n z = x.copy()\n z.update(y)\n return z", "def merge_dicts(dict_a, dict_b):\n dict_c = dict_a.copy()\n dict_c.update(dict_b)\n return dict_c", "def merge_two_dicts(x, y):\n\tz = x.copy()\n\tz.update(y)\n\treturn z", "def merge_two_dicts(x, y):\r\...
[ "0.8501846", "0.84466875", "0.84402865", "0.84311867", "0.8383174", "0.8383174", "0.8383174", "0.8383174", "0.8383174", "0.8383174", "0.8383174", "0.8383174", "0.83499664", "0.83499664", "0.83499664", "0.82086074", "0.81884646", "0.81880224", "0.81880224", "0.8082591", "0.799...
0.8428829
4
Check a valid alpha space, and Update the space of project layers
def _update_layer_input_spaces(self): layers = self.layers context, state = self.input_space.components layers[0].set_input_space(context) for i in range(1, len(layers)): layers[i].set_input_space(layers[i-1].get_output_space()) if not layers[-1].get_output_space()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_compute_alphas(self):\n\t\tdetails = self.watcher.analyze(layers=[self.second_layer], pool=False, randomize=False, plot=False, mp_fit=False, pl_package=WW_POWERLAW)\n\t\t#d = self.watcher.get_details(results=results)\n\t\ta = details.alpha.to_numpy()\n\t\tself.assertAlmostEqual(a[0],1.74859, places=3)\n\t...
[ "0.5934487", "0.5925016", "0.59177595", "0.5883185", "0.53154767", "0.5309143", "0.53014594", "0.5276205", "0.524059", "0.5209953", "0.51917106", "0.50878495", "0.5069914", "0.50581545", "0.5009805", "0.4991279", "0.49881154", "0.49847874", "0.49658477", "0.4958915", "0.49475...
0.57453865
4
Compute the Alpha Distribution Do something about
def alpha(self, state, pctx): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optimal_alpha():\n\n # When I checked all of alphas, -0.01 was the best\n alpha = -0.01\n # np.random.choice([-0.06, -0.01, 0.04, 0.1])\n return alpha", "def alpha(self):\n if self._alpha is None:\n df = self.fdist\n alpha_ = -self._powerlaw(df.index, df.freq)\n ...
[ "0.67765987", "0.6742169", "0.6655793", "0.6544725", "0.6529802", "0.6469974", "0.6445292", "0.6410639", "0.6391583", "0.6390676", "0.6371379", "0.6346702", "0.6341216", "0.6341216", "0.6341216", "0.6337032", "0.6275701", "0.62751776", "0.6227204", "0.62154394", "0.62064844",...
0.6381885
10
Actor Network for Policy function Approximation, using a tanh activation for continuous control. We add parameter noise to encourage exploration, and balance it with Layer Normalization.
def network(self): inp = Input((self.env_dim)) # # # x = Dense(256, activation='relu')(inp) # x = GaussianNoise(1.0)(x) # # # x = Flatten()(x) # x = Dense(128, activation='relu')(x) # x = GaussianNoise(1.0)(x) # # # out = Dense(self.act_dim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(\n\t\t\tself, xi_dim, u_dim, noise_dim, n_hidden=[50, 50,],\n\t\t\tact_fct=tf.nn.tanh, noise_scale=1.):\n\n\t\tPolicy.__init__(self, xi_dim, u_dim)\n\n\t\tself._nn = MLP(\n\t\t\tn_input=xi_dim + noise_dim,\n\t\t\tn_output=u_dim,\n\t\t\tn_hidden=n_hidden,\n\t\t\tbatch_size_svi=1,\n\t\t\tact_fct=act_fct...
[ "0.6396525", "0.63267297", "0.63142556", "0.62548804", "0.6153631", "0.6122751", "0.6095379", "0.6042239", "0.6022594", "0.60222757", "0.6021168", "0.60164464", "0.59947276", "0.59813875", "0.5972728", "0.59699893", "0.5963782", "0.5926341", "0.59177935", "0.59131825", "0.588...
0.0
-1
Action prediction (target network)
def target_predict(self, inp): return self.target_model.predict(inp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self, state, action):\n assert np.shape(state) == (self._state_dim,)\n assert np.shape(action) == (self._action_dim,)\n\n ### PROBLEM 1\n ### YOUR CODE HERE\n # raise NotImplementedError\n next_state_pred = self._sess.run(self._next_state_pred,\n ...
[ "0.74663013", "0.7177816", "0.70986164", "0.6922276", "0.69212276", "0.68662626", "0.6827339", "0.6794997", "0.6789111", "0.6774284", "0.6735736", "0.66649896", "0.6650672", "0.66315424", "0.6606041", "0.6605678", "0.65936124", "0.6592807", "0.657133", "0.6562334", "0.6552538...
0.6688052
11
Transfer model weights to target model with a factor of Tau
def transfer_weights(self): W, target_W = self.model.get_weights(), self.target_model.get_weights() for i in range(len(W)): target_W[i] = self.tau * W[i] + (1 - self.tau)* target_W[i] self.target_model.set_weights(target_W)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_target_model(self):\n self.target_model.set_weights(self.model.get_weights())", "def update_target_model(self):\n self.target_model.set_weights(self.model.get_weights())", "def update_target_model(self):\n self.target_model.set_weights(self.model.get_weights())", "def _update_...
[ "0.73884064", "0.73884064", "0.73884064", "0.7025803", "0.6765796", "0.67450416", "0.6741832", "0.67204714", "0.6674984", "0.6514898", "0.65123016", "0.6492347", "0.6492347", "0.6467089", "0.6460493", "0.64421093", "0.64420146", "0.6416018", "0.6381238", "0.6341845", "0.63382...
0.7874975
0
Draws a hex grid, based on the map object, onto this Surface
def draw_grid(self, surface): # put platform to the left (top, left) = get_surface_pos(self.flower_spawn_pos[0]) surface.blit(self.platform, ((top-RADIUS, left-RADIUS), (0, 0))) unit_cell = [(.5 * RADIUS, 0), (1.5 * RADIUS, 0), (2 * RADIUS, SQRT3...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _draw_map(screen):\n my_map = HexMap(80, 80, _hex_size=10)\n my_map.generate_with_random_walk(150, iterations=25)\n for tile in my_map:\n # print(tile)\n color = COLORS[tile.type]\n\n tile_color = _modify_color(color)\n pygame.draw.polygon(screen, tile_color, tile.corners)\...
[ "0.75499904", "0.74049234", "0.7057696", "0.7036038", "0.67157614", "0.6702647", "0.6663625", "0.666057", "0.6598581", "0.65752", "0.6569185", "0.6499745", "0.6489359", "0.64855045", "0.64463276", "0.641363", "0.63803756", "0.63674766", "0.6222767", "0.61868495", "0.6152065",...
0.69068396
4
Output the company CIK listed (applicable only for stocks issues in the SEC, so no exchange name is required)
def get_company_cik(stock_ticker: str): company_cik = sec_finance_functions.get_company_data_by_ticker(stock_ticker).company_cik return company_cik
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def company(self):\n\n x = 0\n my_company = self.data[\"Company Name\"]\n my_account = self.data[\"Account\"]\n result = []\n for i in my_company:\n my_string = i + \" -- \" + my_account[x]\n x += 1\n result.append(my_string)\n\n return res...
[ "0.62574416", "0.6169119", "0.6011516", "0.5925151", "0.56726855", "0.5637131", "0.5628796", "0.56104475", "0.5564428", "0.54830617", "0.5324723", "0.5307937", "0.5264544", "0.52378327", "0.5234159", "0.52317774", "0.51992476", "0.5190561", "0.5165406", "0.5164627", "0.514469...
0.6787039
0
Get the number of fillings of a stock for the given year (or all fillings since the company listing)
def get_last_filling(stock_ticker: str, filling_year: Optional[int] = None): company_cik = sec_finance_functions.get_company_data_by_ticker(stock_ticker).company_cik all_company_fillings = sec_finance_functions.get_all_company_filings_by_cik(company_cik) all_company_fillings_by_year = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def numPostings(years):\n\tcount = []\n\tfor year in years:\n\t\tfilename = \"SmartEnergy\" +str(year) +\".xlsx\"\n\t\tDB = pd.read_excel(filename, sheet_name = 'Filters')\n\t\tcount.append(DB.iloc[10][1])\n\treturn count", "def _bands_competed_last_year():\n lLastYear = datetime.datetime.now().year - 1\n ...
[ "0.60557085", "0.5479599", "0.5406363", "0.53464955", "0.53220004", "0.5278154", "0.517318", "0.51207525", "0.51200336", "0.4972167", "0.49510524", "0.49407512", "0.49316242", "0.49237838", "0.49139115", "0.49106917", "0.49084038", "0.48991558", "0.48983836", "0.48923317", "0...
0.6672505
0
Returns true if there is a new filling for this company.
def is_there_new_filling(stock_ticker: str): return {f"Function is not implemented yet"}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_filled(self):\n return(self.order_master.amount==self.order_master.filled)", "def is_new_financial_charge_created(self):\n current_number_of_records = self.get_number_of_financial_charges_in_the_grid()\n if int(current_number_of_records) > int(self.number_of_financial_charges_before_c...
[ "0.6681442", "0.6435274", "0.61737776", "0.6131102", "0.6128357", "0.6062047", "0.59511334", "0.588346", "0.58620167", "0.57702446", "0.5748563", "0.57421947", "0.5722985", "0.57050693", "0.5675417", "0.5594404", "0.5583435", "0.556458", "0.55533123", "0.555196", "0.5529778",...
0.54475653
25
Call to inform that the any concurrent ripping process is finished.
def rip_finished(self): if self.is_ripping: self.is_ripping.clear()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def syncDone (self) :\r\n self.ongoing_sync_count -= 1", "def _notify_end(self):\n to_scan = len(self._files_to_scan)\n event.notify(ScanProgressEvent(to_scan, to_scan, True))", "def finished(self):", "def finished(self):\n pass", "def finish(self) -> None:", "def finish(self)...
[ "0.6337645", "0.62002885", "0.6101757", "0.60869145", "0.60562354", "0.60562354", "0.6047451", "0.6047451", "0.6047451", "0.6047451", "0.6016429", "0.59790313", "0.59760773", "0.5959373", "0.5959373", "0.5951485", "0.5951485", "0.5918788", "0.59124225", "0.5900939", "0.589903...
0.67650646
0
Helper method for populating data into packet P.
def _read_data_into_packet(self, p): length = p.length * self.disc.audio_format.bytes_per_frame if p.file_pos is None: # Silence, so send on null bytes to player p.data = '\0' * length else: file_pos = p.file_pos * self.disc.audio_format.bytes_per_frame ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fill_data(self, data):\n self._data = data\n\n self._data_length = data[1:3]\n self._frame_id = data[4]\n self._address = XbeeAddress(data[5:9], data[9:13], data[13:15])\n self._at_command = data[15:17]\n self._command_status = data[17]\n try:\n self....
[ "0.68859315", "0.6309926", "0.6203171", "0.59932953", "0.5979013", "0.5979013", "0.59707654", "0.59640336", "0.5962908", "0.59237236", "0.5911169", "0.59105027", "0.58891994", "0.5878796", "0.5788424", "0.5725738", "0.57154256", "0.57137066", "0.5694419", "0.5611748", "0.5601...
0.56601655
19
Iterate over DISC, splitting it into packets starting at TRACK_NUMBER index 1. This call will ensure that no packets cross a track or pregap boundary, and will also obey any edits to the disc. It will not, however, read any samples from disc, just tell the calling code what to read.
def iterate(cls, disc, track_number): assert track_number >= 0 and track_number < len(disc.tracks) track = disc.tracks[track_number] packet_frame_size = ( disc.audio_format.rate / cls.PACKETS_PER_SECOND) # Mock up a packet that ends at the start of index 1, so the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_packets(self, reader: Par2FileReader):\n start_count = len(self)\n pointers = reader.get_pointers()\n # Create RecoverySets if needed\n for set_id, pointer_set in packets.by_set_id(pointers).items():\n print(set_id.hex(), pointer_set)\n if set_id not in s...
[ "0.5243465", "0.50652975", "0.503824", "0.49788526", "0.49385667", "0.48881853", "0.48847038", "0.4879093", "0.48679477", "0.4829947", "0.48023844", "0.4800166", "0.47898296", "0.47791988", "0.47784358", "0.47733098", "0.4772302", "0.4743291", "0.4735822", "0.4723006", "0.469...
0.73285556
0
Initialize the installer's root path.
def __init__(self, specs, resources, properties=None): if not properties: properties = {} self.init_collections() self.properties = properties self.set_paths(specs, resources) self.parse_paths() self.find_resources()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init():\n\n # Run the Installer's `init` function.\n Installer.init()", "def __init__(self, rootPath=None):\n self.rootPath = rootPath or '.'", "def __init__(self, root_path):\r\n self.root_path = root_path\r\n if not os.path.exists(root_path):\r\n os.makedirs(...
[ "0.6967015", "0.6809016", "0.67659163", "0.6641332", "0.6592395", "0.656968", "0.65626764", "0.6486784", "0.63000315", "0.62842697", "0.6153095", "0.6122613", "0.61168647", "0.61159515", "0.60651994", "0.59922624", "0.598174", "0.59735596", "0.594777", "0.59465355", "0.592946...
0.0
-1
Initialize collections to their default values.
def init_collections(self): # Default paths to spec files relative to specs folder. self.specs = { 'BASE': '', 'variables': 'variables.xml', 'conditions': 'conditions.xml', 'dynamicvariables': 'dynamic_variables.xml', 'dynamic_variables': 'dyna...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_defaults(self, defaults):\r\n for (sect, opt, default) in defaults:\r\n self._default(sect, opt, default)", "def set_initial_values(self):\n\n pass", "def initDefaults(self):\n return _libsbml.Compartment_initDefaults(self)", "def initialize_default(self):\n se...
[ "0.64917606", "0.6362083", "0.6237232", "0.6192766", "0.6160568", "0.61294746", "0.6128681", "0.6098633", "0.5996917", "0.5996615", "0.59810257", "0.598072", "0.594288", "0.5935369", "0.5935369", "0.5899538", "0.5893436", "0.58926535", "0.5881706", "0.5862227", "0.58338207", ...
0.59458727
12
Takes base paths to specs and resources.
def set_paths(self, specs, resources): self.install = 'install.xml' self.specs_path = path_format(specs) self.root = path_format(dirname(dirname(self.specs_path)) + '/') self.res_path = path_format(resources) self.resources['BASE'] = self.res_path self.specs['BASE'] = sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_resource_path(self):\n\n # Without arguments\n resources_root_path = os.path.abspath(os.path.join(\n MY_DIRECTORY, '..', '..', 'resources'\n ))\n self.assertEqual(resources_root_path, paths.resource())", "def __init__(self, specs, resources, properties=None):\n ...
[ "0.6165541", "0.6127959", "0.611318", "0.6023412", "0.59037876", "0.576045", "0.575814", "0.5617551", "0.56028676", "0.55873394", "0.5575436", "0.5532464", "0.5520052", "0.54906976", "0.54781777", "0.5471999", "0.54613155", "0.54188824", "0.53953713", "0.539372", "0.5368863",...
0.7049754
0
Extracts paths to available izpack resources and spec files from the installer's install.xml spec.
def parse_paths(self): self.soup = BeautifulSoup(open(self.get_path('install'))) for spec in list(self.specs.keys()): spec_file = self.find_specs_path(spec) if spec_file: # If spec file exists self.specs[spec] = path_format(spec_file) e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_paths(self, specs, resources):\n self.install = 'install.xml'\n self.specs_path = path_format(specs)\n self.root = path_format(dirname(dirname(self.specs_path)) + '/')\n self.res_path = path_format(resources)\n self.resources['BASE'] = self.res_path\n self.specs['B...
[ "0.5985074", "0.5818984", "0.55800974", "0.5558382", "0.5510714", "0.5509265", "0.54902023", "0.5484745", "0.54695016", "0.543011", "0.5405252", "0.53903776", "0.5373021", "0.5365647", "0.5341147", "0.5305645", "0.53018004", "0.52990454", "0.52964294", "0.52779734", "0.527142...
0.6754402
0
Find the path for the spec in the install.xml file.
def find_specs_path(self, spec): element = self.soup.find(spec) if element: child = element.find('xi:include') if child: # if xi:include exists, specs are external. path = self.properties.substitute(child['href']) else: # Internal spec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_paths(self):\n self.soup = BeautifulSoup(open(self.get_path('install')))\n for spec in list(self.specs.keys()):\n spec_file = self.find_specs_path(spec)\n if spec_file:\n # If spec file exists\n self.specs[spec] = path_format(spec_file)\n ...
[ "0.66329956", "0.6390044", "0.6344499", "0.62348706", "0.61632514", "0.6048204", "0.5858314", "0.5840221", "0.580385", "0.5725794", "0.5686409", "0.5641364", "0.56244683", "0.5608649", "0.55820984", "0.5533073", "0.5533073", "0.5516132", "0.5502403", "0.5439248", "0.54391897"...
0.7470482
0
Returns a path to the spec or resources file, or None if there isn't any.
def get_path(self, name): for col in [self.specs, self.resources]: if name in col: return force_absolute(col['BASE'], col[name]) raise MissingFileException(name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_resource(filename: str, path: str | None = None) -> str:\n root = Path(__file__).parent\n full_path = root if path is None else root / Path(path)\n return str(full_path / filename)", "def source_resource_path(self) -> Optional[str]:\n return pulumi.get(self, \"source_resource_path\")", ...
[ "0.68443334", "0.68380535", "0.6713034", "0.66187924", "0.65891606", "0.6541039", "0.6467703", "0.64296913", "0.6378949", "0.63331485", "0.63191414", "0.63191414", "0.63191414", "0.6309162", "0.63026977", "0.6249998", "0.6202229", "0.6180328", "0.6180328", "0.6180328", "0.618...
0.607958
32
Parse the install.xml resources and extract paths to available resource files.
def find_resources(self): path = self.get_path('resources') if not path: rsoup = self.soup else: rsoup = BeautifulSoup(open(path)) self.parse_resources(rsoup)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_resources(self, soup):\n for res in soup.find_all('res'):\n if 'customlangpack' in res['id'].lower():\n self.find_langpack_path(res)\n else:\n rid = remove_xml(res['id'])\n self.resources[rid] = path_format(self.properties.substitu...
[ "0.6525635", "0.6458453", "0.6247702", "0.6149706", "0.5675304", "0.5485798", "0.54253304", "0.5365386", "0.53127724", "0.5307869", "0.5268524", "0.52580196", "0.5257995", "0.524883", "0.51688087", "0.51635474", "0.5150724", "0.5131621", "0.5084626", "0.50781643", "0.50696945...
0.61680824
3
Parse the install.xml (or resources.xml) soup to find all available resources.
def parse_resources(self, soup): for res in soup.find_all('res'): if 'customlangpack' in res['id'].lower(): self.find_langpack_path(res) else: rid = remove_xml(res['id']) self.resources[rid] = path_format(self.properties.substitute(res['src...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_resources(self):\n path = self.get_path('resources')\n\n if not path:\n rsoup = self.soup\n else:\n rsoup = BeautifulSoup(open(path))\n\n self.parse_resources(rsoup)", "def parse_paths(self):\n self.soup = BeautifulSoup(open(self.get_path('install...
[ "0.7189946", "0.59733474", "0.5380635", "0.53306276", "0.52788985", "0.5263637", "0.5235712", "0.5170429", "0.5113374", "0.50949967", "0.5075004", "0.50734943", "0.5058489", "0.5009926", "0.4998898", "0.4996702", "0.4971879", "0.49711636", "0.49570197", "0.49357328", "0.49281...
0.66038096
1
Finds a langpack path from the given xml langpack element
def find_langpack_path(self, langpack): lid = langpack['id'] src = path_format(self.properties.substitute(langpack['src'])) if '.xml_' in lid: self.langpacks[lid[-3:]] = src if not 'default' in self.langpacks: self.langpacks['default'] = src self.reso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_langpack_path(self, lid='default'):\n path = self.langpacks[lid]\n return force_absolute(self.res_path, path)", "def _safe_get_element(path, root):\n elements = path.split('.')\n parent = root\n for element in elements[:-1]:\n parent = getattr(parent, element, None)\n ...
[ "0.60459447", "0.542366", "0.54062265", "0.53140926", "0.5283099", "0.5267232", "0.52111304", "0.52110153", "0.5112656", "0.5109639", "0.50798786", "0.503845", "0.5029484", "0.5024299", "0.50155646", "0.50155646", "0.5005777", "0.49973974", "0.49784917", "0.49735188", "0.4969...
0.71990365
0
Returns the path to the langpack with the given localization id.
def get_langpack_path(self, lid='default'): path = self.langpacks[lid] return force_absolute(self.res_path, path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_langpack_path(self, langpack):\n lid = langpack['id']\n src = path_format(self.properties.substitute(langpack['src']))\n if '.xml_' in lid:\n self.langpacks[lid[-3:]] = src\n\n if not 'default' in self.langpacks:\n self.langpacks['default'] = src\n ...
[ "0.73198885", "0.6105887", "0.5961551", "0.58504504", "0.58083636", "0.5787844", "0.5782545", "0.5768041", "0.55205953", "0.5518579", "0.5518284", "0.54572797", "0.54148406", "0.540771", "0.539632", "0.539049", "0.5386805", "0.5383221", "0.5375136", "0.5335914", "0.53032947",...
0.79494125
0
Removes the .xml from a resource or spec id.
def remove_xml(rid): if '.xml' in rid[-4:]: return rid[:-4] else: return rid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(self): \n self.doRoot(self.removeDir)\n settings.getChanged('mosh.resourceReplacer.applied').remove(self.file)", "def removeID(self, doc):\n if doc is None: doc__o = None\n else: doc__o = doc._o\n ret = libxml2mod.xmlRemoveID(doc__o, self._o)\n return ret", ...
[ "0.6571621", "0.59867907", "0.59495574", "0.5810718", "0.58104086", "0.57775265", "0.5769766", "0.5720916", "0.56980383", "0.5681628", "0.5668962", "0.56642413", "0.5655876", "0.5647954", "0.56197345", "0.5602799", "0.550016", "0.5495898", "0.5472836", "0.5450075", "0.5386508...
0.6564904
1
Ensures that the base path is not appended to an absolute path.
def force_absolute(base, path): if os.path.abspath(path) and os.path.exists(path): return path else: return path_format(base + path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_bad_path(path, base):\r\n return not resolved(joinpath(base, path)).startswith(base)", "def relative_base(base):\n return as_base(base).lstrip('/')", "def _graceful_relative_url(base_url, url):\n if url == base_url:\n return ''\n base_prefix = '%s://%s' % urlparse.urlparse(base_url o...
[ "0.6916786", "0.67421585", "0.66749847", "0.64415956", "0.64331144", "0.6391375", "0.634446", "0.63375163", "0.63358223", "0.63287544", "0.63265294", "0.6256979", "0.6243405", "0.6241263", "0.62288374", "0.61725926", "0.6163012", "0.61393946", "0.61246914", "0.610019", "0.608...
0.8096843
0
Append a child SHETNode object to this parent.
def append_child(self, child): self._children.append(child)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def appendChild(self, child):\n self.__initChild()\n self.__child.append(child)", "def add_child(self, child):\r\n self.children.append(child)", "def add_child(self, child):\n assert isinstance(child, (Node, str))\n self.children.append(child)\n return child", "def a...
[ "0.75263894", "0.71979386", "0.71660924", "0.70930797", "0.7083536", "0.7083536", "0.70750386", "0.70191234", "0.70174617", "0.69852936", "0.6984658", "0.6984658", "0.6984658", "0.6974553", "0.6964133", "0.691352", "0.6870681", "0.68534565", "0.683959", "0.6832848", "0.682881...
0.743963
1
Return the child object for this row.
def child(self, row): return self._children[row]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fm_get_child(self, idx):\n return self._relation_lst[self.CHILD][idx]", "def parent_row(self):\n dict_cur.execute('SELECT * FROM \"{}\" WHERE {} = {}'.format(\n self.parent_table(), self.id_col_of_parent(), self.parent_id\n ))\n return dict_cur.fetchone()", "def child...
[ "0.69378644", "0.6922745", "0.67441875", "0.67046505", "0.64928705", "0.6490793", "0.64874583", "0.636516", "0.6325162", "0.63212925", "0.6312723", "0.62407464", "0.6223152", "0.6199766", "0.61490715", "0.6089433", "0.6058238", "0.6028954", "0.6019511", "0.60055214", "0.60042...
0.7951686
0
Return the parent for this object.
def parent(self): return self._parent
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_parent(self):\n return self.__parent", "def get_parent(self):\n return self.__parent", "def get_parent(self):\n return self._parent", "def get_parent(self):\n return self.parent", "def get_parent(self):\n return self.parent", "def get_parent(self):\n retu...
[ "0.9200622", "0.9200622", "0.9199283", "0.916468", "0.916468", "0.916468", "0.91454464", "0.91169167", "0.91072214", "0.91072214", "0.91072214", "0.91072214", "0.91072214", "0.91072214", "0.91072214", "0.91072214", "0.91072214", "0.91072214", "0.91072214", "0.904735", "0.9025...
0.9021966
21
Return the number of children for this object.
def child_count(self): return len(self._children)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def children_count(self):\n return len(self._children_ids)", "def get_num_children(self):\n return len(self.children)", "def num_children(self):\r\n return len(self.children)", "def n_children(self):\n ch = self.children\n return 0 if not ch else len(ch) + sum([c.n_children...
[ "0.90056854", "0.89945096", "0.8814528", "0.84932816", "0.8328836", "0.820382", "0.81602144", "0.8130981", "0.8113122", "0.8032147", "0.8006279", "0.7992068", "0.7951158", "0.79241395", "0.7880368", "0.7846781", "0.7826892", "0.7825752", "0.7825752", "0.7813822", "0.78123784"...
0.90249795
0
Return the row number of this object in its parents child object list.
def row(self): if self._parent != None: return self._parent._children.index(self) else: return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def position(self):\n # (this to be able to let the model know my 'row')\n if self.parent and self in self.parent.children:\n return self.parent.children.index(self)\n return 0", "def get_row_count(self):\n\t\treturn self.iter_n_children(None)", "def get_parent_index(self):\n ...
[ "0.7749123", "0.7150035", "0.7133484", "0.7002957", "0.6893562", "0.68775827", "0.68358344", "0.68228674", "0.6657135", "0.65858424", "0.6512793", "0.65048885", "0.6504525", "0.6482687", "0.64728826", "0.6462298", "0.6381234", "0.6368826", "0.6327531", "0.63188356", "0.630715...
0.8057412
0
Return either the name of the node or the type of the node. column = 0 Node name column = 1 Node type
def data(self, column): return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_node_type_name(self):\n pass", "def _getNodeType(node): # {{{\n if node.nodeType == node.ELEMENT_NODE : return \"ELEMENT_NODE\"\n elif node.nodeType == node.ATTRIBUTE_NODE : return \"ATTRIBUTE_NODE\"\n elif node.nodeType == node.TEXT_NODE ...
[ "0.74844366", "0.7219065", "0.6962392", "0.6915872", "0.69109935", "0.68993855", "0.68213034", "0.67636293", "0.67303824", "0.6608851", "0.65244263", "0.6468702", "0.64218444", "0.6386568", "0.6383737", "0.631373", "0.6278558", "0.625848", "0.6188647", "0.61741495", "0.604731...
0.0
-1
Return the icon for this node type.
def get_icon(self): return QIcon()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def icon(self):\n if \"icon\" in self._typeconf:\n return self._typeconf[\"icon\"]", "def icon(self) -> str:\n return self._icon", "def icon(self) -> str:\n return self._icon", "def icon(self) -> str:\n return self._icon", "def icon(self) -> str | None:\n retur...
[ "0.85799116", "0.839415", "0.839415", "0.839415", "0.83772486", "0.833063", "0.83136874", "0.83136874", "0.83030766", "0.82950103", "0.82862633", "0.82862633", "0.82862633", "0.82862633", "0.82862633", "0.82862633", "0.82862633", "0.82862633", "0.82862633", "0.82862633", "0.8...
0.72396433
81
List all registered users
def get(self): return get_all_users()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_users():", "def all_users():\n\n users = crud.get_users()\n\n return render_template('all_users.html', users=users)", "def user_list(ctx):\n data = ctx.obj.get_all_users()\n output_json_data(data)", "def list_users(self):\n raise NotImplementedError", "def list_users():\n ...
[ "0.81718403", "0.8096765", "0.80531436", "0.80079234", "0.79894656", "0.79580796", "0.78869665", "0.78769445", "0.7870435", "0.7852773", "0.7852773", "0.7852773", "0.7852773", "0.7852773", "0.7852773", "0.78296953", "0.78264874", "0.77799135", "0.7775502", "0.77415365", "0.77...
0.74711365
43
Creates a new User
def post(self): data = request.json return save_new_user(data=data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_user(self, **kwargs):\n\n user = self.user_model(**self._prepare_create_user_args(**kwargs))\n return self.put(user)", "def create_user():\n record = request.get_json()\n if record is None:\n return {\"Error\": \"No data Supplied.\"}, 400\n\n schema = user_schema.load(rec...
[ "0.8356902", "0.82334316", "0.818709", "0.81866163", "0.81820846", "0.8136355", "0.81212246", "0.8107862", "0.810485", "0.81023943", "0.8095305", "0.8065845", "0.806039", "0.801286", "0.79925007", "0.7991061", "0.7983073", "0.79765683", "0.7966382", "0.79606205", "0.795309", ...
0.0
-1
get a user given its identifier
def get(self, no): user = get_a_user(no) if not user: api.abort(404) else: return user
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user(id):\n pass", "def get_user_from_id(user_id):\n return Users.query.filter_by(id=user_id).first()", "def get_user_by_id(self, id):\n\t\treturn self.users.get(id)", "def get_user_by_id(user_id):\n return User.query.get(user_id)", "def get_user():\n try:\n userId = request....
[ "0.86616516", "0.81289124", "0.7963865", "0.7956894", "0.7897557", "0.78906107", "0.7883696", "0.786984", "0.78655744", "0.78536576", "0.78536576", "0.78536576", "0.78536576", "0.77602255", "0.77237105", "0.77002823", "0.7681181", "0.7670162", "0.7650683", "0.7638847", "0.763...
0.75004166
43
Parse command line arguments
def parseArguments(): parser = argparse.ArgumentParser(description='Tool run benchmarks and query database') parser.add_argument('--version', action="store_true", dest="version", default=False, help="Print version") parser.add_argument("--query", "-q", action="store_true", dest="queryDataBase", default=Fals...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_arguments(args):", "def parse_args():\n parser = argparse.ArgumentParser(\n description=\"Reads datapacket pcds, interpolates quaternions and generates scans from dataset in config file\")\n parser.add_argument(\"--visualization\", \"-v\", action=\"store_true\", help=\"if generated clouds ...
[ "0.84956664", "0.77526116", "0.7492404", "0.74425805", "0.74166906", "0.7415034", "0.7406717", "0.7405937", "0.7394592", "0.739314", "0.7353777", "0.73531276", "0.73295814", "0.7326098", "0.73121136", "0.7297962", "0.72947985", "0.7294619", "0.7293887", "0.7288054", "0.727713...
0.0
-1
Send an API request to the URI and return the response as JSON
def get(self, api): response = requests.get("{}/{}".format(self.NHL_URL, api), params={'format': 'json'}) jresp = response.json() if "error" in jresp: raise RuntimeError(json.dumps(jresp)) return jresp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_call(endpoint, params, headers):\n\n api_response = get(BASE_URL.format(endpoint=endpoint), params=params,\n headers=headers)\n\n api_response.raise_for_status()\n json_resp = api_response.json()\n\n api_response.close()\n return json_resp", "def _api_call(self, **kwa...
[ "0.7422599", "0.7417137", "0.7387633", "0.72940725", "0.72173136", "0.71671855", "0.7158895", "0.7139885", "0.7135085", "0.7044011", "0.6986337", "0.6938263", "0.6930868", "0.6928152", "0.6916814", "0.6900717", "0.6863039", "0.6863039", "0.68534124", "0.6803363", "0.6768796",...
0.0
-1
Returns a count of games for each team between a range of dates. The range of dates is inclusive. The result is a dictionary, where the key is a team ID and the values is the number of games played within the date range.
def games_count(self, start_date, end_date): # noqa if start_date > end_date: raise RuntimeError("End date must be beyond start") cur_date = start_date tot_gc = defaultdict(int) while cur_date <= end_date: teams_playing = self._teams_playing_one_day(cur_date) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect_stats(games: List[BaseGame], date_min = None, date_max = None):\n if not games: games = self.games\n\n under2_5 = len(list(filter(lambda g: g.is_total_under(), games)))\n under3_5 = len(list(filter(lambda g: g.is_total_under(3.5), games)))\n under1_5 = len(list(filter(lambda...
[ "0.66655016", "0.6575532", "0.6239661", "0.60753345", "0.5819676", "0.56853807", "0.56271034", "0.5605924", "0.552719", "0.5430894", "0.5406802", "0.5393699", "0.53550273", "0.5331798", "0.52389354", "0.5208741", "0.5198225", "0.51977944", "0.5194764", "0.51899004", "0.51551"...
0.77764916
0
Returns the full list of all players in the NHL. Each player is returned with their teamID and playerID.
def players(self): if self.players_cache is None: team_df = self.teams() self.players_cache = self.ea.players_endpoint( team_df["id"].tolist()) columns = ["teamId", "playerId", "name", "position"] all_players = [] for team in self.players_cache["t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_players(team_id: int) -> list[Player]:\n\n players = Player.query.filter_by(team_id=team_id).order_by(Player.position.asc()).all()\n\n return players", "async def get_players(self):\r\n if os.environ.get(\"WoW_Token\") is None:\r\n return\r\n else:\r\n async with...
[ "0.73543996", "0.7350862", "0.7326979", "0.7267568", "0.7178544", "0.71210647", "0.7101303", "0.7095917", "0.70638573", "0.70361084", "0.70209825", "0.695598", "0.69269913", "0.68729657", "0.6858013", "0.68501425", "0.6834751", "0.6827907", "0.68150014", "0.68046874", "0.6801...
0.77101475
0
Returns URL to redirect to from the ``next`` param in the request.
def next_url(request): next = request.REQUEST.get("next", "") host = request.get_host() return next if next and is_safe_url(next, host=host) else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_redirect_url(self, *args, **kwargs):\n return get_login_url(self.request, self.request.GET.get('next'))", "def get_redirect_url(request):\n next = request.POST.get('next', request.GET.get('next'))\n if not is_safe_url(url=next, host=request.get_host()):\n next = request.META.get('HTTP...
[ "0.83204603", "0.83197", "0.7689727", "0.7661551", "0.7638349", "0.76374096", "0.7544939", "0.75045264", "0.73248774", "0.7298591", "0.72670794", "0.7144886", "0.68980455", "0.67974", "0.66958416", "0.6675485", "0.66591203", "0.6639384", "0.6530356", "0.6400732", "0.6353697",...
0.82515216
2
Returns a dict of all exporters available in this module.
def exporters(): return dict(_exporters)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_exported_services(self):\n with self.__export_lock:\n return [reg.get_export_reference() for reg in self.__exported_regs]", "def modules(self):\n return self._modules.keys()", "def export(self) -> Dict[str, Any]:\n return {\n \"name\": self.name,\n \"ch...
[ "0.67320096", "0.671589", "0.6693358", "0.65067416", "0.65005225", "0.6418204", "0.6391994", "0.61761796", "0.61683196", "0.6134161", "0.6020214", "0.60188884", "0.60087794", "0.6007217", "0.59965616", "0.5981217", "0.5973341", "0.5953239", "0.59515285", "0.59218055", "0.5913...
0.8974469
0
Returns a dict of all expression writers available in this module.
def ewriters(): return dict(_ewriters)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exporters():\n return dict(_exporters)", "def loggers() -> Dict[str, logging.Logger]:\n return dict(logging.root.manager.loggerDict) # type: ignore", "def _getWriters(reactor):\n if IReactorFDSet.providedBy(reactor):\n return reactor.getWriters()\n elif \"IOCP\" in reactor.__class__.__n...
[ "0.60313106", "0.5901297", "0.5880711", "0.58622074", "0.58196956", "0.5742172", "0.56615275", "0.5657879", "0.5596137", "0.55732113", "0.5545482", "0.5508399", "0.5503588", "0.5474215", "0.5455626", "0.54393846", "0.54258674", "0.5408531", "0.53520226", "0.53115875", "0.5309...
0.5967789
1
Helper method that implements the logic to look up an application.
def get_app(self, reference_app=None): if reference_app is not None: return reference_app if current_app: return current_app if self.app is not None: return self.app raise RuntimeError('CacheDB: Application not registered on db instance and no applicat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_app(app, symbol_by_name=..., imp=...):\n ...", "def get_application(handle):\n\n if handle in applications:\n return applications.get(handle)\n raise KeyError(\"Application with handle '%s' not registered\" % handle)", "def test_get_application(self):\n from supvisors.rpcinterfa...
[ "0.76504076", "0.7343031", "0.7199703", "0.6993979", "0.6919488", "0.6867285", "0.6855719", "0.68179643", "0.6812087", "0.6794836", "0.678283", "0.6750141", "0.67416745", "0.66992825", "0.6693951", "0.66593003", "0.6654224", "0.66125464", "0.66099894", "0.65840536", "0.655603...
0.6288743
35
generates all prime numbers smaller than _n_ using the Sieve of Eratosthenes
def primes(n): sieve = [True]*n for p in range(2, n): if sieve[p]: yield p for i in range(p*p, n, p): sieve[i] = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primes(n):\n\tsieve = [True] * n\n\tyield 2\n\tfor i in xrange(3,int(n**0.5)+1,2):\n\t\tif sieve[i]:\n\t\t\tyield i\n\t\t\tsieve[i*i::2*i] = [False]*((n-i*i-1)/(2*i)+1)\n\tfor i in xrange(i+2,n,2):\n\t\tif sieve[i]: yield i", "def eratosthenes_sieve(n):\r\n\tnumbers = [True for i in range(n + 1)]\r\n\t\r\n\t...
[ "0.84180295", "0.8417532", "0.82622313", "0.82567656", "0.82486343", "0.82486343", "0.8190478", "0.818247", "0.8172363", "0.81599665", "0.81357145", "0.8119539", "0.8106137", "0.8075972", "0.8052299", "0.8046388", "0.80405337", "0.8021724", "0.8011649", "0.8010728", "0.800634...
0.8424956
0
Check if the given sequence is a Fibonacci sequence. Fibonacci sequence is assumed to have length > 2.
def check_fibonacci(data: Sequence[int]) -> bool: if len(data) < 3: return False if data[0] != 0 or data[1] != 1: return False for n in range(2, len(data)): if data[n] != data[n - 1] + data[n - 2]: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_fibonacci(data: Sequence[int]) -> bool:\n def fib_gen(n: int) -> Iterable:\n a, b = 0, 1\n while a <= n:\n yield a\n a, b = b, a + b\n\n last_el = data[-1]\n perfect_fib = list(el for el in fib_gen(last_el))\n\n if len(data) < 3:\n return False\n ...
[ "0.7771214", "0.7764462", "0.7430969", "0.7402631", "0.70261985", "0.68094856", "0.67896724", "0.65808904", "0.6365835", "0.63628143", "0.632067", "0.62956697", "0.6284243", "0.62702245", "0.625835", "0.6245525", "0.61474824", "0.6098934", "0.6074185", "0.60714906", "0.602317...
0.81119895
0
return the first n bits of fractional part of float f
def frac_bin(f, n=32): f -= math.floor(f) # get only the fractional part f *= 2**n # shift left f = int(f) # truncate the rest of the fractional content return f
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mask_i_float(i, n):\n range_n = arange(cast(array(n), int32))\n i_float = cast(array(i), int32)\n mask_i = equal(range_n, i_float)\n mask_i_float = cast(mask_i, float32)\n return mask_i_float", "def fpart(x):\n return x - np.floor(x)", "def fpart(x):\n return x - math.floor(x)"...
[ "0.6895186", "0.6649497", "0.66047823", "0.627372", "0.6265717", "0.61318606", "0.6037289", "0.6027234", "0.60202575", "0.60193044", "0.59969354", "0.5991846", "0.59733486", "0.59640974", "0.5958672", "0.59521466", "0.5927512", "0.5888159", "0.58834416", "0.58711225", "0.5788...
0.7696176
0
Processes options from the command line.
def command_line (args: Iterable [str], program: str = 'toystrip') -> Options: parser = argparse.ArgumentParser (prog=program, description='Strip fragment bodies from a Toy program repository.') parser.add_argument ('-i', '--input', nargs='?', default='repo.yaml', help='the path of the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_options(self):\n\n argv = sys.argv\n\n # process any optlist_ options\n self.valid_opts.check_special_opts(argv)\n\n # process terminal options without the option_list interface\n # (so that errors are not reported)\n\n # if no arguments are given, do default processing\n ...
[ "0.7470507", "0.73331", "0.7307183", "0.7284981", "0.7284207", "0.7283357", "0.727826", "0.7129506", "0.7059957", "0.702482", "0.7008134", "0.6971482", "0.6954829", "0.694842", "0.69375587", "0.69160885", "0.6883534", "0.68250364", "0.6820386", "0.6808777", "0.6788847", "0....
0.0
-1
A helper function for 2D rotations.
def rotate(points, angle): ca = np.cos(angle*pi/180) sa = np.sin(angle*pi/180) R = np.array([[ca, -sa], [sa, ca]]) # positive is CCW R.shape += (1,) # add dim for broadcasting over n points points = points.T points.shape = (1,) + points.shape # 1x2xn points = (R*points).sum(axis=1).T # d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getEllipsYZRotMatrix(a1, a2):\n adir = a2 - a1\n amid = a1 + 0.5 * adir\n kath = np.sqrt((adir[0] * adir[0] + adir[1] * adir[1]) / 4.0)\n octantA2 = octant(a2)\n theta = np.arctan( abs( (adir[2]/2) / kath) )\n #[1, 4, 6, 7 ] => left rotation\n #[2, 3, 5, 8 ] => right rotation\n if oct...
[ "0.67545587", "0.67527825", "0.667054", "0.6549296", "0.6538852", "0.65088505", "0.6380749", "0.6361178", "0.635002", "0.63448316", "0.63114065", "0.629315", "0.6288181", "0.6284019", "0.62703216", "0.6244028", "0.61983275", "0.6178014", "0.61679846", "0.61626464", "0.6139964...
0.0
-1
construct positive tgt sample and negative tgt sample which is a random version of the positive one
def tgt_samples(self, params): def save_json(save_path, file_id, samples): init_logger() for i, sample in enumerate(samples): save_ = os.path.join(save_path, "{:s}_{:d}.json".format(file_id, i)) with open(save_, 'w') as file: json...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sample_neg(self, assign_result, num_expected, **kwargs):\n neg_inds = torch.nonzero(assign_result.gt_inds == 0)\n if neg_inds.numel() != 0:\n neg_inds = neg_inds.squeeze(1)\n if len(neg_inds) <= num_expected:\n repeat_ = num_expected // neg_inds.numel()\n ...
[ "0.6897532", "0.664779", "0.65409416", "0.6332981", "0.63276327", "0.62545764", "0.62370294", "0.62344706", "0.6191355", "0.61533237", "0.61114484", "0.6094475", "0.6094475", "0.6068479", "0.6061773", "0.6030603", "0.6010253", "0.6003246", "0.6001415", "0.5956334", "0.5956334...
0.0
-1
Preprocesses the given bitext by removing empty lines, sentence pairs in incorrect languages, sentences above a the specified length threshold, and sentence pair exceeding the specified length ratio.
def preprocess_bitext(src_path, tgt_path, src_lang, tgt_lang, max_len, max_len_ratio): # Generate output paths src_out_path = '.'.join(src_path.split('.')[:-1]) + '.clean.{:s}'.format(src_lang) tgt_out_path = '.'.join(tgt_path.split('.')[:-1]) + '.clean.{:s}'.format(tgt_lang) # Open aligned corpora ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess(text):\n text = remove_space(text)\n text = clean_special_punctuations(text)\n text = handle_emojis(text)\n text = clean_number(text)\n text = spacing_punctuation(text)\n text = clean_repeat_words(text)\n text = remove_space(text)\n #text = stop(text)# if changing this, then ...
[ "0.5930999", "0.56018895", "0.54720354", "0.54013246", "0.5385498", "0.53538865", "0.5309747", "0.5302773", "0.530155", "0.5279971", "0.5275908", "0.52461535", "0.5241778", "0.523378", "0.5210483", "0.5210375", "0.52024615", "0.51972234", "0.51928794", "0.51886725", "0.518412...
0.6658864
0
Generate QSO templates for DESI Rebins to input wavelength array (or log10 in wvmnx)
def desi_qso_templates(z_wind=0.2, zmnx=(0.4,4.), outfil=None, N_perz=500, boss_pca_fil=None, wvmnx=(3500., 10000.), rebin_wave=None, rstate=None, sdss_pca_fil=None, no_write=False, redshift=None, seed=None, old_read=False, ipad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n std_template_file = os.path.join(os.environ['HOME'], 'prospect/py/prospect/data/std_templates.fits')\n if os.path.isfile(std_template_file):\n print('Error std template file already exists')\n\n #- Templates produced from 1st component of old (pre-Aug 2022) Redrock templates:\n tem...
[ "0.63988525", "0.61624724", "0.6049136", "0.6009026", "0.5754354", "0.5714916", "0.5675985", "0.5639088", "0.5584253", "0.5570435", "0.55066645", "0.5493375", "0.54839", "0.5475753", "0.54349035", "0.53918606", "0.5388889", "0.53888744", "0.537513", "0.5362154", "0.5355699", ...
0.5666829
7
Repackage the coefficients and redshifts into a single FITS file
def repackage_coeff(boss_pca_fil=None, sdss_pca_fil=None, outfil='qso_templates_v2.0.fits'): # PCA values if boss_pca_fil is None: boss_pca_fil = 'BOSS_DR10Lya_PCA_values_nocut.fits.gz' hdu = fits.open(boss_pca_fil) boss_pca_coeff = hdu[1].data if sdss_pca_fil is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_as_fits(self, filename):", "def reassemble(file, save=False):\n # Open the FITS file\n hdulist = fits.open(file, mode='update')\n filename = os.path.basename(file).replace('.fits', '')\n directory = os.path.join(os.path.dirname(file), filename + '_data')\n\n # Large file\n if os.path.i...
[ "0.59937274", "0.58742166", "0.5733586", "0.5678403", "0.5589093", "0.5542352", "0.55127305", "0.547598", "0.53778374", "0.5374953", "0.53529", "0.535201", "0.53475887", "0.5272805", "0.5256761", "0.5191057", "0.5183628", "0.5168582", "0.5159844", "0.5153219", "0.5136804", ...
0.5787115
2
Generate a small set of random templates for testing
def tst_random_set(): final_wave, final_spec, final_z = desi_qso_templates( outfil='test_random_set.fits', N_perz=100, seed=12345)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_multi_template():\n data = []\n data.extend([\"{}_data.json\".format(i) for i in range(50)])\n data.extend([\"{}_log.csv\".format(i) for i in range(50)])\n data.extend([\"filename_{}.py\".format(i) for i in range(50)])\n data.extend([\"stuff_{}.py\".format(i) for i in range(50)])\n temp ...
[ "0.72083974", "0.63701993", "0.6368686", "0.6321199", "0.62644243", "0.6257337", "0.6201381", "0.617634", "0.6142078", "0.6015824", "0.6010889", "0.59950966", "0.5977103", "0.597154", "0.5879443", "0.5858846", "0.5847928", "0.583918", "0.5821612", "0.58189946", "0.58071667", ...
0.6923423
1
initialize restaurant name and cuisine type attributes and sets number served attribute to a default value 0
def __init__(self, restaurant_name, cuisine_type): self.restaurant_name = restaurant_name self.cuisine_type = cuisine_type self.number_served = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, restaurant_name, cuisine_type):\n self.restaurant_name = restaurant_name\n self.cuisine_type = cuisine_type\n self.number_served = 0", "def __init__(self, restaurant_name, cuisine_type):\n self.restaurant_name = restaurant_name\n self.cuisine_ty...
[ "0.8314235", "0.8282508", "0.8282508", "0.82709175", "0.82709175", "0.8264752", "0.8071585", "0.7439493", "0.7387792", "0.7319224", "0.7265492", "0.7265492", "0.7265492", "0.71875435", "0.71698016", "0.71122634", "0.6878828", "0.684674", "0.68462706", "0.6834815", "0.676543",...
0.83117634
2
describes a restaurant by its name and cuisine type
def describe_restaurant(self): print(f"{self.restaurant_name.title()} serves {self.cuisine_type}.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def describe_restaurant(self):\n\t\tprint(\"name of the restaurant is \" + self.restaurant_name)\n\t\tprint(\"cuisine type is \" + self.cuisine_type)", "def describeRestaurant(self):\n print (f\"{self.name} has the best {self.cuisineType}\")", "def describe_restaurant(self):\n\t\tdetails = f\"{self.rest...
[ "0.82693654", "0.82492495", "0.82483953", "0.8167286", "0.8106043", "0.8073259", "0.8036618", "0.78226703", "0.78043205", "0.78036106", "0.752929", "0.7442119", "0.74197125", "0.7419168", "0.74157757", "0.73562765", "0.7146399", "0.70746666", "0.70746666", "0.7027343", "0.702...
0.823461
3
Prints a message that the restaurant is open.
def open_restaurant(self): print(f"The restaurant is open.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_restaurant(self):\n msg = f\"{self.name} is open. Come on in!\"\n print(f\"\\n{msg}\")", "def open_restaurant(self):\n\t\topen = f\"{self.restaurant_name} is now open.\"\n\t\tprint(f\"\\n{open}\")", "def open_restaurant(self):\r\n\t\tprint(self.restaurant_name.title() + \" is open\")", ...
[ "0.84129494", "0.83964026", "0.83871007", "0.8371406", "0.8318077", "0.8231593", "0.8231593", "0.8231593", "0.8207684", "0.8207684", "0.8207684", "0.8207684", "0.81987953", "0.81586903", "0.8079485", "0.80655825", "0.7935586", "0.7746546", "0.7586863", "0.7568593", "0.6807336...
0.8771324
0
Remove duplicates in a 2D list.
def remove_dupl_2d(arr): arr_len = len(arr) idx = 0 unique = set() while idx < arr_len: if tuple(arr[idx]) in unique: del arr[idx] arr_len -= 1 continue unique.add(tuple(arr[idx])) idx += 1 return arr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique_elements_from_2D_list(list_2d):\n return list(set(flatten_2D_list(list_2d)))", "def remove_duplicates(list):\n x = 0\n while x < len(list):\n y = x + 1\n while y < len(list):\n if list[x] == list[y]:\n del list[y]\n else:\n y +...
[ "0.77904236", "0.7317339", "0.7272788", "0.70233446", "0.6959906", "0.6949109", "0.69180614", "0.6898379", "0.6891898", "0.6872626", "0.686393", "0.68368906", "0.6829106", "0.6820149", "0.6818071", "0.6759585", "0.6757643", "0.66838396", "0.66789544", "0.66774946", "0.6656065...
0.75136393
1
Return comparison operators from strings.
def ops(rule): ops_dict = {'>' : operator.gt, '<' : operator.lt, '>=': operator.ge, '<=': operator.le, '=' : operator.eq, '==' : operator.eq} return ops_dict[rule]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str_to_operator(s):\n return {\n # https://docs.python.org/3/library/operator.html#mapping-operators-to-functions\n \"<\": operator.lt,\n \"<=\": operator.le,\n \"==\": operator.eq,\n \"!=\": operator.ne,\n \">=\": operator.ge,\n \">\": operator.gt,\n }[s]...
[ "0.78497833", "0.6872431", "0.6471799", "0.6461164", "0.6423107", "0.6388608", "0.62490875", "0.62442315", "0.621637", "0.6206094", "0.6175508", "0.61468226", "0.613907", "0.6055677", "0.6053246", "0.6050973", "0.59804946", "0.594457", "0.5933758", "0.59236586", "0.5913188", ...
0.6017789
16
Initialise verboseprint() if verbose to a specific nvfunc or print, else to no printing.
def init_verbose_print(verbose=True, vfunc=print, nvfunc=None): global verboseprint if verbose: verboseprint = vfunc else: if not nvfunc: verboseprint = lambda *a, **k: None else: verboseprint = nvfunc return verboseprint
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verbose_print(verbose, print_function=None):\n\n if verbose:\n return print_function or print\n else:\n def vprint(*args, **kwars):\n pass\n return vprint", "def set_verboseprint(func=misc.init_verbose_print(verbose=True, vfunc=print, nvfunc=misc.log)):\n global verbo...
[ "0.7538737", "0.7518328", "0.6643926", "0.66073173", "0.6594862", "0.65729207", "0.65286297", "0.63692355", "0.6299959", "0.629843", "0.6282386", "0.6246638", "0.612347", "0.6121666", "0.6113824", "0.6102391", "0.6084847", "0.598136", "0.59381145", "0.5932641", "0.5875921", ...
0.8172151
0
Create directory dir_path if it does not exist.
def create_dir(dir_path): validate.check_python_ver(ver=3.5) from pathlib import Path Path(dir_path).mkdir(parents=True, exist_ok=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_dir_if_doesnt_exist(dir_path):\n if not os.path.exists(dir_path):\n os.makedirs(dir_path)\n return", "def create_directory(dir_path):\r\n if not os.path.exists(dir_path):\r\n os.makedirs(dir_path, exist_ok=True)", "def create_dir(dir_path):\n if not os.path.exists(d...
[ "0.86574495", "0.84062487", "0.8376306", "0.83313924", "0.8270023", "0.82542133", "0.8220174", "0.81615025", "0.814925", "0.80941194", "0.8093426", "0.8077159", "0.8055836", "0.8017316", "0.8007193", "0.7989146", "0.796331", "0.7937054", "0.790511", "0.78983074", "0.7885585",...
0.7973728
16
returns the sum of the proper divisors of a number n.
def d(n): rt = math.sqrt(n) i = 2 result = 1 while i < rt: if n % i == 0: result += i result += n // i i += 1 # i == rt implies that n is a square number if i == rt and n % i == 0: result += i return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_of_proper_divisors(n):\n\n\tpd = find_divisors(n)\n\n\treturn sum(pd)", "def sum_proper_divisors(n):\r\n return sum(proper_divisors(n))", "def sum_divisors(n):\r\n return sum(proper_divisors(n)) + n", "def d(n):\n divisors = []\n for i in range(1, n):\n if n % i == 0:\n divisors.appen...
[ "0.9230572", "0.9063063", "0.8890579", "0.8401838", "0.8237709", "0.81488013", "0.80824167", "0.7931736", "0.7893", "0.7875711", "0.7867992", "0.78603905", "0.7837132", "0.77953523", "0.7753415", "0.7628213", "0.7583701", "0.75809145", "0.75312734", "0.7483885", "0.74810076",...
0.7149193
39
Returns a list of all abundant numbers less than an upper limit
def getAbundantNumbers(upperLimit): result = [] for i in range(1, upperLimit): if d(i) > i: result.append(i) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solution(limit=28123):\n sum_divs = [1] * (limit + 1)\n\n for i in range(2, int(limit**0.5) + 1):\n sum_divs[i * i] += i\n for k in range(i + 1, limit // i + 1):\n sum_divs[k * i] += k + i\n\n abundants = set()\n res = 0\n\n for n in range(1, limit + 1):\n if sum_...
[ "0.6772986", "0.65578127", "0.6472297", "0.6274483", "0.61667085", "0.6099296", "0.6032808", "0.6027965", "0.5983113", "0.59658635", "0.59558725", "0.5935221", "0.5906062", "0.58387524", "0.5832162", "0.5813864", "0.58016706", "0.579645", "0.57799524", "0.57706046", "0.576062...
0.8741688
0
Returns true iff the number n can be written as the sum of two abundant numbers.
def canBeWritten(n): for a in abundantNumbersList: if a >= n: break if (n - a) in abundantNumbersSet: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_abundant(n):\r\n if sum_proper_divisors(n) > n:\r\n return True\r\n else:\r\n return False", "def isAbundant(n):\n\treturn sumProperDivisors(n, PRIMES) > n", "def is_abundant(num: int) -> bool:\n return sum(divisors(num)) - num > num", "def is_abundant(n: int, print_div: bool = ...
[ "0.7858181", "0.76310307", "0.7264005", "0.7210944", "0.68021965", "0.6637436", "0.6592846", "0.6582656", "0.6508782", "0.64454526", "0.63586575", "0.63261133", "0.6279456", "0.623999", "0.62178534", "0.616031", "0.61566705", "0.61406416", "0.61299574", "0.6128495", "0.611129...
0.7694291
1
Get information on existing groups
def get_all(isamAppliance, check_mode=False, force=False): return isamAppliance.invoke_get("Retrieving groups", "/sysaccount/groups/v1")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_groups_details(self, groups):\n assert isinstance(groups, list)\n # It may be require we request the API by splitting the names list\n # If the list is too long to be handled by the Gerrit server (URI)\n query_args = \"?%s\" % \"&\".join([\"q=%s\" % g for g in groups])\n ...
[ "0.77337617", "0.7699671", "0.7469322", "0.73761415", "0.73761415", "0.7320174", "0.7300221", "0.7300221", "0.72716445", "0.72584856", "0.71400124", "0.7080925", "0.705979", "0.7046742", "0.7038761", "0.7034169", "0.7026396", "0.7013527", "0.69954467", "0.69342196", "0.690011...
0.0
-1
Get information on particular group by id
def get(isamAppliance, id, check_mode=False, force=False): return isamAppliance.invoke_get("Retrieving group", "/sysaccount/groups/{0}/v1".format(id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_group_details(self, group_id):\n url = self.groups_url + \"/\" + group_id\n return requests.get(url, headers=self.headers)", "def test_groups_group_id_get(self):\n pass", "def groups_by_id(request, gid):\r\n group = Group()\r\n filtered_groups = group.query({\"gid\":str(gid)}...
[ "0.7361329", "0.7319719", "0.72981286", "0.72602093", "0.7082582", "0.69680196", "0.6961489", "0.69496065", "0.6938957", "0.69266856", "0.68284786", "0.67854506", "0.675372", "0.6691113", "0.6670034", "0.6615766", "0.6612242", "0.6554502", "0.6540729", "0.64619184", "0.645098...
0.6288713
31
Create a new group
def create(isamAppliance, id, check_mode=False, force=False): if force is True or _check(isamAppliance, id=id) is False: if check_mode is True: return isamAppliance.create_return_object(changed=True) else: return isamAppliance.invoke_post("Creating group", "/sysaccount/groups...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_group(self):\n pass", "def test_create_group(self):\n pass", "def test_create_group(self):\n groupid = 'villains'\n\n # create the group\n resp = self.app.post('/groups', data=json.dumps({'name':groupid}))\n assert resp.status_code == 200\n\n # F...
[ "0.815556", "0.815556", "0.80986136", "0.8067711", "0.8020423", "0.7923718", "0.78320086", "0.77860224", "0.77714515", "0.77649784", "0.7745107", "0.77115846", "0.77047557", "0.76685154", "0.7644153", "0.7617915", "0.7598676", "0.7593983", "0.75932276", "0.7545795", "0.753286...
0.6656752
95
Check if the last created group has the exact same id or id exists
def _check(isamAppliance, id=None): ret_obj = get_all(isamAppliance) if id != None: for groups in ret_obj['data']: if groups['id'] == id: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_uuid(self, obj, groupid):\n if self.get_uuid(obj) == groupid:\n return True", "def check_insert_group_user(self, id_user:int, id_group:int) -> bool:\n try:\n value_list = self.cursor.execute(f\"SELECT * FROM {table_user_group_connect} WHERE id_user={id_user} AND id_g...
[ "0.6570774", "0.6442853", "0.6362174", "0.6342777", "0.63284546", "0.62991196", "0.6206621", "0.6137091", "0.6101102", "0.6100525", "0.60978", "0.60718405", "0.6065793", "0.60605556", "0.60003704", "0.59999543", "0.59341437", "0.5921304", "0.5915208", "0.59089285", "0.5907399...
0.0
-1
Compare the list of groups between two appliances
def compare(isamAppliance1, isamAppliance2): ret_obj1 = get_all(isamAppliance1) ret_obj2 = get_all(isamAppliance2) return ibmsecurity.utilities.tools.json_compare(ret_obj1, ret_obj2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_groups(self):\n group0 = self.test_save('TestGroup0')\n group1 = self.test_save('TestGroup1')\n \n group0.grant('Perm1', object0)\n group0.grant('Perm3', object1)\n group1.grant('Perm2', object1)\n \n self.assert_(group0 in get_groups(object0))\n...
[ "0.64160657", "0.63160855", "0.628175", "0.62237453", "0.61753273", "0.61753273", "0.61045057", "0.60945976", "0.5951745", "0.5942494", "0.5942494", "0.5940178", "0.59220314", "0.5886079", "0.5881222", "0.5855865", "0.58520585", "0.58456254", "0.5836837", "0.58087313", "0.573...
0.6151799
6
Serves starting point for the customer app.
def home(): return render_template('customer.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startapp():", "def startUp(self):\n pass", "def start_deployment(self):\n return", "def start():\r\n\r\n userName = userLogin.login()\r\n runApp(userName)", "def startup(self):\n pass", "def start():\n # Import any local level utilities that may be used\n # be...
[ "0.6639027", "0.6373469", "0.6251696", "0.62194455", "0.62177706", "0.6122557", "0.6084569", "0.6079541", "0.60736877", "0.60678446", "0.60678446", "0.60678446", "0.60678446", "0.60678446", "0.60678446", "0.60678446", "0.60678446", "0.60596323", "0.60596323", "0.6020635", "0....
0.5785409
37
For making a new request for ride.
def ride(): from services import taxi_service customer_id = request.form['customer_id'] res = taxi_service.ride(customer_id) return json_response(res)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_request(self, **kwargs):\n if kwargs['ride_id'] in app.database['Rides']:\n request_ids = [x for x in app.database['Requests']]\n if request_ids:\n request_id = max(request_ids) + 1\n else:\n request_id = 1\n self.new_reque...
[ "0.75216687", "0.65378934", "0.64955944", "0.6391881", "0.6327837", "0.6260179", "0.6085085", "0.6083617", "0.6060242", "0.5994067", "0.5968204", "0.58465064", "0.58400995", "0.5741157", "0.5677039", "0.5617212", "0.55390745", "0.55201983", "0.5494111", "0.5423132", "0.541637...
0.6671646
1
Buy shares of stock
def buy(): # User reached route via GET if request.method == "GET": # Display quote return render_template("buy.html") # User reached route via POST else: buy_symbol = request.form.get("buy_symbol").upper() buy_amount = float(request.form.get("buy_amount")) q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def buy(self, ctx, name, shares: int):\n\t\tplural = 's' if shares != 1 else ''\n\t\tcurrency = await bank.get_currency_name(ctx.guild)\n\t\tif shares < 1:\n\t\t\tawait ctx.send('You cannot buy less than one share.')\n\t\t\treturn\n\t\tname = name.upper()\n\t\ttry:\n\t\t\tstock_data = await self._get_stock_d...
[ "0.75090504", "0.73669976", "0.719782", "0.7076133", "0.702035", "0.70142156", "0.69631433", "0.6943623", "0.6915625", "0.691014", "0.6897359", "0.68731195", "0.6865242", "0.68647367", "0.6850216", "0.6848369", "0.6818854", "0.67891747", "0.6722476", "0.6719868", "0.67188966"...
0.0
-1
Show history of transactions
def history(): user_id = session["user_id"] history_list = db.execute("SELECT symbol, price, amount, timestamp FROM stocks WHERE user_id = :user_id", user_id = user_id) rows = len(history_list) history = [] for row in range(rows-1, -1, -1): history.append([history_list[row]["symbol"], hi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def history():\n transactions = db.execute(\"SELECT Symbol, Shares, Transacted FROM cash WHERE id=:id\", id=session[\"user_id\"])\n return render_template(\"history.html\", transactions=transactions)", "def history():\n\n #Query transactions by user id\n trans = Transactions.query.filter_by(owner=ses...
[ "0.82002884", "0.8140903", "0.8114919", "0.8042388", "0.8033679", "0.80168986", "0.79338187", "0.7822898", "0.77456313", "0.77341163", "0.7718728", "0.7716838", "0.7708978", "0.7628142", "0.7624304", "0.7530955", "0.74965966", "0.7481556", "0.74478734", "0.7423578", "0.738227...
0.7147903
30
Sell shares of stock
def sell(): # User reached route via GET if request.method == "GET": # Display quote return render_template("sell.html") # User reached route via POST else: sell_symbol = request.form.get("sell_symbol").upper() sell_amount = float(request.form.get("sell_amount")) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sell_stock(self, symbol):\n amount_to_sell = self.get_equity(symbol)\n chirp.order_sell_fractional_by_price(symbol, amount_to_sell)\n self.L.add_line('', symbol, 'SOLD', amount_to_sell)", "async def sell(self, ctx, name, shares: int):\n\t\tplural = 's' if shares != 1 else ''\n\t\tif shar...
[ "0.76451164", "0.748746", "0.7260813", "0.71164954", "0.7057435", "0.70490545", "0.70268077", "0.69872165", "0.6972749", "0.6966809", "0.6915586", "0.68977857", "0.68829334", "0.6849716", "0.68191767", "0.68124473", "0.68022114", "0.6801836", "0.67799073", "0.67698354", "0.67...
0.60202867
87
Description of variables used
def main(): """ Initialize Parameters """ src_path_map = '../data/map/wean.dat' src_path_log = '../data/log/robotdata1.log' map_obj = MapReader(src_path_map) occupancy_map = map_obj.get_map() logfile = open(src_path_log, 'r') motion_model = MotionModel() params = { 'z_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def variables_used (self) :\r\n\t\t## These names possibly contain dimension specification!\r\n\t\treturn self.variable_names", "def variables_used (self) :\r\n\t\treturn []", "def variables(self):\n return ()", "def info(self):\n\t\timport inspect\n\t\n\t\tmessage = \"All variables available for star...
[ "0.7597981", "0.7461102", "0.742432", "0.7258713", "0.69928813", "0.6981387", "0.69313735", "0.69255525", "0.69189847", "0.69012296", "0.6899917", "0.6858732", "0.6843246", "0.68283254", "0.67520756", "0.6725148", "0.66848177", "0.66221344", "0.6604822", "0.65710163", "0.6563...
0.0
-1
Test the function 'save_screenshot'
def test_save_screenshot(): surface_flow_file = Path(TEST_RESULTS_FILES_PATH, "surface_flow.vtu") screenshot_file = save_screenshot(surface_flow_file, "Mach") assert screenshot_file.exists() if screenshot_file.exists(): screenshot_file.unlink()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __take_screenshot(web_driver: webdriver, test_name: str):\n root_dir = os.path.dirname(os.path.abspath(__file__)).replace(\"tests\", \"reports\")\n file_name = f\"{str(datetime.datetime.now().timestamp())}_{test_name}.jpg\"\n screenshot_file_path = os.path.join(root_dir, file_name)\n web_driver.sav...
[ "0.7212455", "0.7189058", "0.70866424", "0.7077667", "0.70456177", "0.6968092", "0.69598687", "0.6943727", "0.6886083", "0.6874362", "0.6820328", "0.6815366", "0.68121475", "0.6712085", "0.6625147", "0.6597559", "0.6579359", "0.6511203", "0.65101516", "0.6504467", "0.65036196...
0.81533283
0
get the date as a string only shows month/day [bias] as days want to add on today(could be minus) defaut is zero stands for today
def get_date_str(bias=0): today = datetime.datetime.today() # 獲得今天的日期 date = (today + datetime.timedelta(days=bias)).strftime("%m/%d") # 格式化日期 return ' ' + date[1:] if date[0] == '0' else date # 把0換成空白
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def todaystr():\n today = datetime.datetime.today()\n return f\"{today.year}{today.month:02}{today.day:02}\"", "def getDate():\n current_time = datetime.datetime.now()\n day = current_time.day\n month = current_time.month\n year = current_time.year\n date = \"{dd}-{mm}-{yyyy}\".format(dd=day...
[ "0.77219003", "0.7503358", "0.7500843", "0.7455331", "0.7453163", "0.7407494", "0.73675853", "0.73555744", "0.7328088", "0.7196816", "0.7162487", "0.70597667", "0.7008564", "0.6929033", "0.6923107", "0.6921202", "0.68978816", "0.6877118", "0.6834021", "0.68301964", "0.6810871...
0.8040248
0
Calculates the demand along each edge for a particular routing and flow
def calc_demand(self, routing: np.ndarray, demand: float, commodity_idx: int) -> np.ndarray: commodity = self.commodities[commodity_idx] node_flow = np.zeros(self.num_nodes) node_flow[commodity[0]] = demand split_matrix = np.zeros((self.num_nodes, self.num_nodes), dt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_per_flow_link_utilisation(self, flow: Tuple[int, int],\n demand: float,\n routing: np.ndarray) -> np.ndarray:\n edge_mapping = {edge: i for i, edge in\n enumerate(sorted(self.graph.edges))}\n\n ...
[ "0.7155596", "0.6779073", "0.6652812", "0.6349164", "0.63395905", "0.6288503", "0.62845767", "0.6226773", "0.62261355", "0.61473256", "0.61391884", "0.6069398", "0.6058541", "0.6003596", "0.5980734", "0.5970249", "0.59189695", "0.59046817", "0.58885455", "0.58686656", "0.5754...
0.7746539
0
Returns the maxlinkutilisation for the graph, given the demands and routing. Uses np matrix operations for speed
def calc(self, demands: Demand, routing: Routing) -> np.ndarray: total_utilisation = np.zeros((self.num_nodes, self.num_nodes), dtype=float) for commodity_idx in range(len(self.commodities)): utilisation = self.calc_demand(routing, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_overall_link_utilisation(self, demands: Demand,\n routing: Routing) -> np.ndarray:\n flows = [(i, j) for i in range(self.num_nodes)\n for j in range(self.num_nodes)\n if i != j]\n\n link_utilisation = np.zeros(self.num_edge...
[ "0.6417331", "0.6131723", "0.5959363", "0.5949413", "0.5865138", "0.5848731", "0.56908566", "0.56839055", "0.5609217", "0.55568206", "0.5556245", "0.5482216", "0.54756725", "0.5473974", "0.54683226", "0.54410064", "0.53907794", "0.5382068", "0.5376598", "0.53537947", "0.53520...
0.5892291
4
Returns the optimal minimum of maxlinkutilisation for the graph, given the demands
def opt(self, demands: Demand) -> float: # Create the linear solver with the GLOP backend. solver = pywraplp.Solver('multicommodity_flow_lp', pywraplp.Solver.GLOP_LINEAR_PROGRAMMING) ## VARIABLES # Flow variables, the splitting ratios for each edge ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare_greedy_dist_to_sync_dist(max_demand=8, show_graph=False):\n pass", "def max_flow_min_cut(vertices, start, end):\n\n max_flow = 0 # There is no flow initially\n\n while True:\n bfs(vertices, start)\n\n if not end.bfs_visited:\n # There is no path between start and en...
[ "0.6206008", "0.61956775", "0.61796796", "0.6167126", "0.6034246", "0.58196956", "0.5767577", "0.57007045", "0.5692291", "0.5689462", "0.5678431", "0.56615597", "0.5658582", "0.5644581", "0.5641445", "0.564055", "0.5603883", "0.5592757", "0.5569047", "0.5535338", "0.5527755",...
0.59470457
5
Calculates the link utilisation over a graph for a particular flow and its demand. (NB utilisation in bandwidth, not relative to capacity)
def calc_per_flow_link_utilisation(self, flow: Tuple[int, int], demand: float, routing: np.ndarray) -> np.ndarray: edge_mapping = {edge: i for i, edge in enumerate(sorted(self.graph.edges))} link_utili...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_overall_link_utilisation(self, demands: Demand,\n routing: Routing) -> np.ndarray:\n flows = [(i, j) for i in range(self.num_nodes)\n for j in range(self.num_nodes)\n if i != j]\n\n link_utilisation = np.zeros(self.num_edge...
[ "0.71253026", "0.67660636", "0.66454524", "0.6522981", "0.6514812", "0.647129", "0.6460042", "0.6392503", "0.6243768", "0.62313336", "0.6146924", "0.61348885", "0.6108246", "0.5984085", "0.5855024", "0.58338815", "0.5774301", "0.57635266", "0.5752603", "0.57300353", "0.570590...
0.77368706
0
Calculates the overall utilisation of each link in a network given a routing choice and a set of demands. (NB utilisation in bandwidth, not relative to capacity)
def calc_overall_link_utilisation(self, demands: Demand, routing: Routing) -> np.ndarray: flows = [(i, j) for i in range(self.num_nodes) for j in range(self.num_nodes) if i != j] link_utilisation = np.zeros(self.num_edges) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_slow(self, demands: Demand, routing: Routing) -> float:\n edge_capacities = [e[2]['weight'] for e in\n sorted(self.graph.edges(data=True))]\n link_utilisation = self.calc_overall_link_utilisation(demands, routing)\n # Because utilisation compared to link widt...
[ "0.69715726", "0.6957851", "0.6760472", "0.6361233", "0.6345169", "0.61192685", "0.61020505", "0.6086766", "0.60547054", "0.5906217", "0.5893766", "0.58539325", "0.58028054", "0.56963044", "0.5695608", "0.5679503", "0.56758183", "0.56425416", "0.5628271", "0.5583995", "0.5572...
0.75995314
0
Returns the maxlinkutilisation for the graph, given the demands and routing
def calc_slow(self, demands: Demand, routing: Routing) -> float: edge_capacities = [e[2]['weight'] for e in sorted(self.graph.edges(data=True))] link_utilisation = self.calc_overall_link_utilisation(demands, routing) # Because utilisation compared to link width is what...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_max_flow(graph, start, end):\n try:\n flow_value, _ = nx.maximum_flow(graph.graph, start, end, capacity=\"weight\")\n return flow_value\n except Exception as e:\n print(\"Error in Max flow computation \", e)\n return \"NaN\"", "def get_max_usage(topology, path):\n ma...
[ "0.6513394", "0.644975", "0.62100786", "0.61312515", "0.610921", "0.6011917", "0.60004693", "0.59970826", "0.5994218", "0.5972986", "0.5926666", "0.5894119", "0.5879665", "0.5859379", "0.5828642", "0.5822828", "0.58168876", "0.5812462", "0.5796409", "0.579364", "0.5784096", ...
0.5926042
11
Returns the maxlinkutilisation for the graph, given the demands and routing This method is hopefully much faster (by using LP rather than naive flow pushing).
def calc_lp(self, demands: Demand, routing: Routing) -> float: epsilon = self.epsilon # Create the linear solver with the GLOP backend. solver = pywraplp.Solver('flow_utilisation_lp', pywraplp.Solver.GLOP_LINEAR_PROGRAMMING) ## VARIABLES # Flow ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_max_flow(graph, start, end):\n try:\n flow_value, _ = nx.maximum_flow(graph.graph, start, end, capacity=\"weight\")\n return flow_value\n except Exception as e:\n print(\"Error in Max flow computation \", e)\n return \"NaN\"", "def get_max_usage(topology, path):\n ma...
[ "0.65920657", "0.6395454", "0.6269792", "0.62530327", "0.61595035", "0.60755104", "0.6060538", "0.6029283", "0.5978314", "0.594786", "0.59212416", "0.5899884", "0.5854466", "0.584627", "0.5839982", "0.5837012", "0.58368164", "0.5815957", "0.5805583", "0.57703376", "0.57671905...
0.5938287
10
SET theme accroding to configration theme path in advance
def set_device_theme(dname, theme_type, number=0): # log in theme app like i theme activity_name = theme_config.getValue(dname,'set_theme_pkg') #DEVICE = device.Device(dname) #DEVICE.app_operation(action='LAUNCH', pkg=activity_name) DEVICE = adbtools.AdbTools(dname) #DEVICE.start_application(ac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_theme(self):\r\n template_conf = self._config.template\r\n if isinstance(template_conf, str):\r\n # Either a local path or the name of built-in themes\r\n if os.path.exists(template_conf):\r\n template_conf = {\r\n 'name': os.path.split(template_conf)[-1],\r\n ...
[ "0.7291386", "0.72200936", "0.72200936", "0.7041518", "0.70217", "0.6841499", "0.68290067", "0.67453665", "0.6707492", "0.6679242", "0.65246654", "0.6497607", "0.6458891", "0.6432759", "0.64274865", "0.6375833", "0.63486564", "0.63367087", "0.63211995", "0.63092625", "0.62976...
0.5805374
42
Takes the adjacency matrix, payment matrix (or matrices), relationship matrix and initial state of all vertices to return the increments in each strategy for each vertex
def hr_egn(A, B, R, x0): # A - Adjacency matrix, np.ndarray (N,N) # B - A 2D or 3D matrix with all payoff matrices, np.ndarray (S,S,N) # R - Relationship or preference matrix, np.ndarray (N,N) # x0 - Initial state of our system, np.ndarray (N,S), must be double # Number of players N = A[:, 0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_matrix(self):\n matrix = np.zeros([len(self.states), len(self.states)])\n starting_states = []\n transitions = []\n\n for chords in self.training_data:\n states = []\n is_starting_state = True\n chunks = [chords[x:x+self.order] for x in range(0,\...
[ "0.58972126", "0.5740013", "0.5628643", "0.5628604", "0.56055963", "0.56013095", "0.55628353", "0.55471677", "0.5523483", "0.5455894", "0.5450417", "0.5443276", "0.54323477", "0.5426158", "0.54141635", "0.54007095", "0.53644186", "0.53399026", "0.5322008", "0.5318355", "0.530...
0.0
-1
Takes a time interval, number of steps, adjacency matrix, payment matrix (or matrices), relationship matrix and initial state of all vertices to return the result of the hyperrational evolutionary game played on the given graph in that time interval
def hr_game(t0, tf, n, A, B, R, x0): # t0 - Initial time # tf - Final time # n - Number of steps # A - Adjacency matrix, np.ndarray (N,N) # B - A 2D or 3D matrix with all payoff matrices, np.ndarray (S,S,N) # R - Relationship or preference matrix, np.ndarray (N,N) # x0 - Initial state of o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def params(timeseries_input):\n # Settings for Nelder Mead Algorithm\n global timeseries\n timeseries=timeseries_input\n\n NumIters = 1 # First Iteration\n MaxIters = 1e3 # Maximum number of iterations\n Tolerance = 1e-5 # Tolerance on best and worst function values\n N = 5 # Number of Hes...
[ "0.6062276", "0.6009414", "0.5854938", "0.55636716", "0.5466281", "0.54142034", "0.54097426", "0.53703797", "0.5366806", "0.5362178", "0.53470725", "0.5342757", "0.5329308", "0.52993786", "0.5255946", "0.52543396", "0.5253646", "0.5226769", "0.5217197", "0.5200583", "0.51922"...
0.6342304
0
Constructor for the RestoreObjectState class
def __init__(self, error=None, object_status=None, resource_pool_id=None, restored_object_id=None, source_object_id=None, ): # Initialize members of the class self.error = error self.object_status =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, state):\n self.state = state", "def restore(self, obj):\n return obj", "def __init__(self,\n alternate_restore_base_directory=None,\n continue_on_error=None,\n encryption_enabled=None,\n generate_ssh_keys=None,\n ...
[ "0.6527886", "0.6478938", "0.63768274", "0.63061714", "0.6259334", "0.6208393", "0.6155825", "0.6133407", "0.612051", "0.6097409", "0.5997136", "0.5995691", "0.59769154", "0.5974528", "0.5970553", "0.59491473", "0.59310687", "0.592171", "0.5913257", "0.58927315", "0.58747876"...
0.69528556
0
Creates an instance of this model from a dictionary
def from_dictionary(cls, dictionary): if dictionary is None: return None # Extract variables from the dictionary error = cohesity_management_sdk.models.request_error.RequestError.from_dictionary(dictionary.get('error')) if dictionary.get('error') else None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction...
[ "0.83181584", "0.8168118", "0.8168118", "0.8118749", "0.8089047", "0.79787344", "0.7949278", "0.79231393", "0.7898951", "0.78923255", "0.788838", "0.7882321", "0.7882212", "0.7876749", "0.78585315", "0.7836853", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407",...
0.0
-1
Test login with 2SA.
def test_login_2sa(self): dsm_7 = SynologyDSMMock( VALID_HOST, VALID_PORT, VALID_USER_2SA, VALID_PASSWORD, VALID_HTTPS, VALID_VERIFY_SSL, ) dsm_7.dsm_version = 7 with pytest.raises(SynologyDSMLogin2SARequiredExceptio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_login_2sa_new_session(self):\n dsm_7 = SynologyDSMMock(\n VALID_HOST,\n VALID_PORT,\n VALID_USER_2SA,\n VALID_PASSWORD,\n VALID_HTTPS,\n VALID_VERIFY_SSL,\n device_token=DEVICE_TOKEN,\n )\n dsm_7.dsm_version ...
[ "0.7610409", "0.7500811", "0.74207056", "0.74207056", "0.7279427", "0.72677475", "0.7121446", "0.7109126", "0.707014", "0.70642114", "0.7060475", "0.70395577", "0.70346", "0.69922304", "0.69830513", "0.6942732", "0.6919252", "0.6907737", "0.6880657", "0.6877048", "0.6873271",...
0.80582833
0
Test login with 2SA and a new session with granted device.
def test_login_2sa_new_session(self): dsm_7 = SynologyDSMMock( VALID_HOST, VALID_PORT, VALID_USER_2SA, VALID_PASSWORD, VALID_HTTPS, VALID_VERIFY_SSL, device_token=DEVICE_TOKEN, ) dsm_7.dsm_version = 7 ass...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_login_2sa(self):\n dsm_7 = SynologyDSMMock(\n VALID_HOST,\n VALID_PORT,\n VALID_USER_2SA,\n VALID_PASSWORD,\n VALID_HTTPS,\n VALID_VERIFY_SSL,\n )\n dsm_7.dsm_version = 7\n with pytest.raises(SynologyDSMLogin2SAR...
[ "0.79027075", "0.6791165", "0.6721474", "0.6619786", "0.65200156", "0.649458", "0.64693856", "0.64288", "0.6404014", "0.64035445", "0.63950443", "0.63943654", "0.6369294", "0.6346183", "0.6331206", "0.6299405", "0.6282982", "0.6256549", "0.6255143", "0.6224549", "0.62157404",...
0.82061094
0
Load and return the malicious scripts dataset (classification). Returns
def load_crawl(): module_path = dirname(__file__) with open(join(module_path, 'data', 'train2.csv')) as csv_file: data_file = csv.reader(csv_file) temp = next(data_file) global n_samples n_samples = int(temp[0]) global n_features n_features = int(temp[1]) print "n samples " + str((n_samples)) print "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_original_dataset(data_directory, setname):\n\n Sign = collections.namedtuple(\"Sign\", [\"visibility\", \"type\", \"name\"])\n data_directory = pathlib.Path(data_directory)\n filename = data_directory / setname / \"annotations.txt\"\n with tf.io.gfile.GFile(filename) as f:\n files, annotations = z...
[ "0.5732409", "0.56973225", "0.5590737", "0.549615", "0.54825884", "0.54152006", "0.5368154", "0.5350428", "0.5322323", "0.53070223", "0.5303706", "0.52806413", "0.5271645", "0.5271418", "0.5266955", "0.5249725", "0.5239241", "0.52312857", "0.52145183", "0.52016944", "0.519618...
0.0
-1