query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Decides whether to bet or fold at this point in time
def bet_fold_algorithm(self, current_top_bid, pot_size, community_cards, position, number_of_players, is_first_cycle, total_value): # If pre-flop if len(community_cards) == 0: rank = self.hand.opening_hand_ranking() # Cut-off rank = 0.00 right now ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fold(self):\n self.active = False\n self.hand = None\n self.bet = 0\n return True", "def get_learn_after_each_decision(self):\r\n return 0", "def notFold(self):\n return not self._fold", "def rough_outcome(self) -> float:\n # HUYNH YOU PRICK WHY THE FUCK D...
[ "0.72265923", "0.6000676", "0.5944416", "0.56944317", "0.5582698", "0.5582698", "0.5582698", "0.55106276", "0.5448707", "0.54409707", "0.54199135", "0.5411135", "0.5394675", "0.5384363", "0.53631586", "0.536092", "0.5355963", "0.5352496", "0.5329533", "0.5312051", "0.530132",...
0.61763084
1
Used to look up the record name and type from the specified zone.
def get_record(self, zone): to_return = None try: to_return = zone.loadRecord(self.module.params.get('name'), self.module.params.get('type').upper()) except ResourceException as re: if re.response.code != 404: self.m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_r53_record_by_name ( route53_conn, dns_name, record_type = 'A' ) :\n dns_name = dns_name.lower( )\n zone_info = route53_conn.get_hosted_zone( route_53_hosted_zoneid )\n zone_name = zone_info[ 'GetHostedZoneResponse' ][ 'HostedZone' ][ 'Name' ]\n zone = route53_conn.get_zone( zone_name )\n return ...
[ "0.684966", "0.6636891", "0.6613396", "0.6532525", "0.64089847", "0.6375922", "0.6265335", "0.6205971", "0.61214995", "0.6064319", "0.6040061", "0.60173184", "0.60097045", "0.5822029", "0.5814325", "0.5788017", "0.5685655", "0.56776536", "0.56634295", "0.56493497", "0.5640705...
0.74746597
0
write an NPZ file (Numpy binary files) containing only the preprocessed data needed for running Component Contribution estimations
def save_equilibrator_bin_data(self, npz_file_name): preprocess_dict = {'cids': self.params['cids']} for k, v in self.params.items(): if k.find('preprocess_') != -1: preprocess_dict[k.replace('preprocess_', '')] = v np.savez_compressed(npz_file_name, **preprocess_dict...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(self):\n super().generate()\n records = random.random((self._dimension, self._dimension, self.num_samples))\n record_labels = [0] * self.num_samples\n prev_out_spec =\"\"\n count = 0\n for i in range(0, int(self.num_files)):\n if i % self.comm_size ...
[ "0.66370714", "0.65234995", "0.63456404", "0.6172922", "0.6125077", "0.60102993", "0.59520173", "0.5935673", "0.59053946", "0.58978695", "0.58922994", "0.5873275", "0.58675355", "0.58388406", "0.58206254", "0.5806083", "0.57888585", "0.57863545", "0.57822645", "0.5781454", "0...
0.70493346
0
Returns the chemical formation energy of the major MS at pH 7. If the compound is part of the training set, returns the value that was calculated during training. Otherwise, we use pure group contribution (if possible) on the groups of the major MS.
def get_major_ms_dG0_f(self, compound_id): if compound_id is None: raise ValueError('given compound ID is None') if self.params is None: self.train() if compound_id in self.cids: i = self.cids.index(compound_id) return self.params['dG0_cc'][i, 0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_energy(self):\n return self.momentum*self.momentum/(2*self.mass)", "def get_hoomd_energy(key, hoomd_force_groups, calc_group):\n\n total_energy = 0\n total_energy = sum([a.get_energy(calc_group) \n for a in hoomd_force_groups[key]])\n return total_energy", "def co...
[ "0.620082", "0.5894757", "0.58618146", "0.5841101", "0.5817328", "0.578734", "0.5772486", "0.57676405", "0.5644884", "0.5638012", "0.56097746", "0.5535166", "0.5525179", "0.5514855", "0.5491314", "0.54726696", "0.5452643", "0.5449478", "0.54388803", "0.54244787", "0.54218894"...
0.591733
1
Test for correct instantiation given a set of players.
def test_init(players, clean): residents, hospitals = players game = HospitalResident(residents, hospitals, clean) for resident, game_resident in zip(residents, game.residents): assert resident.name == game_resident.name assert resident._pref_names == game_resident._pref_names for ho...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_players(self, players):\n\t\tself.players.clear()\n\t\tids = set([p.get_player_id() for p in players])\n\t\tfor p in self.state.get_players():\n\t\t\tif p not in ids:\n\t\t\t\traise PlayerException(p)\n\t\tfor p in players:\n\t\t\tself.players[p.get_player_id()] = p", "def test_valid_game_setup(self):\...
[ "0.68950206", "0.68166816", "0.6779744", "0.6726286", "0.6673796", "0.6636629", "0.65848154", "0.6571941", "0.6493531", "0.64693403", "0.6440882", "0.64096856", "0.6371468", "0.63653827", "0.6354527", "0.6353987", "0.6349084", "0.63259184", "0.6288197", "0.6285662", "0.626197...
0.7017496
0
Test for correct instantiation given a set of dictionaries.
def test_create_from_dictionaries(connections, clean): resident_prefs, hospital_prefs, capacities = connections game = HospitalResident.create_from_dictionaries( resident_prefs, hospital_prefs, capacities, clean ) for resident in game.residents: assert resident._pref_names == resident...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_from_dictionaries(\n student_names, project_names, supervisor_names, capacities, seed, clean\n):\n\n stud_prefs, sup_prefs, proj_sups, proj_caps, sup_caps = make_connections(\n student_names, project_names, supervisor_names, capacities, seed\n )\n\n game = StudentAllocation.creat...
[ "0.64251405", "0.61764544", "0.599205", "0.5967179", "0.5964097", "0.59410644", "0.57628375", "0.5736472", "0.57099533", "0.56787115", "0.56783843", "0.56684375", "0.56655174", "0.5664207", "0.5655415", "0.5654512", "0.5649937", "0.5634078", "0.5615306", "0.55827117", "0.5577...
0.6566189
0
Test each resident has only hospitals in its preference list. If not, check that a warning is caught and the resident's preferences are changed.
def test_check_inputs_resident_prefs_all_hospitals(game): resident = game.residents[0] resident.prefs = [Resident("foo")] with pytest.warns(PreferencesChangedWarning) as record: game._check_inputs_player_prefs_all_in_party("residents", "hospitals") assert len(record) == 1 message = str(r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_inputs_hospital_prefs_all_residents(game):\n\n hospital = game.hospitals[0]\n hospital.prefs = [Resident(\"foo\")]\n\n with pytest.warns(PreferencesChangedWarning) as record:\n game._check_inputs_player_prefs_all_in_party(\"hospitals\", \"residents\")\n\n assert len(record) == 1\n...
[ "0.76461375", "0.7579265", "0.75171703", "0.75103134", "0.7466917", "0.71831375", "0.70516497", "0.7038354", "0.64109606", "0.62843776", "0.6155221", "0.6151795", "0.608665", "0.6074421", "0.59615344", "0.5961042", "0.587259", "0.5870157", "0.5802495", "0.5735709", "0.5553829...
0.7821524
0
Test each hospital has only residents in its preference list. If not, check that a warning is caught and the hospitals's preferences are changed.
def test_check_inputs_hospital_prefs_all_residents(game): hospital = game.hospitals[0] hospital.prefs = [Resident("foo")] with pytest.warns(PreferencesChangedWarning) as record: game._check_inputs_player_prefs_all_in_party("hospitals", "residents") assert len(record) == 1 message = str(r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_hospital_prefs(self):\n\n errors = []\n for hospital in self.hospitals:\n residents_that_ranked = [\n res for res in self.residents if hospital in res.prefs\n ]\n if set(hospital.prefs) != set(residents_that_ranked):\n errors.a...
[ "0.7820969", "0.76278716", "0.75781184", "0.74795306", "0.73008245", "0.70282596", "0.69267523", "0.67586416", "0.6459601", "0.62566453", "0.6184107", "0.6075766", "0.6060278", "0.600085", "0.5896375", "0.5779385", "0.5753072", "0.5702106", "0.56878966", "0.5652447", "0.55289...
0.77083474
1
Test that each resident has a nonempty preference list. If not, check that a warning is caught and the resident has been removed from the game.
def test_check_inputs_resident_prefs_all_nonempty(game): resident = game.residents[0] resident.prefs = [] with pytest.warns(PlayerExcludedWarning) as record: game._check_inputs_player_prefs_nonempty("residents", "hospitals") assert len(record) == 1 assert resident.name in str(record[0].me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_inputs_hospital_prefs_all_reciprocated(game):\n\n hospital = game.hospitals[0]\n resident = hospital.prefs[0]\n resident._forget(hospital)\n\n with pytest.warns(PreferencesChangedWarning) as record:\n game._check_inputs_player_prefs_all_reciprocated(\"hospitals\")\n\n assert le...
[ "0.7198795", "0.71749365", "0.71210027", "0.6954522", "0.6899493", "0.6747819", "0.6641792", "0.6345878", "0.61837107", "0.6050496", "0.5979725", "0.59595793", "0.5754744", "0.57290685", "0.5725816", "0.56024337", "0.5517876", "0.5488233", "0.54230016", "0.5410084", "0.539465...
0.7836128
0
Test that each hospital has a nonempty preference list. If not, check that a warning is caught and the player has been removed from the game.
def test_check_inputs_hospital_prefs_all_nonempty(game): hospital = game.hospitals[0] hospital.prefs = [] with pytest.warns(PlayerExcludedWarning) as record: game._check_inputs_player_prefs_nonempty("hospitals", "residents") assert len(record) == 1 assert hospital.name in str(record[0].me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_inputs_hospital_prefs_all_reciprocated(game):\n\n hospital = game.hospitals[0]\n resident = hospital.prefs[0]\n resident._forget(hospital)\n\n with pytest.warns(PreferencesChangedWarning) as record:\n game._check_inputs_player_prefs_all_reciprocated(\"hospitals\")\n\n assert le...
[ "0.74706024", "0.7364109", "0.7355341", "0.7349609", "0.7254875", "0.6616572", "0.62527543", "0.6152463", "0.61230946", "0.60876256", "0.6085861", "0.6065636", "0.5856437", "0.58475614", "0.58438146", "0.58048016", "0.5630108", "0.56236094", "0.5622575", "0.5621679", "0.56021...
0.81164616
0
Test each hospital has a positive integer capacity. If not, raise an Exception detailing the hospital.
def test_check_inputs_hospital_capacity(game): hospital = game.hospitals[0] capacity = hospital.capacity hospital.capacity = 0 assert hospital._original_capacity == capacity with pytest.warns(PlayerExcludedWarning) as record: game._check_inputs_player_capacity("hospitals", "residents") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_hospital_capacity(self):\n\n errors = []\n for hospital in self.hospitals:\n if len(hospital.matching) > hospital.capacity:\n errors.append(\n ValueError(\n f\"{hospital} is matched to {hospital.matching} which \"\n ...
[ "0.7667984", "0.6397596", "0.62737614", "0.6177663", "0.60829747", "0.6006602", "0.59802", "0.5944431", "0.5858093", "0.58271384", "0.58146626", "0.5800991", "0.57918227", "0.5761161", "0.5714757", "0.5673754", "0.56648004", "0.5643236", "0.56302327", "0.56134015", "0.5581795...
0.73591745
1
Test that no hospitals can be oversubscribed.
def test_check_for_oversubscribed_hospitals(game): hospital = game.hospitals[0] hospital.matching = range(hospital.capacity + 1) issues = game._check_for_oversubscribed_players("hospitals") assert len(issues) == 1 issue = issues[0] assert issue.startswith(hospital.name) assert issue.endsw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_nonsubscriber(self) -> None:\n # Create a stream for which Hamlet is the only subscriber.\n stream_name = \"Saxony\"\n self.common_subscribe_to_streams(self.user_profile, [stream_name])\n other_user = self.example_user(\"othello\")\n\n # Fetch the subscriber list as a no...
[ "0.707774", "0.66021943", "0.6580524", "0.6333144", "0.63258743", "0.62714976", "0.62273604", "0.62074196", "0.6164765", "0.61497414", "0.61130273", "0.6111483", "0.60828555", "0.60759217", "0.607235", "0.6040785", "0.60398805", "0.60398805", "0.6023948", "0.6017094", "0.5979...
0.7428499
0
parses the options for the planning including the targets
def parse_options(site, darkness, date, plan_range): # parse targets opts = {} opts.update(parse_date(date)) opts.update(parse_range(plan_range)) opts.update(parse_site(site)) opts.update(parse_darkness(darkness)) return opts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(self):\n opt = self.gather_options()\n opt.isTrain = self.isTrain # train or test\n\n # process opt.suffix\n if opt.suffix:\n suffix = ('_' + opt.suffix.format(**vars(opt))) if opt.suffix != '' else ''\n opt.name = opt.name + suffix\n\n opt.f_map...
[ "0.62074244", "0.59689", "0.59588844", "0.5875803", "0.5780339", "0.5754228", "0.57520694", "0.5705439", "0.5700765", "0.56824964", "0.5640865", "0.5615099", "0.5609186", "0.5605042", "0.5589972", "0.55796164", "0.5563828", "0.5488467", "0.548542", "0.5478226", "0.54763347", ...
0.67171156
0
parse the range options
def parse_range(option): return {"range": timedelta(days=option)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_range(option, opt_str, value, parser):\n # Preserve the original option string for print output.\n\n parser.values.ensure_value(\"raw_%s\" % option.dest, value)\n\n # Place the max and min into a single entry for each found\n # threshold. This lets a user see all possible ranges passed by\n...
[ "0.68641734", "0.64663", "0.6461454", "0.6431249", "0.64209527", "0.6322825", "0.6321341", "0.6262145", "0.6225956", "0.61157084", "0.60893756", "0.6082446", "0.60010207", "0.5982482", "0.5957853", "0.58720285", "0.58702815", "0.5854096", "0.5840488", "0.5828852", "0.5792684"...
0.7645768
0
Testcase for finding if the PVC creation failed with exit 0
def test_pvc_failure(self, mock_logger, run_to_compl, mock_pvc_create, mock_pvc_delete): self.assertRaises(SystemExit, init_pvc, self.data, self.filer)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_pvc_creation(self, mock_logger, mock_run_to_compl, mock_pvc_create):\n self.assertIsInstance(init_pvc(self.data, self.filer), PVC)", "def test_vmfactory_fail(self):\n self.command.output = \"foo.vmx\"\n with self.assertRaises(VMInitError):\n self.command.package = self.in...
[ "0.64863044", "0.636269", "0.6359872", "0.6171155", "0.61627007", "0.61235106", "0.6072229", "0.60417724", "0.602527", "0.5993727", "0.5867872", "0.585176", "0.5840988", "0.5839947", "0.5835358", "0.57915354", "0.5782399", "0.5769757", "0.57690483", "0.56890714", "0.56839293"...
0.7272803
0
Test that fetched Malware objects are wellformed
def test_index(populate_malware, authenticated_client): names = [malware.name for malware in populate_malware] for name in names: query_json = {'name': name} rv = authenticated_client.post('/api/entities/filter/', data=json.dumps(query_json), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_malware_have_techniques(attck_fixture):\n for malware in attck_fixture.enterprise.malwares:\n if malware.techniques:\n assert getattr(malware,'techniques')", "def test_malware_have_actors(attck_fixture):\n for malware in attck_fixture.enterprise.malwares:\n if malware.acto...
[ "0.6753312", "0.62137586", "0.62131786", "0.6054662", "0.604343", "0.59996074", "0.5981002", "0.5909198", "0.5886412", "0.5814652", "0.57630396", "0.57399", "0.5711823", "0.57050747", "0.5703893", "0.56574583", "0.563821", "0.5593698", "0.55885243", "0.55871683", "0.55865103"...
0.6298893
1
The logger gets initialized with a name (logger by default), which is also part of the name of the logfiles, if persistence is enabled. If rotation_interval (log rotation interval) is set to 0 (default), all output will be written to a single log file. When rotation is enabled,
def __init__(self, name="logger", loglevel=3, persist=True, flush=True, rotation_interval=1, format="text"): self.name = name self.loglevel = loglevel self.persist = persist self.flush = flush self.format = format self.rotation_interval = rot...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_logbook(name, extension='.txt', level=logging.INFO, soloDir = True):\n formatter = logging.Formatter(fmt='%(asctime)s.%(msecs)03d (%(name)s) - %(message)s', datefmt='%d-%m-%y %H:%M:%S')\n date = datetime.today().strftime('%Y-%m-%d')\n if soloDir:\n log_path = str(settings.DATA_DIR + name ...
[ "0.6630192", "0.65736866", "0.65538865", "0.6480561", "0.64405483", "0.64157355", "0.6408364", "0.640588", "0.6376535", "0.63044286", "0.62730765", "0.62329596", "0.62253886", "0.6189911", "0.6173905", "0.61433166", "0.61343294", "0.611963", "0.6104088", "0.61026853", "0.6079...
0.70223504
0
Check if norm layer is in correct train state.
def check_norm_state(modules, train_state): for mod in modules: if isinstance(mod, _BatchNorm): if mod.training != train_state: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_norm_state(modules, train_state):\n for mod in modules:\n if isinstance(mod, _BatchNorm):\n if mod.training != train_state:\n return False\n return True", "def has_emb_layer_norm_before(model_state):\n return any(k.startswith(\"emb_layer_norm_before\") for k, p...
[ "0.793346", "0.67689735", "0.661185", "0.6503076", "0.6476175", "0.6219339", "0.61168087", "0.6102992", "0.60851747", "0.5981991", "0.5981991", "0.5933828", "0.59312683", "0.59198314", "0.590348", "0.5878359", "0.5868085", "0.58631355", "0.58382577", "0.5830594", "0.58257794"...
0.8030396
1
Takes in a movie's ID and returns a list of strings representing the genres pertaining to the movie. Access the movies dataframe to convert the large concatenated string delimited by '|'.
def listGenres(movieId): genres = movies.at[movieId, 'genres'] #change movies to whatever variable name the movies df has genres = genres.split('|') return genres
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_genres(genres):\n\tgenre_list = []\n\tfor genre in genres:\n\t\tgenre_list.append(genre.name)\n\n\treturn \", \".join(genre_list)", "def _get_genre_vector(self, movie_id, list=False):\n if list:\n return self.movies[self.movies['movie_id'] == movie_id][self.genres].iloc[0].tolist()\n ...
[ "0.6485439", "0.6418141", "0.6309844", "0.629249", "0.61343706", "0.61148256", "0.60804826", "0.6047403", "0.6014202", "0.59429395", "0.5928665", "0.59123415", "0.5909058", "0.585417", "0.58491015", "0.5799681", "0.5774838", "0.577413", "0.5769358", "0.57170504", "0.5686664",...
0.84673285
0
clean up raw titles taken from BOMojo to facilitate better searches on OMDB/Twitter
def processTitle(title): cleaned = re.sub(r'[@#\"]+', '', title.lower().strip()) cleaned = re.sub(r'\(\d{4}.*\)', '', cleaned) cleaned = re.sub(r':.+', '', cleaned).strip() return cleaned
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_title(self, title):\n\t\t# strip apostrophes\n\t\tif '\\'' in title:\n\t\t\ttitle = re.sub('\\'', '', title)\n\t\tif '.' in title:\n\t\t\ttitle = re.sub('.', '', title)\n\t\treturn title", "def clean_title(title):\n title = re.sub(\"\\n\", \"\", title) # Remove newlines\n title = ' '.join(title...
[ "0.6604108", "0.6413314", "0.6245085", "0.62396383", "0.62070096", "0.6201837", "0.6178692", "0.61765945", "0.60911244", "0.6089713", "0.608802", "0.6075226", "0.6067024", "0.60305786", "0.59994125", "0.59956473", "0.594616", "0.59446096", "0.5936255", "0.59050155", "0.589108...
0.64549226
1
scrape BOMojo for information on the top N movies in terms of daily gross
def getTopMovies(endpoint, date, count=10): try: response = urlreq.urlopen(endpoint.format(date)) soup = BeautifulSoup(response.read(), "html.parser") table = soup.find('table', border="0", cellpadding="5", cellspacing="1") tdata = [] for i, row in enumerate(table...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_top_movies(genre: Genre) -> List[Movie]:\n\n html = download_top_movies(genre)\n soup = parse_top_movies(html)\n return [extract_movie(result) for result in soup]", "def scrape_movie_page(dom):\n # to save the information\n info = []\n\n # find the information block needed\n header =...
[ "0.71330565", "0.67618537", "0.6608621", "0.656355", "0.6549088", "0.6464945", "0.64557415", "0.6446494", "0.6415211", "0.6344131", "0.6254804", "0.62027013", "0.619816", "0.61576635", "0.61518717", "0.61433727", "0.6072192", "0.6044976", "0.60145175", "0.5932325", "0.5837514...
0.72936654
0
search twitter for tweets mentioning a given movie title
def searchMovie(api, title, date, count, retweets=False): since = date until = datetime.strptime(since, '%Y-%m-%d') + timedelta(days=1) until = until.strftime('%Y-%m-%d') query = "\"{0}\" since:{1} until:{2} -filter:links".format(processTitle(title), since, until) if retweets == False: que...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_by_title(title):\n\turl = tmdb_api(\"search/movie\")+\"&query=\"+urllib.quote_plus(title)\n\tresponse = json.load(urllib2.urlopen(url))\n\treturn JSONResponse(response)", "def search_movies(title: str) -> list[tuple]:\n with connection:\n search = '%' + title + '%'\n return list(conne...
[ "0.6925293", "0.6724913", "0.64352965", "0.6390151", "0.6380741", "0.6323461", "0.6268078", "0.61828446", "0.6174598", "0.610009", "0.6096859", "0.60881114", "0.60233986", "0.5969585", "0.59671646", "0.59104264", "0.58904886", "0.5866746", "0.5842005", "0.5801552", "0.5786741...
0.68453336
1
Return a binding site name from a given agent.
def get_binding_site_name(agent): # Try to construct a binding site name based on parent grounding = agent.get_grounding() # We don't want to accidentally deal with very deep ontological # cases here such as CHEBI (e.g., GTP) which requires thousands # of lookups to resolve if grounding != (None...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def site_name(self, obj):\n site = obj.site\n return (\"%s\" % (site.name))", "def server_agent_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"server_agent_name\")", "def server_agent_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"serv...
[ "0.60516745", "0.5991255", "0.5991255", "0.5868282", "0.5762695", "0.5751871", "0.54725695", "0.54660743", "0.5430123", "0.5412076", "0.5372198", "0.53381824", "0.5273435", "0.51932955", "0.5154005", "0.50929475", "0.50890386", "0.50785226", "0.5071362", "0.4990982", "0.49901...
0.83094543
0
The combination of associate_user and load_extra_data functions of djangosocialauth. The reason for combining these two pipeline functions is to decrease the number of database visits.
def social_associate_and_load_data(backend, details, response, uid, user, social_user=None, *args, **kwargs): extra_data = backend.extra_data(user, uid, response, details) created = False if not social_user and user: social_user, created = UserSocialAuth.objects.ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_extra_data(backend, details, response, uid, user, social_user=None,\n *args, **kwargs):\n social_user = social_user or \\\n UserSocialAuth.get_social_auth(backend.name, uid)\n if social_user:\n extra_data = backend.extra_data(user, uid, response, details)\n...
[ "0.6427262", "0.5478884", "0.5240445", "0.52389956", "0.5213373", "0.519633", "0.51899827", "0.5171619", "0.5155315", "0.51518744", "0.5148101", "0.5131034", "0.5093896", "0.50883776", "0.5074174", "0.5033296", "0.50316167", "0.50292736", "0.5025192", "0.50241655", "0.5004713...
0.6337023
1
Prettyprint a list of builders from a master.
def pp_builders(builders, master): columns = ['name', 'slavename', 'category'] title = 'outputting builders for: %s' % master notfound = 'no builders found.' pp_internal(builders, columns, title, notfound)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAllBuilders(self):\n names = self.status.getBuilderNames(categories=self.categories)\n builders = [self.status.getBuilder(n) for n in names]\n return builders", "def list_builders(self) -> List[str]:\n return sorted(_iter_builder_names(self._ns2data_dir))", "def listBuilderNames(...
[ "0.6192067", "0.60224825", "0.55578184", "0.55578184", "0.5387139", "0.53863895", "0.53175986", "0.52845865", "0.5281185", "0.5277838", "0.5247651", "0.52469724", "0.5176106", "0.512959", "0.5071999", "0.49349397", "0.49117327", "0.48857865", "0.48785007", "0.48488688", "0.48...
0.77710736
0
Expand builders which have multiple slaves into multiple builders with one slave each.
def dup_slaves(builders): def arrayify(possible_array): """Convert 'string' into ['string']. Leave actual arrays alone.""" if isinstance(possible_array, basestring): return [possible_array] return possible_array duped_slaves = [] for b in builders: for slave in arrayify(b['slavenames']): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slavebuilders(self):\n return self._get_slave_builders(lambda s:\n s.slavename in self._online_slaves and\n s.slavename not in self._busy_slaves)", "def pp_builders(builders, master):\n\n columns = ['name', 'slavename', 'category']\n title = 'outputting builders for: %s' % master\n notfound =...
[ "0.7009561", "0.5939224", "0.5697346", "0.554258", "0.52212834", "0.51657134", "0.51587296", "0.5150197", "0.51009035", "0.5070033", "0.5056523", "0.5022392", "0.5016884", "0.49988937", "0.49728", "0.49724874", "0.49134463", "0.48988444", "0.48966083", "0.48809367", "0.484797...
0.7059593
0
Return a list of builders which match what is specified in 'spec'.
def search(builders, spec): if 'builder' in spec: return [b for b in builders if b['name'] == spec['builder']] elif 'hostname' in spec: return [b for b in builders if b['slavename'] == spec['hostname']] else: return [b for b in builders if (b['name'] == spec['either...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def choose(builders, spec):\n\n candidates = search(builders, spec)\n buildername = get_builder(candidates, spec.values()[0])\n\n if not buildername:\n return None\n\n blder = [b for b in builders if b['name'] == buildername][0]\n\n return blder", "def getAllBuilders(self):\n names = self.status.g...
[ "0.7065604", "0.6366904", "0.6205621", "0.59313875", "0.5801212", "0.5716414", "0.5580702", "0.54017884", "0.5263097", "0.52591556", "0.5248544", "0.52406526", "0.52212656", "0.52202344", "0.5194147", "0.5179128", "0.5170816", "0.5136215", "0.51341134", "0.51207536", "0.51207...
0.76802087
0
Return a pair of (mastername, path) for all masters found.
def get_masters(): # note: ListMasters uses master.cfg hardcoded as part of its search path def parse_master_name(masterpath): """Returns a mastername from a pathname to a master.""" _, tail = os.path.split(masterpath) sep = '.' hdr = 'master' chunks = tail.split(sep) if not chunks or chunk...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def masters(self) -> pulumi.Output[Optional[Sequence[str]]]:\n return pulumi.get(self, \"masters\")", "def ListMasters(cue='master.cfg', include_public=True, include_internal=True):\n # Look for \"internal\" masters first.\n path_internal = os.path.join(\n BUILD_DIR, os.pardir, 'build_internal', 'm...
[ "0.7142009", "0.70371884", "0.68338263", "0.64809763", "0.6472665", "0.6472665", "0.6311474", "0.6304537", "0.62080437", "0.60861564", "0.6067843", "0.60515904", "0.60162145", "0.59996986", "0.5956191", "0.5953216", "0.5837279", "0.5673788", "0.56117886", "0.558528", "0.55739...
0.7571945
0
Returns a mastername from a pathname to a master.
def parse_master_name(masterpath): _, tail = os.path.split(masterpath) sep = '.' hdr = 'master' chunks = tail.split(sep) if not chunks or chunks[0] != hdr or len(chunks) < 2: raise ValueError('unable to parse mastername from path! (%s)' % tail) return sep.join(chunks[1:])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def choose_master(searchname):\n masters = get_masters()\n masternames = []\n master_lookup = {}\n for mn, path in masters:\n master = {}\n master['mastername'] = mn\n master_lookup[mn] = path\n masternames.append(master)\n\n candidates = [mn for mn in masternames if mn['mastername'] == searchname...
[ "0.6372923", "0.6317169", "0.61556184", "0.610252", "0.60480016", "0.600932", "0.58795077", "0.58532685", "0.58285683", "0.5752388", "0.57484525", "0.5719935", "0.57097894", "0.56524986", "0.56494594", "0.564476", "0.564476", "0.564476", "0.5600287", "0.5599613", "0.5592351",...
0.8282636
0
Confirm a sequence only contains one unique value and return it.
def only_get_one(seq, key, source): def uniquify(seq): return list(frozenset(seq)) res = uniquify([s[key] for s in seq]) if len(res) > 1: print >>sys.stderr, 'error: %s too many %ss:' % (source, key) for r in res: print ' ', r return None elif not res: print 'error: %s zero %ss' % (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isdistinct(seq):\n return len(seq) == len(set(seq))", "def get_unique(self):\n return self.serie.nunique()", "def is_unique(self):\r\n return self._unique", "def uniq(seq):\r\n #TODO: consider building a set out of seq so that the if condition\r\n #is constant time -JB\r\n retur...
[ "0.6194614", "0.61632925", "0.6018149", "0.60084176", "0.59649074", "0.5959102", "0.5955434", "0.5943642", "0.59182596", "0.5835167", "0.58102876", "0.5796282", "0.5759754", "0.5730302", "0.56856775", "0.56828374", "0.5673099", "0.5668738", "0.55292314", "0.5515162", "0.54578...
0.625032
0
Search through builders matching 'spec' and return it.
def choose(builders, spec): candidates = search(builders, spec) buildername = get_builder(candidates, spec.values()[0]) if not buildername: return None blder = [b for b in builders if b['name'] == buildername][0] return blder
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(builders, spec):\n if 'builder' in spec:\n return [b for b in builders if b['name'] ==\n spec['builder']]\n elif 'hostname' in spec:\n return [b for b in builders if b['slavename']\n == spec['hostname']]\n else:\n return [b for b in builders if (b['name'] ==\n ...
[ "0.74085414", "0.5914206", "0.5404804", "0.53804606", "0.53804606", "0.5173281", "0.51628286", "0.5149105", "0.5062585", "0.50532424", "0.5007297", "0.50054854", "0.49976838", "0.49824825", "0.4926369", "0.48937625", "0.48742664", "0.48677486", "0.48448572", "0.47606125", "0....
0.7681437
0
Connect to chromium LKGR server and get LKGR revision.
def get_lkgr(): try: conn = urllib.urlopen('http://chromium-status.appspot.com/lkgr') except IOError: return (None, 'Error connecting to LKGR server! Is your internet ' 'connection working properly?') try: rev = int('\n'.join(conn.readlines())) except IOError: return (None, 'Error c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetLKGR():\n\n try:\n conn = urllib.urlopen('https://chromium-status.appspot.com/lkgr')\n except IOError:\n return (None, 'Error connecting to LKGR server! Is your internet '\n 'connection working properly?')\n try:\n rev = int('\\n'.join(conn.readlines()))\n except IOError:\n return...
[ "0.7639202", "0.5643532", "0.5526256", "0.5292058", "0.52112335", "0.5158212", "0.5131409", "0.51192427", "0.5084575", "0.5029493", "0.49947414", "0.4977814", "0.49504116", "0.49502164", "0.49388358", "0.49381736", "0.49336123", "0.49293384", "0.49293384", "0.49240768", "0.48...
0.76185536
1
Check if the previous step succeeded before continuing.
def checkStep(rc, steps, run_status, prog_args): if (rc == FAILURE) or (rc == EXCEPTION): buildException(run_status, 'previous command failed') else: defer.maybeDeferred(lambda x: startNextStep(x, run_status, prog_args), steps)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ready_to_proceed(self):\n if self.current_step is None or self.step_position == StepPosition.Before:\n return False\n\n for condition, _ in self.current_step.conditions:\n if condition.satisfied():\n return True\n return False", "def try_advance(self)...
[ "0.6924123", "0.6897496", "0.6432004", "0.64264905", "0.6425109", "0.63696253", "0.6231616", "0.6207607", "0.619148", "0.6149748", "0.61462504", "0.6142753", "0.614151", "0.6126543", "0.6112948", "0.6102814", "0.6095051", "0.60858077", "0.6071269", "0.60315263", "0.60169834",...
0.71053165
0
Given a string, load all masters and pick the master that matches.
def choose_master(searchname): masters = get_masters() masternames = [] master_lookup = {} for mn, path in masters: master = {} master['mastername'] = mn master_lookup[mn] = path masternames.append(master) candidates = [mn for mn in masternames if mn['mastername'] == searchname] errstring ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_masters():\n\n # note: ListMasters uses master.cfg hardcoded as part of its search path\n def parse_master_name(masterpath):\n \"\"\"Returns a mastername from a pathname to a master.\"\"\"\n _, tail = os.path.split(masterpath)\n sep = '.'\n hdr = 'master'\n chunks = tail.split(sep)\n if...
[ "0.59240687", "0.5650912", "0.5650912", "0.5484264", "0.544708", "0.5408858", "0.5354618", "0.5318847", "0.51864445", "0.5169288", "0.51414424", "0.5123247", "0.51117146", "0.5093722", "0.5075803", "0.4926", "0.48871285", "0.4880617", "0.48195487", "0.47273347", "0.47038534",...
0.7108627
0
Attach build and buildslaves to each step.
def process_steps(steplist, build, buildslave, build_status, basedir): for step in steplist: step.setBuild(build) step.setBuildSlave(buildslave) step.setStepStatus(build_status.addStepWithName(step.name)) step.setDefaultWorkdir(os.path.join(basedir, 'build')) step.workdir = os.path.join(basedir, '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stepStarted(build, step):", "def build_step(self):\n\n pass", "def build_step(self):\n pass", "def build_step(self):\n pass", "def steps(self, steps):\n\n self._steps = steps", "def merge_steps(self, steps):\n raise NotImplementedError", "def stepFinished(build, s...
[ "0.60801065", "0.6005942", "0.59210396", "0.59210396", "0.5855583", "0.5763112", "0.56093055", "0.5504773", "0.5465347", "0.541182", "0.5409328", "0.5386782", "0.538314", "0.53748685", "0.53719014", "0.5365673", "0.5361277", "0.53086853", "0.5272315", "0.5268723", "0.5249136"...
0.6598073
0
Open the ascii .zout file and return as an astropy.table Table object.
def getOut(self, path, prefix, verbose = True): fpath = path + prefix + ".zout" if not os.path.isfile(fpath): if verbose: print ".zout file not found - please check!" return False try: zout = Table.read(fpath, format="ascii") if verbose: print "....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pdread2astrotable(csvgzdir):\n df = pd.read_csv(csvgzdir)\n tb = Table.from_pandas(df)\n return tb", "def read_tabix(\n file: PathType, storage_options: Optional[Dict[str, str]] = None\n) -> TabixIndex:\n with open_gzip(file, storage_options=storage_options) as f:\n magic = read_bytes_...
[ "0.6445617", "0.58485997", "0.56481296", "0.5641298", "0.5635116", "0.5553415", "0.5553415", "0.5550646", "0.5523641", "0.54948246", "0.53368026", "0.52775514", "0.52525586", "0.5251553", "0.5247824", "0.52383107", "0.5213523", "0.5205577", "0.5199613", "0.5189507", "0.518745...
0.61672497
1
Open the .tempfilt EAZY output file and return contents as a dictionary object
def getTempfilt(self, path, prefix, verbose = True): fpath = path + prefix + '.tempfilt' if not os.path.isfile(fpath): if verbose: print ".tempfilt file not found - please check!" return False with open(fpath, "rb") as f: s = np.fromfile(f, count = 4, dtype...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readtempfilt(MAIN_OUTPUT_FILE='photz', OUTPUT_DIRECTORY='./OUTPUT'):\n\n root = os.path.join(OUTPUT_DIRECTORY, MAIN_OUTPUT_FILE)\n \n ###### .tempfilt\n file_path = root+'.tempfilt'\n \n if os.path.exists(file_path) is False:\n raise ValueError('File, %s, not found.' %(file_path))\n\n ...
[ "0.711481", "0.6126175", "0.594898", "0.56255794", "0.55975693", "0.555666", "0.55090946", "0.55012673", "0.548985", "0.5441883", "0.5371903", "0.53018695", "0.529611", "0.5256127", "0.5240169", "0.5194636", "0.5193826", "0.51894754", "0.51860964", "0.51855606", "0.5164739", ...
0.6364439
1
Write a new .params file, overwritten with new key values
def writeParams(self, outpath = False, newvals = False, clobber = False, verbose = True): if newvals is not False and type(newvals) is not dict: if verbose: print "New parameters not in dictionary format - please check!" return False outparams = self.params if newvals ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _write_params(self, force=False):\n\t\tif force or not os.path.exists(self._get_params_filepath()):\n\t\t\tf = open(self._get_params_filepath(), 'w')\n\t\t\tf.write(\"\\n\".join(self.params))\n\t\t\tf.write(\"\\n\")\n\t\t\tf.close()\n\t\t\tlogger.debug(\"Wrote %s\" % (self._get_params_filepath()))\n\t\telse:\n...
[ "0.73747414", "0.7367924", "0.6965227", "0.69542533", "0.67178345", "0.6705485", "0.64723575", "0.6471904", "0.6431831", "0.6351544", "0.6347792", "0.63348347", "0.6263163", "0.6246471", "0.61968315", "0.6188766", "0.61873174", "0.61659473", "0.61176175", "0.6111604", "0.6104...
0.7389937
0
Grab the current zeropoints from the .zeropoints file
def getZeropoints (self, indir, inpref, verbose = True): if os.path.isfile(indir+inpref+'.zeropoint'): zeropoints = np.genfromtxt(indir+inpref+'.zeropoint', usecols=1, dtype=np.float32) if verbose: print "zeropoints captured successfully!" return zeropoints else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPointsFromFile(traceFile):\r\n g = minidom.parse(traceFile)\r\n if g.getElementsByTagName('gpx'):\r\n return getPointsFromGpx(g)\r\n elif g.getElementsByTagName('kml'):\r\n return getPointsFromMercuryFile(traceFile)\r\n else:\r\n return [] #echec -no points\r", "def get_a...
[ "0.61317664", "0.59517145", "0.5922443", "0.58649415", "0.5825099", "0.58034104", "0.57739806", "0.5744703", "0.57242584", "0.5695771", "0.56932396", "0.56530195", "0.56403214", "0.5625227", "0.56025916", "0.55972755", "0.5574614", "0.55499184", "0.55398184", "0.5490028", "0....
0.7392869
0
Run EAZY and collect the output.
def runEAZY(self, eazypath, inpath, inpref): command = ("cd {directory}; {0} -p {1} -t {2} -z {3}".format(eazypath, inpref+".param", inpref+".translate", inpref+".zeropoint", director...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n my_emr = EmrProcessing()\n\n if \"-s\" in sys.argv:\n my_emr.verbose_mode = False\n else:\n my_emr.verbose_mode = True\n print \"\\nStarting Titanic Data Analysis\"\n my_emr.parse_user_selections()\n\n # Setup\n my_emr.clear_local_output_directory()\n my_emr....
[ "0.57431215", "0.5409531", "0.5399925", "0.5399925", "0.53816", "0.52810526", "0.5280897", "0.52732193", "0.5271705", "0.52603763", "0.52446514", "0.5219894", "0.5172208", "0.51682454", "0.5145979", "0.5121802", "0.51211095", "0.50872207", "0.50812286", "0.5064914", "0.506491...
0.58166707
0
Calculate some useful statistics for the photoz/specz comparison.
def getCompStats(self, photoz = "z_peak", verbose = True): specz = self.zout["z_spec"] photoz = self.zout[photoz] dz = (photoz - specz) diff = (dz / (1.+specz)) nmad = 1.4826 * np.median( np.abs( dz - np.median(dz) ) ) mean_offset = np.mean(diff) median_offset ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testSampleImageStats(self):\n \n imgfiles = []\n imgfiles.append(\"v1_i1_g_m400_s20_f.fits\")\n imgfiles.append(\"v1_i1_g_m400_s20_u16.fits\")\n imgfiles.append(\"v1_i2_g_m400_s20_f.fits\")\n imgfiles.append(\"v1_i2_g_m400_s20_u16.fits\")\n imgfiles.append(\"v2_...
[ "0.62995243", "0.626098", "0.61650515", "0.60723734", "0.60337234", "0.6022576", "0.5963165", "0.59203196", "0.5843567", "0.5823474", "0.58122724", "0.5804204", "0.577855", "0.56952435", "0.56760657", "0.5613303", "0.56002814", "0.55723095", "0.55523425", "0.5547705", "0.5523...
0.78785306
0
Returns the fields needed for a network views ipam call.
def network_views(): return 'networkview?'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_api_fields(cls):\n return ['fqdn', 'ttl', 'description', 'views']", "def getViews(read):\n ...", "def get_vm_data_fields(self):\n\n raise NotImplementedError", "def info(self):\n info = \">>>> IP\" + '\\n'\n info += \" To: \" + self.destinationIp + '\\n'\n inf...
[ "0.58593136", "0.57089645", "0.5631673", "0.56026655", "0.5583982", "0.5524781", "0.54614687", "0.5457726", "0.54543835", "0.54375136", "0.5420535", "0.52939105", "0.52843255", "0.5243048", "0.52313054", "0.5225801", "0.5189378", "0.5185825", "0.517134", "0.5154297", "0.51468...
0.596402
0
Wrap records object that are exhaustable (eg generators, file objects, db cursors) so that we can sample them for inspection and inference without losing records.
def wrap_records_object(obj: Any) -> Any: if isinstance(obj, SampleableIterator): # Already wrapped return obj if isinstance(obj, ResultProxy): return SampleableCursor(obj) if isinstance(obj, IOBase): return SampleableIO(obj) if isinstance(obj, abc.Generator): ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *records: ScalarSequence):\n self._records = [r for r in records if r]", "def records(self):\r\n raise NotImplementedError()", "def __iter__(self):\n counter = 0\n while True:\n if counter < len(self.all_records):\n yield self.all_records...
[ "0.6080863", "0.5741171", "0.55929357", "0.5570124", "0.5447731", "0.54261357", "0.5404625", "0.53648776", "0.5355849", "0.53219557", "0.5255752", "0.5210186", "0.5188838", "0.51879054", "0.5187643", "0.51652", "0.51625055", "0.5120713", "0.50605875", "0.50605875", "0.5032449...
0.72915584
0
Rate limit calls to a function.
def _limited_call(self, func, *args, **kwargs): # Check seconds that have passed now = datetime.datetime.now() diff = (now - self._rate_limit_start).total_seconds() if diff >= 60: # If greater than a minute, reset the rate limit self._rate_limit_count = 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ratelimited():\n\n lock = threading.Lock()\n\n def decorator(func):\n last_call = time.perf_counter()\n\n @wraps(func)\n def ratelimit(*args, **kwargs):\n limit = kwargs.get(\"ratelimit\", None)\n if limit:\n count, seconds = limit.split(\"/\")\n ...
[ "0.774844", "0.7687252", "0.73051584", "0.7302061", "0.7221094", "0.7193447", "0.7186658", "0.7117065", "0.710736", "0.7102475", "0.70750374", "0.7038235", "0.69855464", "0.6896162", "0.68784034", "0.6843292", "0.6843292", "0.6843292", "0.67920244", "0.6740426", "0.66486627",...
0.8237565
0
Get a CAPTCHA puzzle.
def get_captcha(self): res = self._limited_call(self._requests.get, constants.FA_ROOT + "/captcha.jpg") data = res.content return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n try:\n imageFilename = random.choice(os.listdir(self.cacheDir))\n imagePath = os.path.join(self.cacheDir, imageFilename)\n with open(imagePath) as imageFile:\n self.image = imageFile.read()\n except IndexError:\n raise GimpCa...
[ "0.61169136", "0.6112375", "0.60955966", "0.5859403", "0.5839033", "0.5812558", "0.5522057", "0.5405848", "0.53841287", "0.5343834", "0.5302962", "0.5302095", "0.52938336", "0.52660924", "0.5257254", "0.52544385", "0.5173279", "0.5142943", "0.51268345", "0.5119854", "0.511594...
0.6154923
0
Return submissions found in pages of a base url.
def _scan_submission_page(self, url_format): submissions = [] try: page = 1 while True: url = url_format % page doc = self._limited_call(self._html_get, url) logger.debug("Scanning submissions from %s" % url) coun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_urls(base_url):\n res = requests.get(base_url, headers=HEADERS)\n res = BeautifulSoup(res.text, 'html.parser')\n res = res.find_all(href=re.compile('pdf'))\n return res", "def get_submissions(username, problem, cookies, is_clicker, sesssion):\r\n url = '/'.join([courseserver, coursepath, c...
[ "0.5971324", "0.5961301", "0.59605527", "0.5955323", "0.58842486", "0.5882445", "0.58632535", "0.5807735", "0.57095593", "0.5695872", "0.5692507", "0.5645808", "0.5624923", "0.5583744", "0.5556068", "0.55493116", "0.5507686", "0.55000055", "0.54877317", "0.5482656", "0.544188...
0.65737253
0
Returns the list of the users that are currently on the VLC/mmWave
def get_vlc_users(wifi_list): vlc_users = [user for user in users if user["vlc_ip"] not in wifi_list] return vlc_users
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_users(self):\n return self.mycam.devicemgmt.GetUsers()", "def user_list(self, mapp, url_of_liveserver):\n return mapp.getjson(url_of_liveserver)['result'].keys()", "def all_users():\n\treturn [unicode(name[:-4]).lower() for name in os.listdir(os.path.join(WORLD_DIR, 'players'))]", "def ...
[ "0.74427754", "0.6795005", "0.672411", "0.67044204", "0.6702518", "0.66885984", "0.66357285", "0.6614727", "0.65836966", "0.65774393", "0.6577427", "0.65748775", "0.6572361", "0.65383404", "0.653604", "0.6530479", "0.65299314", "0.6490531", "0.6474435", "0.6440596", "0.643123...
0.75741893
0
Tests that the output html is generated correclty by the clustering function
def test_output_html(tmp_path): # This will be the file to temporary_file = os.path.join(tmp_path, 'test-cluster.html') # Run clustering on small dummy data (see test_clustering.py) cluster = TextClustering(embedding_random_state=42, reducer_random_state=43, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_html_output(self):\n pass", "def cluster_classification_tex(f,browsing_matrix,diversifying_matrix, weblog,session_data_threshold,cluster_type,classification_column_diversity,classification_wanted_transaction):\n divpat_classification_wanted_transaction = classification_wanted_transaction\n ...
[ "0.68014586", "0.64515656", "0.6283319", "0.6218219", "0.61491203", "0.6064487", "0.5956804", "0.5843667", "0.5821508", "0.5812067", "0.5782588", "0.5746487", "0.572244", "0.5716077", "0.57043064", "0.5677167", "0.5629126", "0.5620701", "0.5605728", "0.5572866", "0.5569146", ...
0.7976958
0
programmer_type e.g. INTEGER or programmer defined type
def __init__(self, programmer_type): self.programmer_type = programmer_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type_():\n pass", "def opinion_type():\n pass", "def _type(self):\n return self._id[1]", "def program_type(self, value):\n\n types = {\n 'executableProgram': '1'\n }\n\n self._program_type = types[value]", "def Type(self) -> _n_6_t_5:", "def _type(self) ->...
[ "0.62550634", "0.6194765", "0.61409026", "0.60830945", "0.6071827", "0.6035185", "0.60270154", "0.588981", "0.587063", "0.58595556", "0.5849741", "0.58421713", "0.5834853", "0.5820968", "0.58097893", "0.5783257", "0.5766275", "0.57662106", "0.57528615", "0.57528615", "0.57528...
0.65804327
0
Add variable_classification to symbol table, keyed by name. variable_classification should be an instance of a supported class.
def add(self, name, variable_classification): if name in self.__table__: logger.error("Tried to add duplicate key : " , name) if isinstance(variable_classification, Global_Variable): self.__table__[name] = variable_classification elif isinstance(variable_cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_classification(binary_addr, classification):\n\n binary_addr = memorymanager.BinaryAddr(binary_addr)\n assert classification is not None\n assert not is_classified(binary_addr, classification.length())\n\n classifications[binary_addr] = classification\n for i in range(1, classification.lengt...
[ "0.57706994", "0.5299413", "0.5178825", "0.5178825", "0.50512016", "0.5013679", "0.49713007", "0.49616438", "0.4951365", "0.49184912", "0.49086782", "0.48979303", "0.48972085", "0.4870996", "0.48198763", "0.48087734", "0.48018882", "0.47521648", "0.47314653", "0.4712323", "0....
0.8011216
0
Does a single timestep. x is input at single timestep, with shape [B, input_size] h_mask has shape (1, hidden_size) w_rnn_mask has shape (hidden_size, hidden_size)
def __call__(self, x, state, h_mask=None, w_rnn_mask=None): self._initialize(x) h, syn_x, syn_u = state # Update STP state if self.synapse_config == 'static': h_post = h else: syn_x += self.dynamic_synapse*(self.alpha_std*(1-syn_x) - self.dt_sec*syn_u*syn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward_multistep(self, x, h=None):\n rnn_out, _ = self.rnn(x, h)\n out = self.nonlin(rnn_out)\n out = self.out(out)\n return out", "def recurrent(self, x, h_0, w_ih, w_hh, b_ih, b_hh):\n time_step = x.shape[0]\n outputs = []\n t = 0\n h = h_0\n ...
[ "0.6626418", "0.6523465", "0.6475527", "0.6467861", "0.63915914", "0.6248351", "0.62410563", "0.6223673", "0.61891216", "0.61472535", "0.5977498", "0.5958096", "0.5928593", "0.5924435", "0.5900401", "0.58467704", "0.5833496", "0.5816832", "0.57625586", "0.5760914", "0.5746896...
0.6954587
0
Does an entire trial. inputs has shape (T, B, input_size) h_mask has shape (1, hidden_size) w_rnn_mask has shape (hidden_size, hidden_size)
def do_trial(self, inputs, h_mask=None, w_rnn_mask=None): # Initial state batch_size = tf.shape(inputs)[1] state = self.initial_state(batch_size) # Lists to record outputs and state y_list = [] h_list = [] syn_x_list = [] syn_u_list = [] # Do tri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _build_rnn(self, input_tensor):\n\n w_trainable = False\n x_shift_trainable = False\n eta_trainable = True\n\n input_shape = input_tensor.get_shape().as_list()\n input_area = np.prod(input_shape[1:])\n batch_input_shape = (-1, input_area)\n\n filters = self._hparams.filters + self._hparams...
[ "0.6537916", "0.643278", "0.63914007", "0.6254323", "0.62117887", "0.61617935", "0.6105288", "0.60597825", "0.6032844", "0.582015", "0.5806906", "0.5765901", "0.5758782", "0.57418066", "0.57151246", "0.56992996", "0.5634114", "0.56296146", "0.562593", "0.5616265", "0.5605084"...
0.7540586
0
Initialize this prefix tree node with the given character value, an empty structure of children nodes, and a boolean terminal property.
def __init__(self, character=None): # Character that this node represents self.character = character # Data structure to associate character keys to children node values self.children = PrefixTreeNode.CHILDREN_TYPE() # TODO: changes this later to be more modular # we need...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.end_of_ngram = False #Flag marking whether this node is the end of an n-gram.\n self.value = None #Provided that the node marks the end of an n-gram, this refers to the value mapped by this n-gram.\n self.children = dict() #A dictionary which maps the next elements i...
[ "0.6665235", "0.6543156", "0.6469666", "0.6381798", "0.6364745", "0.6266195", "0.61163795", "0.59772074", "0.5968809", "0.5961764", "0.587357", "0.58718324", "0.5849852", "0.5834361", "0.57998735", "0.57780296", "0.5742961", "0.5738601", "0.57318425", "0.5730069", "0.57175416...
0.8080057
0
Return True if this prefix tree node has a child node that represents the given character amongst its children.
def has_child(self, character): # get the position of that character if self.num_children() > 0: character = character.upper() # get the character position the children list index = self._get_index(character) # if there is a value(not None) in that positio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startsWith(self, prefix: str) -> bool:\n\t\tcurrent_node = self.root\n\t\tfor ch in prefix:\n\t\t\tfound_in_child = False\n\t\t\tfor node in current_node.children:\n\t\t\t\tif node.char == ch:\n\t\t\t\t\tfound_in_child = True\n\t\t\t\t\tcurrent_node = node\n\t\t\tif found_in_child == False: # some char not fou...
[ "0.7128197", "0.7124183", "0.68367136", "0.6833913", "0.6767288", "0.6633027", "0.6624532", "0.6616198", "0.6612872", "0.65886366", "0.6573919", "0.6516627", "0.64836717", "0.6480255", "0.6474775", "0.6463279", "0.6448133", "0.6431371", "0.64189017", "0.6399336", "0.6399336",...
0.823829
0
Return this prefix tree node's child node that represents the given character if it is amongst its children, or raise ValueError if not.
def get_child(self, character): if self.has_child(character): index = self._get_index(character.upper()) return self.children[index] else: raise ValueError(f'No child exists for character {character!r}')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_child(self, character, child_node):\n # make sure character is uppercase\n character = character.upper()\n # TODO: Should I consider check if char is english letter?\n if not character.isalpha():\n raise ValueError(f'Child can only be English letters!')\n\n if ...
[ "0.6411065", "0.6123256", "0.59505016", "0.5816716", "0.5716883", "0.55713284", "0.5504385", "0.5464852", "0.5397857", "0.5277082", "0.52383786", "0.51611114", "0.5122005", "0.50697345", "0.5056239", "0.5043961", "0.5043162", "0.5042223", "0.5009303", "0.49876723", "0.4982551...
0.6819031
0
Add the given character and child node as a child of this node, or raise ValueError if given character is amongst this node's children.
def add_child(self, character, child_node): # make sure character is uppercase character = character.upper() # TODO: Should I consider check if char is english letter? if not character.isalpha(): raise ValueError(f'Child can only be English letters!') if not self.has...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_child(self, char, node):\n # Since most nodes only have a single child, we cheat and just store\n # the character and child node locally instead of using a dictionary\n # since dictionaries are quite large. We only use a dictionary for\n # children if there is more than one.\n ...
[ "0.7766311", "0.64096355", "0.63521856", "0.6063242", "0.6048972", "0.60131407", "0.5985679", "0.5974402", "0.5946803", "0.5944756", "0.5931625", "0.5878112", "0.58529073", "0.5841672", "0.5718316", "0.56705666", "0.56446874", "0.5643118", "0.5559174", "0.55575705", "0.554538...
0.79886997
0
Return a code representation of this prefix tree node.
def __repr__(self): return f'PrefixTreeNode({self.character!r})'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prefix(self):\n return str(self.data)", "def print_prefix(self):\n if self.is_empty():\n return \"\"\n else:\n ch = str(self.root_value())\n if self.is_leaf():\n return ch\n else:\n if self.has_left():\n ...
[ "0.6528944", "0.6526481", "0.6429511", "0.6429511", "0.62779075", "0.62705106", "0.62266624", "0.6158443", "0.60770893", "0.6044291", "0.60248667", "0.59881675", "0.59881675", "0.59881675", "0.59881675", "0.59868693", "0.5969311", "0.59661835", "0.5922735", "0.5877203", "0.58...
0.7174368
0
return marks for today
def today(self) -> List[Mark]: def is_today(mark): then = datetime.datetime.strptime(mark.date, "%Y-%m-%d %H:%M:%S") then = then.replace( tzinfo=pytz.timezone("Europe/Moscow")) now = _get_now_datetime() delta = then - now return delta....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def today(self):\r\n return RecordsToday(self)", "def get_today_stat(cls):\n return cls.get_specified_days_stat(0)", "def get_dates(self):\n now = datetime.now()\n if now.month > 6 and now.month < 9:\n now = datetime(now.year, 6, 1)\n\n term = ReadingsTerm()\n ...
[ "0.5916586", "0.5863006", "0.56907153", "0.5520133", "0.551707", "0.53910345", "0.53877157", "0.53220946", "0.53081816", "0.52918375", "0.52601963", "0.5241408", "0.5206583", "0.51920193", "0.5178562", "0.51725596", "0.51532644", "0.51315415", "0.5126638", "0.51142246", "0.50...
0.7245128
0
List forecast ARNs which should be deleted.
def get_deletion_target_forecast_arns(project_name, status_list): # Get all forecasts # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/forecast.html#ForecastService.Client.list_forecasts deletion_target_forecast_arns = [] paginator = forecast_client.get_paginator('list_forec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deleteRDFHistoryAnnotation(*args):\n return _libsbml.RDFAnnotationParser_deleteRDFHistoryAnnotation(*args)", "def _cleanup_deleted_nics(self):\n try:\n nics = self.network.network_interfaces.list(\n CONF.azure.resource_group)\n except Exception as e:\n ...
[ "0.5197516", "0.5063396", "0.5037167", "0.5018939", "0.50044006", "0.49915823", "0.49785802", "0.4913383", "0.49072155", "0.48931664", "0.48756954", "0.48353547", "0.4831092", "0.48188224", "0.4786588", "0.4776793", "0.47636405", "0.474672", "0.47381392", "0.47339857", "0.472...
0.69066507
0
Saves a precomputed index (or indices) so we can save our work.
def save_index(self, fn): utils.save_obj(self.inverted_idx, fn)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self):\n self.index.saveIndex(c.index_path('hnsw.index'))\n joblib.dump(self.ys, \"%s.ys\" % self.index_file_prefix)", "def save_index(self, index_path: str = \"annoy_index.bin\"):\n if index_path:\n if self.index is None:\n self.build_index()\n ...
[ "0.768521", "0.7268615", "0.7143544", "0.7043186", "0.6728959", "0.6711802", "0.6211941", "0.61536616", "0.60525626", "0.6005699", "0.58245677", "0.58102417", "0.5808068", "0.580441", "0.5789389", "0.5783334", "0.57672304", "0.57663906", "0.5756875", "0.57513165", "0.5730735"...
0.7413817
1
Checks if a term exist in the dictionary.
def _is_term_exist(self, term): return term in self.postingDict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _word_exists(self, word):\n try:\n self.vault[word]\n return True\n except KeyError:\n log('w', 'No vault entry for %s.' % word)\n return False", "def contains(self, term):\n\t\tif term in self.textFile:\n\t\t\treturn True\n\t\t\n\t\treturn False", ...
[ "0.71143764", "0.69745284", "0.6818216", "0.67665815", "0.67011344", "0.6628426", "0.65445715", "0.648925", "0.648786", "0.64627874", "0.64576524", "0.6287824", "0.62027085", "0.6191887", "0.61565", "0.60809", "0.6059904", "0.6058339", "0.604235", "0.60353863", "0.601541", ...
0.86079973
0
Return the posting list from the index for a term.
def get_term_posting_list(self, term): return self.postingDict[term] if self._is_term_exist(term) else []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_terms(self):\n [[self.set_postings(term, id) for term in NLProcessor.process(doc)] for id, doc in\n self.doc_store.dict.iteritems()]", "def get_posting_list(lines_to_get):\n\n # type(posting list) == { term: [df, {doc_id: tf}] }\n posting_list = {}\n current_index = 0\n with ...
[ "0.75238407", "0.64862007", "0.6434141", "0.6215521", "0.60838443", "0.6023031", "0.5840072", "0.57536083", "0.57006234", "0.55942345", "0.55942345", "0.55942345", "0.55942345", "0.55942345", "0.55942345", "0.55942345", "0.55942345", "0.55942345", "0.55517894", "0.54507554", ...
0.8083019
0
Find tournament in DB, return tournament id or None
def tournament(self, name): self.name = name q = Query() data = TinyDB('app/data/db_tournaments.json').table('tournaments') self.search_result = data.search( (q.name == self.name) | (q.place == self.name) ) if len(self.search_result) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tournament_id(self):\n User = Query()\n serialized_tournament = self.serialize_tournament()\n documents = table_tournaments.search(User.tournament_name == str(serialized_tournament['tournament_name'])\n and User.start_date == str(serialized_t...
[ "0.7317936", "0.71878844", "0.66823566", "0.6586053", "0.62570727", "0.61614025", "0.59224683", "0.59196794", "0.5917578", "0.5827671", "0.5803463", "0.56885487", "0.56575257", "0.5646724", "0.5629798", "0.5609824", "0.56083345", "0.5598748", "0.55618787", "0.5556157", "0.555...
0.7204733
1
Starts a new trip
def start_trip(self, live): t = Trip(live) self.current_trip = t if live: # Send a request for a new trip to the remote server self.get_connection().start_trip() else: # Add a new trip to the local database self.get_database().start_trip(t)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_trip(self, trip):\n with closing(self.db.cursor()) as cursor:\n t = datetime.datetime.fromtimestamp(time.time()).strftime(\"%Y-%m-%d %H:%M:%S\")\n query = \"INSERT INTO Trips (StartTime, EndTime) VALUES('\"+t+\"', '\"+t+\"')\"\n #cursor = self.db.cursor()\n ...
[ "0.7632614", "0.73476607", "0.68050456", "0.6070551", "0.58444476", "0.57740855", "0.56689465", "0.5656807", "0.56367147", "0.55783194", "0.55622566", "0.5558509", "0.55477726", "0.5527102", "0.552073", "0.5515618", "0.5509126", "0.54992664", "0.5492092", "0.549134", "0.54648...
0.80429375
0
Stops the current trip.
def stop_trip(self): if self.current_trip is None: print("stopping non-existent trip") return # Send all data that is still available about this trip self.send_data() if self.current_trip.is_live(): # If the trip is live, warn the remote server that we...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self, **kwargs):\n return self.client.api.stop(self.id, **kwargs)", "def stop_trip(self, trip_id):\n print \"stopping trip in data_store\"\n with closing(self.db.cursor()) as cursor:\n t = datetime.datetime.fromtimestamp(time.time()).strftime(\"%Y-%m-%d %H:%M:%S\")\n ...
[ "0.70914865", "0.6969482", "0.683968", "0.66863656", "0.64907783", "0.64907783", "0.64669704", "0.6458828", "0.6427096", "0.6424007", "0.6422723", "0.642067", "0.6415792", "0.64154863", "0.64116096", "0.6401978", "0.635442", "0.6339749", "0.6339749", "0.63291174", "0.63229513...
0.80128336
0
Adds a new trip to the local database.
def start_trip(self, trip): with closing(self.db.cursor()) as cursor: t = datetime.datetime.fromtimestamp(time.time()).strftime("%Y-%m-%d %H:%M:%S") query = "INSERT INTO Trips (StartTime, EndTime) VALUES('"+t+"', '"+t+"')" #cursor = self.db.cursor() cursor.execute...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_record(self, data):\n if self.current_trip is None:\n print \"no trip to add data\"\n return\n self.current_trip.store_data(data)", "def add_trip(request):\n trip_name = request.POST.get('trip_name', None)\n start_date_tx = request.POST.get('start_date_tx', None)...
[ "0.7222878", "0.6961758", "0.66672313", "0.6545167", "0.6206592", "0.6206592", "0.6012512", "0.59958225", "0.57862896", "0.57742745", "0.57742745", "0.57742745", "0.5772493", "0.57469815", "0.5733229", "0.57141644", "0.5669199", "0.5646852", "0.5645996", "0.56137174", "0.5609...
0.72445005
0
Sends multiple records to the database.
def send_multiple_data(self, data_array, trip_id): l = [] for d in data_array: l.append((trip_id, json.dumps(d[0]))) print l if len(l) == 0: return with closing(self.db.cursor()) as cursor: query = "INSERT INTO Data (Trip, DataString) VALUES (%...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _batch_write(self):\n if self.to_put:\n db.put(self.to_put)\n self.to_put = []\n if self.to_delete:\n db.delete(self.to_delete)\n self.to_delete = []", "def _send_batch(self):\n batch = RPLogBatch(self._batch)\n http_request = HttpReques...
[ "0.6489871", "0.62162536", "0.6212522", "0.6182945", "0.6170266", "0.61223555", "0.6017973", "0.60052776", "0.59758145", "0.5963647", "0.5959967", "0.59353185", "0.5929608", "0.59281003", "0.5911985", "0.5907636", "0.5876779", "0.5871515", "0.5868144", "0.5857086", "0.5845604...
0.63451314
1
Returns whether this trip received an id from the storage yet.
def has_id(self): return not self.id is None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_receipt_id(self):\n return self.receipt_id_uploaded_at is not None", "def exists(self):\n\n return self.ids[-1] is not None", "def has_id(self):\n return self.is_root() or hasattr(self, self.id_field)", "def has_valid_id(self):\n try:\n project_id = self.track.proje...
[ "0.71493804", "0.68278384", "0.6690638", "0.63286155", "0.63248265", "0.63099545", "0.62518334", "0.6242823", "0.620787", "0.6184917", "0.61646926", "0.6152373", "0.6118187", "0.61119354", "0.61100477", "0.6106007", "0.6102459", "0.6099983", "0.6060453", "0.6060453", "0.60568...
0.7565576
0
Returns whether there's data to be sent.
def has_data(self): return len(self.data) > 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_data(self) -> bool:\n return bool(self.data)", "def has_data(self):\n return self._data is not None", "def has_data(self):\n\n return self._data is not None", "def has_data(self):\n\n return self._data is not None", "def has_data(self):\n if len(self.channels) > 0...
[ "0.7423077", "0.73794514", "0.7343328", "0.7343328", "0.72381836", "0.6993774", "0.6939404", "0.6916497", "0.6899406", "0.68876123", "0.6847703", "0.6830107", "0.6752344", "0.66728854", "0.66712654", "0.66709226", "0.66582125", "0.6551532", "0.6528431", "0.651103", "0.6507763...
0.7657208
0
Information about the job result if available, does not wait for the result. Does not raise an exception even if the job raised one.
async def result_info(self) -> Optional[JobResult]: v = await self._redis.get(result_key_prefix + self.job_id) if v: return deserialize_result(v, deserializer=self._deserializer) else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_result(self):\n\t\treturn handle_to_object(call_sdk_function('PrlJob_GetResult', self.handle))", "def get(self):\n if not self.finished():\n self.wait()\n return self._result", "def result(self, job):\n\n assert isinstance(job, six.string_types)\n\n try:\n ...
[ "0.71049714", "0.6664428", "0.6653046", "0.66498166", "0.6640852", "0.66200167", "0.6616095", "0.6598082", "0.6574297", "0.6538799", "0.64958966", "0.64946705", "0.6493544", "0.64834994", "0.64439857", "0.6435248", "0.6433952", "0.64223033", "0.636806", "0.63643026", "0.63222...
0.74217653
0
Iterates over every file in the dir with the input_format and converts it to the output_format in a sequential way
def convert_files_sequential(self) -> None: for file in os.listdir(self.audios_dir): if file.endswith(self.input_format): self.convert_file(os.path.join( self.audios_dir, file), self.output_format)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_all(input: str, out: str):\n dateien = listdir(input)\n for datei in dateien:\n out_datei = datei.replace(\" \", \"_\") # Leertasten durch Unterstriche ersetzen\n convert_image(input + datei, out + out_datei)", "def convert_files_parallel(self) -> None:\n file_paths = []\n...
[ "0.6980223", "0.68358386", "0.6766979", "0.6410417", "0.6409606", "0.6405167", "0.63713694", "0.61938375", "0.6193601", "0.6110876", "0.6098057", "0.6086324", "0.6071828", "0.60103554", "0.6003108", "0.59726304", "0.5959111", "0.5943927", "0.59355336", "0.58738846", "0.585644...
0.75851184
0
Iterates over every file in the dir with the input_format and converts it to the output_format in a parallel way
def convert_files_parallel(self) -> None: file_paths = [] for file in os.listdir(self.audios_dir): if file.endswith(self.input_format): file_paths.append(os.path.join( self.audios_dir, file)) with Pool(cpu_count()) as p: p.map(self.conv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_files_sequential(self) -> None:\n for file in os.listdir(self.audios_dir):\n if file.endswith(self.input_format):\n self.convert_file(os.path.join(\n self.audios_dir, file), self.output_format)", "def batch_convert(inputfiles, outputdir=None, fnfmt=...
[ "0.72859514", "0.68003356", "0.6771104", "0.6524911", "0.64170337", "0.6294985", "0.6283942", "0.62162393", "0.62076217", "0.6120828", "0.60920906", "0.6085274", "0.6048088", "0.598506", "0.59437376", "0.591172", "0.588044", "0.58707225", "0.5869432", "0.58523726", "0.5832397...
0.74059594
0
Get the type of number from the originator's type.
def tonFromType(t: str) -> TypeOfNumber: if t in TONS: return TONS[t] raise Exception("Unknown number type (%s) for originator" % t)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def typecode (self) :\r\n return self.numeric_typecode", "def getNumber():", "def _type(self):\n return self._id[1]", "def type(self) -> int:\n raise NotImplemented", "def type_(type_):\n\n try:\n type_ = float(type_)\n if type_.is_integer():\n return int\n ...
[ "0.63508254", "0.6247579", "0.6091169", "0.58599746", "0.5775129", "0.5753174", "0.57295257", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", "0.5719808", ...
0.73939365
0
Gets keys from keystore and knownhosts store
def get_keys(opts): hosts = KnownHostsStore() serverkey = hosts.serverkey(opts.vip_address) key_store = KeyStore() publickey = key_store.public secretkey = key_store.secret return {"publickey": publickey, "secretkey": secretkey, "serverkey": serverkey}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetSSHKeys():\n keydict = {}\n for rec in database.db.itervalues():\n if 'keys' in rec:\n keydict[rec['name']] = rec['keys']\n return keydict", "def get_hostkey_list(self):\n return self.hostkey", "def list_user_keys(self):\n return AlgoliaUtils_request(self.headers...
[ "0.64135724", "0.63342404", "0.6199463", "0.6130279", "0.61189514", "0.6081735", "0.60500073", "0.604882", "0.602405", "0.60201603", "0.60074025", "0.5991858", "0.5982021", "0.5973131", "0.59317154", "0.5926179", "0.59234756", "0.5888831", "0.5884009", "0.58473575", "0.584668...
0.7595132
0
Set the active plugin
def set_active_plugin(self, unused): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetActiveObject(self):", "def set_active(self):\n self.active = True", "def set_active(self, active):\n self.active = active", "def set_active(self, active):\n self._active = active", "def control_plugin(self):\n pass", "def _activate(self):\n self.active = True", ...
[ "0.67446715", "0.6735788", "0.6717132", "0.6485941", "0.64724195", "0.64215094", "0.63492775", "0.6326862", "0.6326862", "0.63102853", "0.6224275", "0.6224275", "0.6224275", "0.6224275", "0.60347235", "0.5996666", "0.597586", "0.5957037", "0.57954144", "0.5794472", "0.5779486...
0.8738944
0
Return a list of all plugins
def get_plugins(self): return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(self):\n return self.rpc.call(MsfRpcMethod.PluginLoaded)['plugins']", "def list_plugins():\n l = list()\n for dir in os.listdir(PLUGIN_DIRECTORY):\n l.append(dir)\n return l", "def plugin_list(self):\r\n return get_module_list()", "def list_plugins(request):\n plugin...
[ "0.86924815", "0.8555348", "0.8471971", "0.8348018", "0.82457983", "0.81805515", "0.8170836", "0.80438006", "0.7999067", "0.7954532", "0.7929944", "0.79130113", "0.7805088", "0.7800808", "0.77780414", "0.7647384", "0.7632655", "0.7590467", "0.7555945", "0.7551472", "0.753365"...
0.87810713
0
return lexicons from corpus who has been tokenized
def get_lexicons(n_words): lexicons = [] for words in n_words: lexicons.extend(words) return list(set(lexicons))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokens(self):\n\t\tlabels_and_synonyms = list(itertools.chain.from_iterable(list(self.term_to_tokens.values())))\n\t\ttokens = set(list(itertools.chain.from_iterable([word_tokenize(x) for x in labels_and_synonyms])))\n\t\treturn(list(tokens))", "def getLexicon(self):\n #return self._getOb('Lexicon')\n...
[ "0.6437062", "0.6362651", "0.6285286", "0.61697775", "0.61200374", "0.6105283", "0.60897243", "0.6027985", "0.60277593", "0.60257214", "0.59871453", "0.59871453", "0.5984452", "0.5970542", "0.5933215", "0.59287083", "0.59079117", "0.5903032", "0.58871126", "0.5864099", "0.584...
0.6720507
0
Applies the edge detection gates to a quantum circuit.
def _qc_edge_detect(qc, even_cols=True, inplace=False, mean_diff=False): if not inplace: qc = qc.copy() for reg in qc.qregs: if not even_cols: qc = _shift_amplitudes(qc, 1 if not mean_diff else 2, inplace=inplace) if mean_diff: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edges(image):\n #store image width and height and initialize new image\n image_width = image['width']\n image_height = image['height']\n new_image = {'height': image['height'], 'width': image['width'], 'pixels': len(image['pixels'])*[0]}\n \n #sobel operator kernels\n kernel_x = {'height':...
[ "0.56408423", "0.5376207", "0.5343812", "0.53200954", "0.52952576", "0.528185", "0.52520835", "0.52503884", "0.5249026", "0.52237076", "0.51336", "0.5097702", "0.5082932", "0.5044407", "0.50020754", "0.49914232", "0.49709845", "0.49613097", "0.49451944", "0.494035", "0.493373...
0.5462923
1
Apply an nshift gate to a quantum circuit.
def _shift_amplitudes(qc, n, inplace=False): if not inplace: qc = qc.copy() for q_reg in qc.qregs: # Unitary gate representing the shift operation on n qubits shift_matrix = np.roll(np.eye(2**q_reg.size), n, axis=1) # Add the gate to the circuit qc.append(UnitaryGate(shif...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def s_dg(self, q0, ctrl=None):\n self.__add_quantum_gate(kind=PHASE_SHIFT_S_, qid=[q0], ctrl=ctrl)\n return self", "def bshift_nb(a, n):\n return bshift_1d_nb(a, n)", "def fshift_nb(a, n):\n return fshift_1d_nb(a, n)", "def to_instruction(self):\n return self.to_circuit().to_gate()...
[ "0.51957613", "0.5187607", "0.50957566", "0.50402135", "0.503946", "0.50011796", "0.49901596", "0.4960909", "0.4952623", "0.4950438", "0.4923167", "0.48833564", "0.4827508", "0.4827508", "0.48250613", "0.48175824", "0.48156825", "0.480668", "0.48003733", "0.47948095", "0.4788...
0.6484144
0
Add a widget (of the class specified in the constructor) to the bank.
def add(self, *args, **kwargs): widget = self.widget_cls(self, *args, **kwargs) self.widgets.append(widget) widget.pack(**self.pack_opts) return widget
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, widget: Component) -> None:\n self._add(widget)", "def add_widget():\n\n return render_template('add_widget.html', widget=None)", "def create_widget(self):\n pass", "def add_widget(self, widget, new_name=False):\n # we don't list placeholders\n if isinstance(widge...
[ "0.709838", "0.6903494", "0.67959785", "0.6773084", "0.6761934", "0.6687064", "0.6664474", "0.6661142", "0.6422594", "0.6348762", "0.630266", "0.63022584", "0.6265175", "0.62514853", "0.6231901", "0.62143654", "0.62003225", "0.6136802", "0.6130448", "0.6106662", "0.609994", ...
0.7004985
1
Remove the given widget from the bank. This will fail if the widget is not in the bank.
def remove(self, widget): self.widgets.remove(widget) widget.destroy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_widget(self, widget_position):\r\n\r\n # Remove the specified widget\r\n self.widgets_list.pop(widget_position)\r\n\r\n # Refresh the scroll area\r\n self._refresh()", "def unbindWidget(self, widget):\n\n # Figure out the index into __boundWidgets,\n # as we n...
[ "0.67667335", "0.65547377", "0.64291644", "0.64177626", "0.6086388", "0.6072363", "0.5998136", "0.5850074", "0.58103734", "0.57862264", "0.57408494", "0.56574476", "0.56295663", "0.5590097", "0.55320245", "0.55259603", "0.5507062", "0.54403585", "0.54196113", "0.53926814", "0...
0.742029
0
Move the pointer to reflect a change made to ``Gyro.pointer_frac`` or the radius.
def update_pointer(self): pointer_length = -self.pointer_frac * self.radius # Add pi/2 to the angle because we consider 0 radians to be pi/2 in standard position. x = pointer_length * math.cos(self._radians + math.pi / 2) y = pointer_length * math.sin(self._radians + math.pi / 2) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(self, p):\r\n self.position.setvalue(p)", "def move_forward(self, val):\n val = val * 180 / math.pi\n print(\"gyro diff\", self.gyro - val)\n print(\"gyrof\", self.gyro)\n if math.fabs(self.gyro - val) > 0.6:\n if self.gyro - val > 0:\n self.om_ri...
[ "0.61081266", "0.6020182", "0.58973384", "0.58944005", "0.5837245", "0.58157206", "0.5713067", "0.5684179", "0.56672317", "0.563868", "0.5634927", "0.5633495", "0.56288755", "0.56173927", "0.560045", "0.5566966", "0.5554059", "0.5534108", "0.5516651", "0.55150187", "0.5513884...
0.7390573
0
Change the canvas's scrollregion to reflect a change made to ``Gyro.circ_pad`` or the radius.
def update_scroll_region(self): self.configure(scrollregion=(-self._radius - self.circ_pad, -self._radius - self.circ_pad, self._radius + self.circ_pad, self._radius + self.circ_pad))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __reconfig__(self, event):\r\n x, y = event.width//2, event.height//2\r\n self.canvas.config(scrollregion=(-x, -y, x, y))", "def set_scrollregion(self, event=None):\n self.canvas.configure(scrollregion=self.canvas.bbox('all'))", "def on_configure(self, event):\n self.testCanvas....
[ "0.6519079", "0.6516638", "0.60711473", "0.60119116", "0.5765868", "0.57313836", "0.56846607", "0.55534095", "0.5489553", "0.5466302", "0.54653174", "0.544385", "0.54332244", "0.54172426", "0.54033566", "0.53885525", "0.5371049", "0.5363052", "0.53378415", "0.5244353", "0.523...
0.7807882
0
Internal method used as the callback for "" events if the ``auto_resize`` parameter was set in the constructor. This method updates the radius of the gyro according to any new space allocated/removed by resizing this gyro's parent widget.
def _on_configure(self, event): self.radius = (min(event.width, event.height) - 2 * self.circ_pad) / 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def changeRadius(self):\r\n self.curRadius= self.edit_rad.value()", "def gyroscope(self):\n raw = self.read_raw()\n # Compensate values depending on the resolution\n factor = 0\n if self._gyro_range == GYRO_RANGE_250DPS:\n factor = _GYRO_SENSITIVITY_250DPS\n e...
[ "0.56140345", "0.55083174", "0.54029346", "0.5339717", "0.527671", "0.52446693", "0.52438504", "0.51764804", "0.517351", "0.50903213", "0.50865734", "0.5082968", "0.50645924", "0.50562173", "0.5042392", "0.5042252", "0.50400823", "0.5032706", "0.4988998", "0.4978639", "0.4977...
0.5922251
0
Wrapper around ``tkinter.Canvas.create_oval`` to make constructing circles more intuitive.
def create_circle(self, x, y, r, **kwargs): return self.create_oval(*self.circ_to_oval(x, y, r), **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_oval(centerx, centery, radiusx, radiusy):\r\n global _canvas\r\n global _current_color\r\n if _canvas == None:\r\n raise RuntimeError(\"Canvas is not open yet.\")\r\n else:\r\n oval = Ellipse(radiusx * 2, radiusy * 2, Point(centerx, centery))\r\n _set_not_filled(oval)\r\n ...
[ "0.740658", "0.70530504", "0.69541764", "0.66446006", "0.6630347", "0.65782756", "0.65251106", "0.64284277", "0.639205", "0.6383982", "0.6344532", "0.6344419", "0.63228714", "0.6318555", "0.6304312", "0.6300076", "0.6299974", "0.62963027", "0.6232296", "0.62321067", "0.623210...
0.7324109
1
A merged yview function for both listboxes so that they can both be controlled via a single scrollbar.
def _merged_yview(self, *args): self._curr_scroll_row = round(float(args[1]) * len(self._items)) self.key_listbox.yview(*args) self.value_listbox.yview(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_scrollbar(self, *args) -> None:\r\n for textbox in self.textboxes:\r\n textbox.yview(*args)", "def _wheel_scroll(self, event):\n # For some unknown reason, when using a single scrollbar to control two listboxes they get out of sync by\n # exactly four listbox rows, with th...
[ "0.65716594", "0.6403848", "0.6171197", "0.5906714", "0.590537", "0.58961487", "0.5853431", "0.5840142", "0.574654", "0.56471264", "0.55247146", "0.549563", "0.5481614", "0.54067636", "0.5331052", "0.5165563", "0.5161623", "0.5130789", "0.51030886", "0.5081447", "0.5072545", ...
0.80449617
0
Internal method used as the callback for "" events on the ``NTBrowser.value_listbox`` listbox.
def _value_double_click_callback(self, _): # Theoretically, it should be impossible to double click with more than one row selected, but just in case... if len(self._curr_indices) != 1: return # TODO: Some sort of warning or error idx = self._curr_indices[0] # If the selecte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _listbox_select_callback(self, _):\n self._curr_indices = self.key_listbox.curselection() or self.value_listbox.curselection()\n if self._curr_indices:\n kind = None\n for idx in self._curr_indices:\n # Break if any one of the selected rows is a table.\n ...
[ "0.5948485", "0.5464463", "0.54287314", "0.53957975", "0.5314232", "0.52849394", "0.52756107", "0.5226529", "0.5224342", "0.51857364", "0.5114669", "0.50461906", "0.5035057", "0.50216883", "0.49927568", "0.49483776", "0.49319267", "0.4920771", "0.4919687", "0.4893917", "0.485...
0.5732047
1
Create a popup window displaying the type and value of the entry corresponding to the given index.
def _create_entry_popup(self, idx): entry = self._items[idx] frame = style.Frame(self._entry_popup, style=self._style) # Make only the Text widget (which holds the entry's value) resizeable. frame.grid_columnconfigure(1, weight=1) frame.grid_rowconfigure(1, weight=1) s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_entry(var, win):\n\tif var.type.is_range():\n\t\tentry = build_range_entry(var, win)\n\telif var.type.is_enum():\n\t\tentry = build_enum_entry(var, win)\n\telse:\n\t\tentry = Gtk.Label(var.label)\n\tif var.help != \"\":\n\t\tentry.set_tooltip_text(var.help)\n\treturn entry", "def create_enter_window():...
[ "0.6107635", "0.586574", "0.5803055", "0.5757768", "0.56584376", "0.5515487", "0.54225373", "0.54172885", "0.5414938", "0.54008657", "0.53888977", "0.5383401", "0.53501904", "0.53457284", "0.5318706", "0.5294884", "0.5285082", "0.52751756", "0.52650523", "0.52553993", "0.5254...
0.79831636
0
Populate the listboxes with subtables, entries, and entry values from the given table. If the given table is not the root table, the parent table is added first. Secondly, all the subtables of the given table are added. Finally, all the entries in the given table are added.
def _populate(self, table): # Repopulating the listboxes will reset the scroll. self._curr_scroll_row = 0 # Repopulating the listboxes will reset the selection, so make sure the entry defaults to disabled. self._disable_entry() self._clear() # Initialize the _last_table_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_table(self,table):\n \n attr_list = []\n name = None\n comment = \"\"\n new_table = None\n t_id = table.attrib['id']\n \n \n #first cycles the child elements to find table name\n #and creates a table object\n for child in table:\n...
[ "0.5929662", "0.57869035", "0.55826676", "0.5549117", "0.5484225", "0.54469144", "0.54396", "0.5415753", "0.53740215", "0.53524214", "0.52699876", "0.5186455", "0.5172036", "0.5148817", "0.51448447", "0.512716", "0.5127114", "0.51145", "0.51127374", "0.5099474", "0.5071505", ...
0.8036582
0
Add the given key and value to the listboxes and add the given networktables table or entry to the ``NTBrowser._items`` list.
def _append_row(self, key, value, item): self._items.append(item) self.key_listbox.insert(tk.END, key) self.value_listbox.insert(tk.END, value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_new(self, item, key):\n if key in self._items:\n raise DuplicateListHeapItemException(key)\n if len(self._items) >= self._max_limit:\n raise MaxItemLimitReachedException()\n self._items[key] = item\n self._listbox.insert(END, key)", "def AddToDictList(d, ...
[ "0.5536693", "0.5482763", "0.5453655", "0.53345376", "0.52900016", "0.5267623", "0.5198815", "0.51870805", "0.51286155", "0.5096395", "0.50895745", "0.5062756", "0.50607955", "0.505846", "0.50101596", "0.49821764", "0.49363694", "0.49264455", "0.491183", "0.4908686", "0.48800...
0.6614177
0
Clear both listboxes and the items list.
def _clear(self): self._items = [] self.key_listbox.delete(0, tk.END) self.value_listbox.delete(0, tk.END)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _remove_all(self):\n self._items.clear()\n self._listbox.delete(0, END)", "def Clear(self):\r\n\r\n self._items = []\r\n self._sizer_element_count = 0", "def clear(self):\n for inp in self.inputlst:\n inp.setText(\"\")", "def clear(self):\n self._items...
[ "0.7925446", "0.7328249", "0.70587397", "0.69114953", "0.6862008", "0.68342716", "0.6832405", "0.6804097", "0.6637174", "0.661914", "0.66162944", "0.66101193", "0.6556318", "0.6546479", "0.6545188", "0.65023035", "0.6499432", "0.6478096", "0.6478096", "0.64723617", "0.6469652...
0.8492629
0
Internal method used as the callback for "" events on the ``NTBrowser.insert_entry`` and command on the ``NTBrowser.insert_button``. This sets the value on the selected entries to whatever is in the tkinter entry.
def _insert_callback(self, _=None): try: value = ntutils.type_cast(self.insert_entry.get(), self._items[self._curr_indices[0]].getType()) for idx in self._curr_indices: ntutils.set_entry_by_type(self._items[idx], value) # Reload when done to assure the new dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _value_double_click_callback(self, _):\n # Theoretically, it should be impossible to double click with more than one row selected, but just in case...\n if len(self._curr_indices) != 1:\n return # TODO: Some sort of warning or error\n idx = self._curr_indices[0]\n # If t...
[ "0.6097229", "0.58054435", "0.57434785", "0.57090974", "0.5661242", "0.56295484", "0.56274754", "0.5625571", "0.55791736", "0.5555046", "0.555382", "0.5523306", "0.5477943", "0.5414632", "0.53940195", "0.5379563", "0.5369047", "0.5358284", "0.5353597", "0.53533155", "0.532508...
0.7391951
0
Clear the entry and disable the entry and button, making them unable to be interacted with.
def _disable_entry(self): self.insert_entry.delete(0, tk.END) self.insert_entry.configure(state=tk.DISABLED) self.insert_button.configure(state=tk.DISABLED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _enable_entry(self):\n self.insert_entry.configure(state=tk.NORMAL)\n self.insert_button.configure(state=tk.NORMAL)", "def disable(self):\n self.colour_combo.config(state=tk.DISABLED)\n self.game_name_entry.config(state=tk.DISABLED)\n self.num_tickets_entry.config(state=tk....
[ "0.7374178", "0.7091176", "0.69988054", "0.6810369", "0.6747967", "0.6718996", "0.66457295", "0.66114336", "0.6587659", "0.657904", "0.65177935", "0.6464455", "0.6444957", "0.64396936", "0.64141905", "0.6369983", "0.6315798", "0.6310327", "0.6289078", "0.6275729", "0.6267464"...
0.8018426
0
Enable the entry and button, allowing them to be interacted with.
def _enable_entry(self): self.insert_entry.configure(state=tk.NORMAL) self.insert_button.configure(state=tk.NORMAL)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable(self):\n self.colour_combo.config(state=tk.NORMAL)\n self.game_name_entry.config(state=tk.NORMAL)\n self.num_tickets_entry.config(state=tk.NORMAL)", "def entryToggle(self):\n status = \"normal\" if self.optionVar.get() == 4 else \"disabled\"\n for i in range(3):\n ...
[ "0.7409319", "0.71389174", "0.70984125", "0.7005315", "0.69770306", "0.6830249", "0.6821063", "0.6814235", "0.66365004", "0.66365004", "0.6594615", "0.6568778", "0.6562422", "0.6550833", "0.64541245", "0.6368428", "0.6348056", "0.6330938", "0.62833095", "0.62203044", "0.62186...
0.8187393
0
Internal method used as the callback for ">" events on the listboxes. This method enables or disabled the entry as appropriate to the new data selection and sets ``NTBrowser._curr_indices``.
def _listbox_select_callback(self, _): self._curr_indices = self.key_listbox.curselection() or self.value_listbox.curselection() if self._curr_indices: kind = None for idx in self._curr_indices: # Break if any one of the selected rows is a table. i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable_selected(self, window, values, branch_log_dict, key_event):\n utils.convert_to_numeric(values)\n if(values[key_event] in branch_log_dict[key_event]):#if there is branching for the chosen option\n for element_key in branch_log_dict[key_event][values[key_event]]:\n ...
[ "0.56618375", "0.5659626", "0.5594502", "0.55678624", "0.55105686", "0.54801536", "0.5462772", "0.5423531", "0.5406913", "0.5393726", "0.53336704", "0.5322919", "0.5308489", "0.5301149", "0.5258873", "0.5217732", "0.5205504", "0.5205093", "0.51920545", "0.5189554", "0.5184486...
0.6361306
0
Metodo que envia el Dni seleccionado a un Metodo de la Clase MetodosBD y elimina de la base de datos al vendedor, luego llama al metodo recarga los ComboBox y al de limpiar los Entrys
def on_remove_clicked(self, control): # Recogemos el valor del ComboBox dniBaja = self.cbDniRemove.get_active_text() # Lo enviamos al metodo de la Clase MetodosBD MetodosBD.MetodosBD.borrar_vendedor(self, dniBaja) # Metodo que refresca los Combobox vendedores.actualizar_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_vendedor(self, control):\n\n # Sacamos el texto seleccionado del ComboBox\n dniSelect = self.cbDniAdd.get_active_text()\n\n # Condición para que sí no hay nada seleccionado en el Combox no haga una consula en vacío\n if not dniSelect == None:\n # Al selecionar el C...
[ "0.6170028", "0.5915866", "0.5834186", "0.55128026", "0.55051804", "0.5465432", "0.54020417", "0.54001635", "0.5369259", "0.53511274", "0.5347668", "0.5345777", "0.5301571", "0.5253992", "0.52424556", "0.5225088", "0.5221306", "0.51731884", "0.51015127", "0.50831175", "0.4994...
0.6815479
0
Metodo para navegar a la ventana TablaVendedores
def on_tabla_vendedores_clicked(self, Button): tablavendedores = TablaVendedores.tablaVendedores(self.tipo, self.id, self.nombre) self.set_visible(False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def limpiarVentana(self):\n self.limpiarTabla(self.tableFactura)\n self.lineNumero.setEnabled(True)\n self.lineNumero.clear()\n self.limpiarTabla(self.tableNC)", "def limpiarVentana(self):\n\n self.productosAgregados=0\n self.lotesVentas={}\n self.facturaCobrada=F...
[ "0.7634896", "0.6529628", "0.6476412", "0.6044319", "0.60242695", "0.5978414", "0.59579563", "0.59432954", "0.59077317", "0.5905856", "0.57944804", "0.5777909", "0.5723357", "0.56998986", "0.5681946", "0.5668569", "0.56681406", "0.5663566", "0.56567395", "0.5638073", "0.56278...
0.68094844
1
mu = k sqrt(1 + m2/m1)
def mu_sun(m2_over_m1: float) -> float: mu = K * np.sqrt(1. + m2_over_m1) return mu * mu
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mu(k, z):\n return 1", "def kl(mu1, mu2):\n return (mu2-mu1)**2/2", "def kl(mu1, mu2):\n return (mu2-mu1)**2/2", "def mu_gm1m2(m1: float, m2: float) -> float:\n from astropy.constants import G\n\n return G * (m1 + m2)", "def kl(mu1, mu2):\n return (mu2 - mu1) ** 2 / 2", ...
[ "0.7373971", "0.7282575", "0.7282575", "0.71900904", "0.713643", "0.70311916", "0.6701206", "0.66690695", "0.6589319", "0.6589319", "0.653416", "0.6494656", "0.64828813", "0.6404334", "0.6363272", "0.6352015", "0.63444686", "0.63004714", "0.62986004", "0.62357163", "0.6228569...
0.75852823
0
mu = n^2 / a^3
def mu_na(n: float, a: float) -> float: return n * n * a * a * a
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mu(k, z):\n return 1", "def npa_norm(a):\n\n return a / sum(a)", "def blauNormal(blau, N):\n nom = blau - (1/N)\n den = 1 - (1/N)\n\n return nom / den", "def U(n,gamma,A,y):\n return (2*A*gamma*math.sin(math.pi*n*y/A) - 2*math.pi*n*math.cos (math.pi*n*y/A))/(A**2*gamma**2 + math.pi**2 *...
[ "0.71695036", "0.6887994", "0.6764852", "0.6750625", "0.6626473", "0.65062326", "0.646334", "0.6444955", "0.6417958", "0.63273966", "0.6327223", "0.6312752", "0.6302596", "0.6301676", "0.6299949", "0.6273926", "0.6273746", "0.62690264", "0.6258225", "0.62508994", "0.6235605",...
0.79202384
0
mu = G (m1 + m2)
def mu_gm1m2(m1: float, m2: float) -> float: from astropy.constants import G return G * (m1 + m2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mu(o1, o2):\n return o1*o2", "def M_g(self):\n\n print(\"\", file=self.logfile)\n print(\"Updating g\", file=self.logfile)\n M_mu1 = np.lib.stride_tricks.as_strided(self.mu_pad,\n shape=[self.P+1, self.L_h],\n ...
[ "0.6987635", "0.685425", "0.64364874", "0.6391254", "0.6263511", "0.62258524", "0.6198913", "0.6146619", "0.6080753", "0.60386586", "0.60144967", "0.6013963", "0.60115695", "0.59763104", "0.5964742", "0.59455556", "0.59150636", "0.5887213", "0.58644265", "0.5807733", "0.58037...
0.81322044
0